30 70 5 randRange(5, 15) randRange(2, 4) (PERCENT_UNFAIR_HEADS_MAX - PERCENT_UNFAIR_HEADS_MIN) / PERCENT_UNFAIR_HEADS_INCR PERCENT_UNFAIR_HEADS_MIN + rand(NUM_INCR + 1) * PERCENT_UNFAIR_HEADS_INCR randRange(2, 4) "\\frac{" + NUM_UNFAIR_COINS + "}{" + NUM_COINS + "}" "\\frac{" + NUM_UNFAIR_COINS + "}{" + NUM_COINS + "}" "\\frac{" + (NUM_COINS-NUM_UNFAIR_COINS) + "}{" + NUM_COINS + "}" PERCENT_CHANCE_UNFAIR_HEADS / 100 (function() { var uhdf = DECIMAL_CHANCE_UNFAIR_HEADS.toString() for (var i = 0; i < NUM_FLIPS - 1; i++) { uhdf += " \\times " + DECIMAL_CHANCE_UNFAIR_HEADS; } return uhdf; })() (function() { var uhpf = PERCENT_CHANCE_UNFAIR_HEADS + "\\%"; for (var i = 0; i < NUM_FLIPS - 1; i++) { uhpf += " \\times " + PERCENT_CHANCE_UNFAIR_HEADS + "\\%"; } return uhpf; })() 0.5 (function() { var fhdf = DECIMAL_CHANCE_FAIR_HEADS.toString(); for (var i = 0; i < NUM_FLIPS - 1; i++) { fhdf += " \\times " + DECIMAL_CHANCE_FAIR_HEADS; } return fhdf; })() NUM_UNFAIR_COINS / NUM_COINS 1 - CHANCE_UNFAIR_PICKED round(10000 * (CHANCE_UNFAIR_PICKED * pow((PERCENT_CHANCE_UNFAIR_HEADS / 100), NUM_FLIPS) + CHANCE_FAIR_PICKED * pow(.5,NUM_FLIPS))) / 100

You have NUM_COINS coins in a bag. NUM_UNFAIR_COINS of them are unfair in that they have a PERCENT_CHANCE_UNFAIR_HEADS\% chance of coming up heads when flipped (the rest are fair coins). You randomly choose one coin from the bag and flip it NUM_FLIPS times.

What is the probability, written as a percentage, of getting NUM_FLIPS heads? Round your answer to the nearest hundredth of a percent.

ANSWER

You can only pick a fair coin or pick an unfair coin. There is no other outcome.

What chance do you have of picking an unfair coin? How about a fair coin?

An unfair coin occurs UNFAIR_COIN_FRACTION_STRING of the time.

A fair coin occurs the rest of the time, or FAIR_COIN_FRACTION_STRING of the time.

For that UNFAIR_COIN_FRACTION_STRING of the time that you pick an unfair coin, what is the chance of flipping NUM_FLIPS heads using that unfair coin?

The chance is UNFAIR_HEADS_PERCENT_FORMULA, or UNFAIR_HEADS_DECIMAL_FORMULA.

Now, then, your chance of both picking the unfair coin and also flipping NUM_FLIPS heads--the chance that both these events occur--is what?

It is UNFAIR_COIN_FRACTION_STRING \times UNFAIR_HEADS_DECIMAL_FORMULA.

Now, the other possibility, picking the fair coin and flipping NUM_FLIPS heads is what?

It is FAIR_COIN_FRACTION_STRING \times FAIR_HEADS_DECIMAL_FORMULA.

How do you combine these two mutually exclusive events to find the chance that either occurs?

Add them! So your answer is UNFAIR_COIN_FRACTION_STRING \times UNFAIR_HEADS_DECIMAL_FORMULA+ FAIR_COIN_FRACTION_STRING \times FAIR_HEADS_DECIMAL_FORMULA, or ANSWER\%.