# Math Help - dice throwing problem

1. ## dice throwing problem

Hi,

I have the following problem that i don't know how to start solwing. I want to know if an occurence of my dice throwing outcomes is higher or lower then expected. I'll try to describe the problem as much as i can but if i miss something please feal free to ask. All I am looking for is a kick in the right direction.

let say i have two sets of dices one is black (B) the other is white (W). Now when i throw black dices (let say there are b black dices and w white ones) i get an outcome like this B={2,4,2,1,1,4,5,6 }. Then i throw the white ones and i get W={2,1,1,3,3}. My question is : given that B and W share 3 outcomes (shared outcomes: 1,1,2), is that more or less then expected. how would i start modeling my particular problem.

Is it clear what i am looking for?? So I am interested to know if the intersect of shered outcomes is something that i would expect or not. My model should only depend on b and w. Can someone please help me get started.

baxy

2. ## Re: dice throwing problem

Define $E(b,w)$ as the expected number of matching pairs of dice when there are $b$ black dice and $w$ white dice. Define $P(b)$ as the probability that a randomly chosen white die matches at least one of the $b$ black dice. Then $E(b,w) = P(b)(1+E(b-1,w-1)) + (1-P(b))E(b,w-1)$ gives a recurrence relationship for the expected value.

$P(b) = 1-\left(\dfrac{5}{6}\right)^b$ since this is the probability that among the $b$ black dice, none of them rolled the same as the one white die.

Hence, $E(b,w) = \left(1-\left(\dfrac{5}{6}\right)^b\right)(1+E(b-1,w-1)) + \left(\dfrac{5}{6}\right)^bE(b,w-1)$ and $E(n,0) = E(0,n) = 0$

Next, I would recommend looking into generating functions (or calculate for small $(b,w)$ using a statistics engine like R).

3. ## Re: dice throwing problem

Originally Posted by SlipEternal
$P(b) = 1-\left(\dfrac{5}{6}\right)^b$ since this is the probability that among the $b$ black dice, none of them rolled the same as the one white die.
That should read, "since this is the complement of the probability that..."

4. ## Re: dice throwing problem

Originally Posted by SlipEternal
Define $E(b,w)$ as the expected number of matching pairs of dice when there are $b$ black dice and $w$ white dice. Define $P(b)$ as the probability that a randomly chosen white die matches at least one of the $b$ black dice. Then $E(b,w) = P(b)(1+E(b-1,w-1)) + (1-P(b))E(b,w-1)$ gives a recurrence relationship for the expected value.

$P(b) = 1-\left(\dfrac{5}{6}\right)^b$ since this is the probability that among the $b$ black dice, none of them rolled the same as the one white die.

Hence, $E(b,w) = \left(1-\left(\dfrac{5}{6}\right)^b\right)(1+E(b-1,w-1)) + \left(\dfrac{5}{6}\right)^bE(b,w-1)$ and $E(n,0) = E(0,n) = 0$

Next, I would recommend looking into generating functions (or calculate for small $(b,w)$ using a statistics engine like R).
Just one question, how is this dependent on w , how is $E(b,w-1)$ defined??

5. ## Re: dice throwing problem

By the way, "dices" is a verb meaning to cut into small pieces. The noun, "dice", referring to small cubes often used for gambling, is already plural. It is the plural of "die" which refers to a single such cube.

6. ## Re: dice throwing problem

Originally Posted by baxy77bax
Just one question, how is this dependent on w , how is $E(b,w-1)$ defined??
Look up recurrence equations.

Examples (for $b\ge w$):
$E(b,0) = 0$
This starts the recursion.
$E(b,1) = \left( 1 - \left( \dfrac{5}{6} \right)^b \right) \left( 1 + E(b-1,0) \right) + \left( \dfrac{5}{6} \right)^bE(b,0)$
Since $E(b,0) = 0$ for all $b$, $E(b-1,0)=0$ also. So, you can simplify the equation:
$E(b,1) = 1-\left( \dfrac{5}{6} \right)^b$
Next, let's look at $E(b,2), b\ge 2$:
$E(b,2) = \left( 1- \left( \dfrac{5}{6} \right)^b \right)\left( 1 + E(b-1,1) \right) + \left( \dfrac{5}{6} \right)^bE(b,1)$
We just found $E(b,1)$, so we can plug that in. For $E(b-1,1)$, just plug in $b-1$ to the formula for $E(b,1)$. After plugging in and factoring, you get:
$E(b,2) = \left(1-\left( \dfrac{5}{6} \right)^b\right) \left(2- \left( \dfrac{5}{6} \right)^{b-1} + \left( \dfrac{5}{6} \right)^b \right)$
You can keep going ad infinitum. The formula does depend on w, as you can see. It does so recursively. Again, to understand the concept better, you should read up on recurrence relations and equations.

Edit: you can multiply out the formula I found for $E(b,2)$:

$E(b,2) = \dfrac{1}{5}\left( 10 - 11\left( \dfrac{5}{6} \right)^b + \left( \dfrac{5}{6} \right)^{2b} \right)$

This pattern appears to continue so that $E(b,w) = \dfrac{1}{5^{f(w)}} \sum_{k=0}^w (-1)^k a_k \left( \dfrac{5}{6} \right)^{kb}$ where the coefficients $a_k$ are all positive integer. I am not sure what $f(w)$ is yet, but it is definitely an increasing function. Obviously, $f(0)=f(1)=0, f(2)=1$, and while I did not calculate it for you, $f(3)=3$. It is possible you can find a pattern for the coefficients.

7. ## Re: dice throwing problem

thnx, i get it now i did not take a carefull enough look at what you written before. so sorry for making you write it.

baxy

8. ## Re: dice throwing problem

Interesting. I just tried plugging into the equations $E(0,1), E(0,2), E(1,2)$. Apparently those same equations work when $b. I did not try it for $E(b,3)$, but it may be true in general. If it is, then the sum of the positive coefficients should be the same as the sum of the negative coefficients. So, that might help find a pattern.