Dice Expectation

is it a proper question? … there is no input or output

You just have to output the expected number of dice throws to get a 4.

Probability p of getting a 4 in throwing a die is 1/6 and the probability (q) of not getting a 4 is 1−1/6 = 5/6. Let xth throw of the die results in a 4. This means that preceding (x-1) throws do not result in a 4. So, the probability function is p(x) = (q^(x−1))*p for x= 0,1,2,…….

Hence, E(x) = Summation( x * (q^(x-1)) * p), where x =1 to x = ∞

= p Summation(x q^(x−1)), where x =1 to x = ∞

=p(1+2q+3q^2+4q^3+…)

=p ((1−q)^(−2))

=1/6 ((1−5/6)^(−2))

=1/6 ∗ 36 = 6

Hope this helps

@imavneet Please mark your doubt as resolved if you are satisfied

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.