You are on page 1of 14

Guzak - Lay 1

Egg-celent Adventure

I. Description, Rules & Directions:

To play the game, the player must pay two dollars. There are three stages, the first bin has

30 eggs and 10 of those eggs have balls inside them, getting one lets you move on to the next

stage. There is a 1/3 chance of winning four dollars on this stage. The next stage has a bin with

36 eggs and 6 eggs with a ball inside them lets the player get to the last stage. There is a 1/6

chance of winning six dollars on this stage. Finally, the last stage is a final bin with 30 eggs and

10 eggs with a ball inside them and there is the prize of nine dollars for picking a correct egg.

There is a 1/10 chance of winning nine dollars on this stage. However, in the case of a loss, the

money gained from previous rounds stays yours.

1. The player must pay two dollars.

2. Look to bin one and pick one egg, if there is a ball in the egg, then move on to the next

round, if the egg is empty, then please accept the loss and leave or try again.

3. If the player wins round one, look to bin two and pick one egg, if there is a ball in the

egg, then move on to the next round, if there is no ball then please accept the loss and

leave or try again. The player may keep whatever money they have won from previous

rounds.

4. If the player wins round two, look to bin three and pick one egg, if the egg has a ball

inside it, then move on to the next round, if the egg has no ball, then please accept the

loss and leave or try again. The player may keep whatever money they have won from

previous rounds.

II. Theoretical Probability I:


Guzak - Lay 2

P(Lose $2) = 2/3

P(Win $4) = 1/3*5/6 = 5/18

P(Win $6) = 1/3*1/6*9/10 = 1/20

P(Win $9) = 1/3*1/6*1/10 = 1/180

P(Win) = 1/3 + 1/6 + 1/180 = 91/180

P(Lose) = 1 - P(Win) = 89/180

Figure 1. Probabilities of Outcomes

The figure above shows all of the possible outcomes and there probabilities. The

probability of losing two dollars is 2/3. The probability of winning two dollars is 5/18. The

probability of winning four dollars is 1/20. The probability of winning nine dollars is 1/180. The

overall probability of winning is 91/180 whereas the overall probability of losing is 89/180.

Tree Diagram:

Figure 2. Tree Diagram of Outcomes

The tree diagram above depicts the possible outcomes for the stages of this game. The

fractions represent the possibility of that specific outcome. Only one branch continues as it is not

possible to play the next the next round after losing the previous one. The sample space below

relates to the figure above, as it list all the possible outcomes before payment for right to play,
Guzak - Lay 3

except for the outcome of losing two dollars. The outcomes represent the net gain after cost of

right to play.

Table 1.
Sample Space For Figure Two
Lose $2 Win $4 Win $6 Win $9
The sample space displays the values of currency that can be won before the cost for right

of play. The one exception being the loss of two dollars if the wrong egg is picked.

III. Theoretical Probability II:

Table 2
Probability Distribution
$ Outcomes 7 4 2 -2

Probability 1/180 1/20 5/18 2/3

E($) = 1/180(7) + 1/20(4) + 5/18(2) + 2/3(-2) = -0.538889

The expected value, for this paper, represents the average amount of money gained or lost

on average for every time this game is played. The net value for the player is found using

expected value, taking the probability of an outcome and multiplying by the values associated

with said outcome. Finally, the sum of all the products is found to calculate the expected value.

The calculated value came out to be a net loss of about 54 cents. This means the game is not fair,

as the negative says that the player loses 54 cents every time he/she plays the game, on average.

IV. Relative Frequencies/ Experimental Probabilities:

Simulation 1: Play the game


Guzak - Lay 4

Table 3
Relative Frequencies Table
Stage One Wins Stage Two Wins Stage Three Wins

19/50 3/19 0/3

Stage One Losses Stage Two Losses Stage Three Losses

31/50 16/19 3/3


E($)= 31/50(-2) + 8/25(2) + 3/50(4) + 0(7) = -0.36

The expected value, for this paper, represents the average amount of money gained or lost

on average for specifically this simulation. The net value for the player is found using expected

value, taking the probability of an outcome and multiplying by the relative frequencies

associated with said outcome. Finally, the sum of all the products is found to calculate the

expected value. The calculated value came out to be a net loss of about 36 cents. This means the

game is not fair, as the negative says that the player loses 36 cents every time he/she plays the

game, on average.

P(Lose $2) = 31/50

P(Win $4) = 19/50*16/19 = 8/25

P(Win $6) = 19/50*3/19*3/3 = 3/50

P(Win $9) = 19/50*3/19*0/3 = 0


Guzak - Lay 5

Figure 3. The Math Behind the Relative Frequency Probability Distribution

The calculations were drawn out as a figure rather than a table as a table would not tell

the whole story as the products are rather random on their own. The multiplication helps to

convey reasoning behind the probability of each specific outcome.

19/50(2) + 31/50(−2) = 0.76 + −1.24 = −0.48

Figure 4. Stage One 50 Trial Simulation

The relative frequency for winning in stage one came out to be 19/50. Simplified, 19/50

is 0.38 and the actual value, 1/3 or 0.3333 repeating, is rather bigger than its theoretical value.

The average money gained or lost can be found by taking the two outcomes, multiplying by the

experimental values and adding them together. So, this means the player is losing 48 cents every

time they play the first stage of this game, on average.

8/25(4) + 0.68(2) = 1.28 + 1.36 = 2.64

Figure 5. Stage Two 50 Trial Simulation

The relative frequency for winning in stage two came out to be 8/25. Simplified, 8/25 is

0.32 and the actual value, 1/6 or 0.1666 repeating, is actually way larger than its theoretical

value. The average money gain/loss was about $ 2.64. So, this means the player is keeping at

least $ 2.64 every time they play the second stage of this game, on average because the only time

to lose their money is in the first stage.

0(7) + 1(4) = 0 + 4 = 4.0

Figure 6. Stage Three 50 Trial Simulation

The relative frequency for winning in stage three came out to be 0/3. Simplified, 0/3 is 0,

and the actual value, 1/10 or 0.1000, is actually significantly lower than its theoretical value. The

average money gain/loss was about $ 4.00. So, this means the player is keeping at least $ 4.00
Guzak - Lay 6

every time they play the third stage of this game, on average because the only time to lose their

money is in the first stage.

Simulation 2: Ti-nspire

This will be simulated by running 500 random numbers. The random numbers will be

generated between 1 to 3. What constitutes a trial is a randomly generated number. The numbers

have meaning, and they correlate to different outcomes. If a 1 is generated it means the player

has won the first stage and gets four dollars, if they lose it means they must pay two dollars. For

every 1 generated, a trial will be ran. The numbers will be generated between 1 to 6. What

constitutes a trial is a randomly generated number. These numbers will have a meaning and

correlate to a new outcome. If a 1 is generated, the player has won the second stage and gets six

dollars, if you get a 2-6 they have lost and gets to keep the four dollars from the first stage.

Finally, for every 1 generated from the second stage, another trial will need to be ran. The

numbers will be generated between 1 to 180. What constitutes a trial is a randomly generated

number. These numbers will have a meaning and correlate to an outcome. If a 1 is generated, the

player has won the third stage and the player will get nine dollars, if they get a 2-10 they have

lost and get to keep the six dollars from the second stage.

0.33(2) + 0.67(−2) = 0.66 + −1.34 = −0.68

Figure 7. Experimental Expected Value Stage One Calculator Simulation

The relative frequency for winning in stage one came out to be 165/500. Simplified,

165/500 is 0.33 and the actual value, 1/3 or 0.3333 repeating, is very close to its theoretical

value. The average money gained or lost can be found by taking the two outcomes, multiplying
Guzak - Lay 7

by the experimental values and adding them together. So, this means the player is losing 68 cents

every time they play the first stage of this game, on average.

0.169(4) + 0.830(2) = 0.6788 + 0.6424 = 1.3212

Figure 8. Experimental Expected Value Stage Two Calculator Simulation

The relative frequency for winning in stage two came out to be 28/165. Simplified,

28/165 is 0.169 repeating, and the actual value, 1/6 or 0.1666 repeating, is actually higher than

its theoretical value. The average money gain/loss was about $ 1.32. So, this means the player is

keeping at least $ 1.32 every time they play the second stage of this game, on average because

the only time to lose their money is in the first stage.

0.0714(7) + 0.9286(4) = 0.5 + 3.7143 = 4.2143

Figure 9. Experimental Expected Value Stage Three Calculator Simulation

The relative frequency for winning in stage three came out to be 2/28. Simplified, 2/28 is

0.0714, and the actual value, 1/10 or 0.1000, is actually significantly lower than its theoretical

value. The average money gain/loss was about $ 4.21. So, this means the player is keeping at

least $ 4.21 every time they play the third stage of this game, on average because the only time to

lose their money is in the first stage.

Simulation 3: Java

The Java code simulation was ran for 5000 trials and each stage recorded every win from

each round. The first stage was the only part of the game to have all 5000 trials ran as the amount

of trials for the next stage depends on the number of wins before hand.

0.3282(2) + 0.6718(−2) = 0.6564 + −1.3436 = −0.6872


Guzak - Lay 8

Figure 10. Stage One Wins and Simulations

In the first stage, there were 1641 winning trials out of 5000. 1641/5000 is equal to

0.3282, which is smaller, but rather close to 1/3 or 0.3333 repeating, the theoretical value. The

average gain/loss per trial is found by finding the experimental expected value, using the

outcome times the relative frequency. So, this means the player is losing at about -0.69 cents

every time they play the first stage of this game, on average because the only time to lose their

money is in the first stage.

0.1566(4) + 0.8434(2) = 0.6264 + 1.6868 = 2.313

Figure 11. Stage Two Wins and Simulations

In the second stage, there were 1641 trials and of those trials there were 257 winning

trials. 257/1641 is equal to 0.1566, which is smaller, but close to 1/6 or 0.1666 repeating, the

theoretical value. The average gain/loss per trial is found again using the same form of

calculations as stage one. So, this means the player is keeping/winning $ 2.31 every time they

play the second stage of this game, on average because the only time to lose their money is in the

first stage.

0.0778(7) + 0.9222(4) = 0.5447 + 3.6887 = 4.2335

Figure 12. Stage Three Wins and Simulations

In the third stage, there were 257 trials and of those trials there were 20 winning trials.

20/257 is equal to 0.0778, which is significantly smaller, than 1/10 or 0.1000, the theoretical

value. The average gain/loss per trial is found again using the same form of calculations as stage
Guzak - Lay 9

one. So, this means the player is keeping/winning $ 4.23 every time they play the third stage of

this game, on average because the only time to lose their money is in the first stage.

V. Summary

This game would be a fantastic addition to any carnival as the game is in favor of the

operator and the easter theme is very eye catching this time of year. The game is unfair with an

expected value of -0.5338 or roughly -0.54, which is good. The meaning behind -0.54 is that on

average, the cost to play this game for the player is about 54 cents per game. Since it cost 54

cents on average for a player to play this game, it is unfair as the player is losing that 54 cents

every time he/she plays this game. This is a huge selling point for the game as it means

guaranteed money for the operator, meaning money for the carnivals owner. The game gets

interesting as the stages progress as the chance of winning decreases after every stage.

The theoretical chances of winning compared to the experimental chances of winning

differs noticeably in certain areas, however in other areas, the probabilities seemed rather equal.

In the first stage there was a 1/3 chance of winning stage one and both the Java simulation (0.33)

and the calculator simulation (0.3282) are rather close to the theoretical value. The Java

simulation ran 5000 trials and was the closest value out of the two experimental values to the

theoretical value. This is most likely due to the Law of Large Numbers, which states that “as the

number of trials increases, the relative frequencies approach the theoretical probabilities”.

Because 5000 is greater than 500, it makes logical sense that Java would have the more reliable

experimental value. The experimental probability for simulation one of this stage was 0.38 or

38% chance. Out of the fifty times this stage was reached, there was a total of nineteen

successes. This means that there was about a one third chance of getting the prize of stage three
Guzak - Lay 10

in simulation one. The average loss of money for the player per trial was about the same for the

Java simulation (69 cents) and the calculator simulation (68 cents). This was not the case

however for the first simulation as the player only lost 48 cents on average.This was the lowest

value and it might have had something to do with the experimental value being less than that of

the theoretical value.

Next, is the theoretical value of the second stage. In the second stage there was a 1/6

chance of winning and the experimental values for stage two turned out to be 0.1566 for the Java

simulation and 0.169 repeating for the calculator simulation. To note, there was only 1641 trials

for the Java simulation by the second stage and 165 trials for the calculator simulation,

respectively. This is due to the amount of winning trials in the stage prior, as the experimental

values would be incorrect had the trial continued on after a loss. This time the calculator had the

closer value to the theoretical value. There is nothing to really suggest that the calculators

experimental value should be greater than the Javas experimental value, as the Java simulation

had 1476 more trials than the calculator simulations. If anything, the Law of Large Numbers

should say that because there was a greater number of trials for the Java simulation, the java

experimental value should be closer to the theoretical values than the calculator. The

experimental probability for simulation one of this stage was 0.1579 or 15.79% chance. Out of

the nineteen times this stage was reached, there was a total of three successes. This means that

there was little chance of getting the prize of stage two in simulation one. The players gained

only $ 2.32 for Java simulation and $ 2.64 for the first simulation. These seemed to be close

enough to each other to be considered non-significant. However, the calculator simulation tells a

different story only playing out $ 1.32. This was the lowest value and it may have had something

to do with the experimental value being less than that of the theoretical value.
Guzak - Lay 11

Finally was the third stage, in the third stage there was a 1/10 chance of winning and the

experimental values were 0.0778 and 0.0714 for the Java and calculator simulations,

respectively. The Java simulation had only 20 trials, as that was how many wins there had been

in the stage prior. As for the calculator simulation, there was only 28 for the previous stages

wins. Even though the Java simulation and calculator simulation trials differed by 8 full trials,

there experimental were very close to each other and much smaller than the theoretical value.

This is due to the Law of Large Numbers, as previously stated “as the number of trials increases,

the relative frequencies approach the theoretical probabilities”, so if the numbers were small,

then the relative frequencies would not be close to the theoretical probabilities, thus the two

experimental values are much smaller than the theoretical. The experimental probability for

simulation one of this stage was 0.00 or 0% chance. Out of the three times this stage was

reached, there was a total of zero successes. This means that there was no chance of getting the

prize of stage three in simulation one. The average gain of money for the player at this round ws

$ 4.23 for the Java simulation, $ 4.21 for the calculation simulation and $ 4 on the dot for the

first simulation. The first simulation was the lowest of the three values because the experimental

values was 0 for one of the two probabilities. Since probabilities must add to 1 the only option

was for the other corresponding experimental value to be a perfect 1/1.

This is the end of the project, I personally want to thank my partner Alex. As this was a

three person project and if given the option to work with only one other person I would have

picked him over anyone else, as he has demonstrated to me hard work, help, and fantastic

partnership skills. Brendon has shown tremendous amount of hard work in this project. With the

workload that we had we took care of it like champs. The paper, besides part one and three, was

mostly done by Brendon. Alex took care of the building of the game while Brendon helped to
Guzak - Lay 12

design it. Overall the workload was split as evenly as possible with both of us doing our best

work.

Appendix A

Java Simulation Program

/* Brendon Lay and Alex Guzak

3/18/18

*/

import TerminalIO.KeyboardReader;

import java.text.DecimalFormat;

class carnival {

public static void main(String args[]){


Guzak - Lay 13

KeyboardReader reader = new KeyboardReader();

DecimalFormat threeDecimal = new DecimalFormat("0.000");

int i = 0,j = 0, k = 0, x =1, a, b, c, w = 0, w2 = 0, w3 = 0;

do{

a = (int)(3*Math.random() + 1);

System.out.print(a);

i = i+1;

if(a == 1) w = w+1;

}while (i != 5000);

System.out.print("\n");

System.out.print("\n");

System.out.print("The number of won games is " + w);

System.out.print("\n");

do{

b = (int)(6*Math.random() + 1);

System.out.print(b);

j = j+1;

if(b == 1) w2 = w2+1;

}while (j != w);
Guzak - Lay 14

System.out.print("\n");

System.out.print("\n");

System.out.print("The number of won games is " + w2);

System.out.print("\n");

do{

c = (int)(10*Math.random() + 1);

System.out.print(c);

k = k+1;

if(c == 1) w3 = w3+1;

}while (k != w2);

System.out.print("\n");

System.out.print("The number of won games is " + w3);

System.out.print("\n");

You might also like