Tuesday, September 4, 2018

permutations - Calculating the probability of receiving all possible rewards after 15 events




I encountered this question in my Data Management and Statistics textbook. I tried to calculate the probability using binomial theorem and combinations/permutations, but I could only get close to the answer. I would really appreciate any help with this question:



If Joe buys a cereal box and it has the following probabilities of giving one of the five possible rewards:




  • Toy Car: 20%

  • Toy Truck: 30%

  • Toy Spoon: 10%

  • Toy Doll: 35%


  • Toy Gun: 5%



What is the probability of Joe getting all the rewards after buying 15 cereal boxes?



Thank you in advance


Answer



Use the Inclusion/Exclusion principle:





  1. Start with 1


  2. Subtract the following:




    • The probability of not winning C is (10.20)15

    • The probability of not winning T is (10.30)15

    • The probability of not winning S is (10.10)15

    • The probability of not winning D is (10.35)15

    • The probability of not winning G is (10.05)15



  3. Add the following:




    • The probability of not winning C,T is (10.200.30)15

    • The probability of not winning C,S is (10.200.10)15

    • The probability of not winning C,D is (10.200.35)15

    • The probability of not winning C,G is (10.200.05)15

    • The probability of not winning T,S is (10.300.10)15

    • The probability of not winning T,D is (10.300.35)15

    • The probability of not winning T,G is (10.300.05)15


    • The probability of not winning S,D is (10.100.35)15

    • The probability of not winning S,G is (10.100.05)15

    • The probability of not winning D,G is (10.350.05)15


  4. Subtract the following:




    • The probability of not winning C,T,S is (10.200.300.10)15

    • The probability of not winning C,T,D is (10.200.300.35)15

    • The probability of not winning C,T,G is (10.200.300.05)15


    • The probability of not winning C,S,D is (10.200.100.35)15

    • The probability of not winning C,S,G is (10.200.100.05)15

    • The probability of not winning C,D,G is (10.200.350.05)15

    • The probability of not winning T,S,D is (10.300.100.35)15

    • The probability of not winning T,S,G is (10.300.100.05)15

    • The probability of not winning T,D,G is (10.300.350.05)15

    • The probability of not winning S,D,G is (10.100.350.05)15


  5. Add the following:





    • The probability of not winning C,T,S,D is (10.200.300.100.35)15

    • The probability of not winning C,T,S,G is (10.200.300.100.05)15

    • The probability of not winning C,T,D,G is (10.200.300.350.05)15

    • The probability of not winning C,S,D,G is (10.200.100.350.05)15

    • The probability of not winning T,S,D,G is (10.300.100.350.05)15




Please note that the sum of the probabilities is equal to 1.




If it was smaller, then you would also need to subtract the probability of not winning C,T,S,D,G.






Here is a Python script for calculating that:



p = [0.20,0.30,0.10,0.35,0.05]

res = 1


for i in range(0,len(p)):
res -= (1-p[i])**15
for j in range(i,len(p)):
res += (1-p[i]-p[j])**15
for k in range(j,len(p)):
res -= (1-p[i]-p[j]-p[k])**15
for n in range(k,len(p)):
res += (1-p[i]-p[j]-p[k]-p[n])**15


print res


The result is 0.54837227253.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...