random() < 0.5 ? "heads" : "tails" randFromArray([ ["a 1", [1]], ["a 2", [2]], ["a 3", [3]], ["a 4", [4]], ["a 5", [5]], ["a 6", [6]], ["at least a 2", [2, 3, 4, 5, 6]], ["at least a 3", [3, 4, 5, 6]], ["at least a 4", [4, 5, 6]], ["more than a 2", [3, 4, 5, 6]], ["more than a 3", [4, 5, 6]], ["more than a 4", [5, 6]], ["less than a 4", [1, 2, 3]], ["less than a 5", [1, 2, 3, 4]], ["less than a 6", [1, 2, 3, 4, 5]], ["an even number", [2, 4, 6]], ["an even number", [2, 4, 6]], ["an odd number", [1, 3, 5]], ["an odd number", [1, 3, 5]], ["a prime number", [2, 3, 5]] ]) RESULT_POSSIBLE.length / getGCD(RESULT_POSSIBLE.length,12) 12 / getGCD(RESULT_POSSIBLE.length,12)

If you flip a coin and roll a 6-sided die, what is the probability that you will flip a HT and roll RESULT_DESC?

0.5 * RESULT_POSSIBLE.length / 6

Flipping a HT and rolling RESULT_DESC are independent events: they don't affect each other. So, to get the probability of both happening, we just need to multiply the probability of one by the probability of the other.

The probability of flipping a HT is \dfrac{1}{2}.

The probability of rolling RESULT_DESC is \dfrac{RESULT_POSSIBLE.length}{6}, since there plural("is",RESULT_POSSIBLE.length) RESULT_POSSIBLE.length plural("outcome",RESULT_POSSIBLE.length) which RESULT_POSSIBLE.length > 1 ? "satisfy" : "satisfies" our condition (namely, toSentence(RESULT_POSSIBLE)), and 6 total possible outcomes.

So, the probability of both these events happening is \dfrac{1}{2} \cdot \dfrac{RESULT_POSSIBLE.length}{6} = \dfrac{PRETTY_N}{PRETTY_D}

[["Carmelo Anthony", .84], ["Trevor Ariza", .70], ["Michael Beasley", .75], ["Carlos Boozer", .70], ["Elton Brand", .78], ["Kobe Bryant", .83], ["DeMarcus Cousins", .69], ["Glen Davis", .74], ["Luol Deng", .75], ["Tim Duncan", .72], ["Kevin Durant", .88], ["Raymond Felton", .81], ["Kevin Garnett", .86], ["Pau Gasol", .82], ["Manu Ginobili", .87], ["Grant Hill", .83], ["LeBron James", .76], ["Antawn Jamison", .73], ["Shawn Marion", .77], ["Joakim Noah", .74], ["Chris Paul", .88], ["Paul Pierce", .86], ["Derrick Rose", .86], ["Amar'e Stoudemire", .79], ["John Wall", .77]] random() < 0.5 randFromArray(FREE_THROWS) ALL ? PR : (1-PR).toFixed(2) randRange(4,9) (PROB * 100).toFixed(0) (pow(PROB,2) * 100).toFixed(0) (pow(PROB,3) * 100) < 0.5 ? (pow(PROB,3) * 100).toFixed(1) : (pow(PROB,3) * 100).toFixed(0) shuffle( [PR + "^" + STREAK, STREAK + " \\cdot" + PR, STREAK + " \\cdot" + "(1 - " + PR + ")", "(1 - " + PR + ")^" + STREAK]) ALL ? PR + "^" + STREAK : "(1 - " + PR + ")^" + STREAK

PLAYER is shooting free throws. Making or missing free throws doesn't change the probability that he will make his next one, and he makes his free throws (PR*100).toFixed(0)\% of the time.

What is the probability of PLAYER making ALL ? "ALL" : "NONE" of his next STREAK free throw attempts?

ANS
  • OPTIONS[0]
  • OPTIONS[1]
  • OPTIONS[2]
  • OPTIONS[3]
We know that \blue{SINGLE_PCT \%} of the time, he'll make his first shot.
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10,-0.53], SINGLE_PCT + "\\%", "center"); style({ stroke: "BLUE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*10,0]); line([PROB*10,-0.2], [PROB*10,0.2]);

Then SINGLE_PCT \% of the time he makes his first shot, he will also make his second shot, and ((1-PROB)*100).toFixed(0) \% of the time he makes his first shot, he will miss his second shot.
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); style({ stroke: "ORANGE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]); style({ stroke: "PINK", strokeWidth: 3 }); line([PROB*PROB*10,0], [PROB*10,0]); line([PROB*10,-0.2], [PROB*10,0.2]);

Notice how we can completely ignore the rightmost section of the line now, because those were the times that he missed the first free throw, and we only care about if he makes the first and the second. So the chance of making two free throws in a row is SINGLE_PCT\% of the times that he made the first shot, which happens SINGLE_PCT\% of the time in general.

This is SINGLE_PCT\% \cdot SINGLE_PCT\%, or PROB \cdot PROB = (PROB*PROB).toFixed(3).

We can repeat this process again to get the probability of making three free throws in a row. We simply take SINGLE_PCT\% of probability that he makes two in a row, which we know from the previous step is (PROB*PROB).toFixed(3) \approx \orange{TWO_PCT\%}.
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); line([PROB*10,-0.2], [PROB*10,0.2]); label([PROB*PROB*10, -0.53], TWO_PCT + "\\%", "center"); style({ stroke: "ORANGE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]);

SINGLE_PCT\% of \orange{TWO_PCT\%} is PROB \cdot (PROB*PROB).toFixed(3) = Math.pow(PROB,3).toFixed(3), or about \green{THREE_PCT\%}:
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); line([PROB*10,-0.2], [PROB*10,0.2]); label([PROB*PROB*10, -0.53], TWO_PCT + "\\%", "center"); label([Math.pow(PROB,3)*10, -0.53], THREE_PCT + "\\%", "center"); style({ stroke: "GREEN", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [Math.pow(PROB,3)*10,0]); line([Math.pow(PROB,3)*10,-0.2], [Math.pow(PROB,3)*10,0.2]); style({ stroke: "PINK", strokeWidth: 3 }); line([Math.pow(PROB,3)*10,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]);

There is a pattern here: the chance of making two free throws in a row was PROB \cdot PROB, and the probability of making three in a row was PROB \cdot (PROB*PROB).toFixed(3) = PROB \cdot (PROB \cdot PROB) = PROB^3.

In general, you can continue in this way to find the probability of making any number of shots.

The probability of making STREAK free throws in a row is PROB ^ STREAK.

We know that \blue{SINGLE_PCT \%} of the time, he'll miss his first shot (100 \% - (PR*100).toFixed(0) \% = SINGLE_PCT \%).
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10,-0.53], SINGLE_PCT + "\\%", "center"); style({ stroke: "BLUE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*10,0]); line([PROB*10,-0.2], [PROB*10,0.2]);

Then SINGLE_PCT \% of the time he misses his first shot, he will also miss his second shot, and ((1-PROB)*100).toFixed(0) \% of the time he misses his first shot, he will make his second shot.
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); style({ stroke: "ORANGE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]); style({ stroke: "PINK", strokeWidth: 3 }); line([PROB*PROB*10,0], [PROB*10,0]); line([PROB*10,-0.2], [PROB*10,0.2]);

Notice how we can completely ignore the rightmost section of the line now, because those were the times that he made the first free throw, and we only care about if he misses the first and the second. So the chance of missing two free throws in a row is SINGLE_PCT\% of the times that he missed the first shot, which happens SINGLE_PCT\% of the time in general.

This is SINGLE_PCT\% \cdot SINGLE_PCT\%, or PROB \cdot PROB = (PROB*PROB).toFixed(3).

We can repeat this process again to get the probability of missing three free throws in a row. We simply take SINGLE_PCT\% of probability that he misses two in a row, which we know from the previous step is (PROB*PROB).toFixed(3) \approx \orange{TWO_PCT\%}.
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); line([PROB*10,-0.2], [PROB*10,0.2]); label([PROB*PROB*10, -0.53], TWO_PCT + "\\%", "center"); style({ stroke: "ORANGE", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]);

SINGLE_PCT\% of \orange{TWO_PCT\%} is PROB \cdot (PROB*PROB).toFixed(3) = Math.pow(PROB,3).toFixed(3), or about \green{THREE_PCT\%}:
init({ range: [[-1, 11], [-1, 1]] }); line([0, 0], [10, 0]); line([10,-0.2], [10,0.2]); label([PROB*10, -0.53], SINGLE_PCT + "\\%", "center"); line([PROB*10,-0.2], [PROB*10,0.2]); label([PROB*PROB*10, -0.53], TWO_PCT + "\\%", "center"); style({ stroke: "GREEN", strokeWidth: 3 }); line([0,-0.2], [0,0.2]); line([0,0], [Math.pow(PROB,3)*10,0]); line([Math.pow(PROB,3)*10,-0.2], [Math.pow(PROB,3)*10,0.2]); style({ stroke: "PINK", strokeWidth: 3 }); line([Math.pow(PROB,3)*10,0], [PROB*PROB*10,0]); line([PROB*PROB*10,-0.2], [PROB*PROB*10,0.2]);

There is a pattern here: the chance of missing two free throws in a row was PROB \cdot PROB, and the probability of missing three in a row was PROB \cdot (PROB*PROB).toFixed(3) = PROB \cdot (PROB \cdot PROB) = PROB^3.

In general, you can continue in this way to find the probability of missing any number of shots.

The probability of missing STREAK free throws in a row is PROB ^ STREAK = ANS.

randRange(1,4) CAPTAIN_NUM + randRange(1,6) CAPTAIN_NUM/CAPTAIN_DEM randRange(1,4) PIRATE_NUM + randRange(4,6) PIRATE_NUM/PIRATE_DEM [getGCD(CAPTAIN_NUM,CAPTAIN_DEM), getGCD(PIRATE_NUM,PIRATE_DEM)] "\\dfrac{" + CAPTAIN_NUM/CGCD + "}{" + CAPTAIN_DEM/CGCD + "}" "\\dfrac{" + (CAPTAIN_DEM/CGCD - CAPTAIN_NUM/CGCD) + "}{" + CAPTAIN_DEM/CGCD + "}" "\\dfrac{" + PIRATE_NUM/PGCD + "}{" + PIRATE_DEM/PGCD + "}" "\\dfrac{" + (PIRATE_DEM/PGCD - PIRATE_NUM/PGCD) + "}{" + PIRATE_DEM/PGCD + "}" randRange(0,3) ["the Captain hits the pirate ship, but the pirate misses", "the pirate hits the Captain's ship, but the Captain misses", "both the pirate and the Captain hit each other's ships", "both the Captain and the pirate miss"][INDEX] [[CAPTAIN_NUM * (PIRATE_DEM-PIRATE_NUM), CAPTAIN_DEM*PIRATE_DEM, CAPTAIN_PROB*(1-PIRATE_PROB)], [(CAPTAIN_DEM-CAPTAIN_NUM) * PIRATE_NUM, CAPTAIN_DEM*PIRATE_DEM, (1-CAPTAIN_PROB)*PIRATE_PROB], [CAPTAIN_NUM * PIRATE_NUM, CAPTAIN_DEM*PIRATE_DEM, CAPTAIN_PROB*PIRATE_PROB], [(CAPTAIN_DEM-CAPTAIN_NUM) * (PIRATE_DEM-PIRATE_NUM), CAPTAIN_DEM*PIRATE_DEM, (1-CAPTAIN_PROB)*(1-PIRATE_PROB)]][INDEX] INDEX === 0 || INDEX === 2 INDEX === 1 || INDEX === 2

Captain person(1) and his(1) ship, the H.M.S. Khan, are two furlongs from the dread pirate person(2) and his(2) merciless band of scallawags.

The Captain has probability C_HIT_PRETTY of hitting the pirate ship. The pirate only has one good eye, so he(2) hits the Captain's ship with probability P_HIT_PRETTY.

If both fire their cannons at the same time, what is the probability that QUESTION?

ANSWER

If the Captain hits the pirate ship, it won't affect whether he(1)'s also hit by the pirate's cannons (and vice-versa), because they both fired at the same time. So, these events are independent.

Since they are independent, in order to get the probability that QUESTION, we just need to multiply together the probability that C ? "the captain hits" : "the captain misses" and the probability that P ? "the pirate hits" : "the pirate misses".

The probability that the Captain hits is C_HIT_PRETTY.

The probability that the Captian misses is 1 - (the probability the Captain hits), which is 1 - C_HIT_PRETTY = C_MISS_PRETTY.

The probability that the pirate hits is P_HIT_PRETTY.

The probability that the pirate misses is 1 - (the probability the pirate hits), which is 1 - P_HIT_PRETTY = P_MISS_PRETTY.

So, the probability that QUESTION is C ? C_HIT_PRETTY : C_MISS_PRETTY \cdot P ? P_HIT_PRETTY : P_MISS_PRETTY = \dfrac{ANS_N/getGCD(ANS_N,ANS_D)}{ANS_D/getGCD(ANS_N,ANS_D)}.