Question: Estimating Expected Value Interested in collecting baseball cards coming out of cereal boxes There are 5 types of cards Buy 4 boxes, come home, open

Estimating Expected Value

Interested in collecting baseball cards coming out of cereal boxes

There are 5 types of cards

Buy 4 boxes, come home, open all boxes and check all cards

What is the expected number of different cards

E.g. if we get the cards 1, 3, 3, 5 out of 4 boxes, then the number of different cards is 3.

Monte Carlo Approach

Assumption: The probability of getting each card out of a box is equal

Generate the cards coming out of the 4 purchased boxes

Count the number of different cards

Replicate N times and report average over the N trials.

Estimating Expected Value Interested in collecting baseball cards coming out of cereal

Baseball Card Example K def Num_Diff_Cards ( ) : """Generate the cards from the 4 boxes and return how many unique cards there are " "" return None K import math def Monte_Carlo_Cards (N) : """Runs Monte Carlo and return 95% CI""" return None K #Combine everything here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!