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`?

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{`

, since there
`RESULT_POSSIBLE.length`}{6}`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`}

`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

of the time.
`(PR*100).toFixed(0)`\%

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

Then

`\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

of the times
that he made the first shot, which happens `SINGLE_PCT`\%

of the time in general.
`SINGLE_PCT`\%

This is

, or
`SINGLE_PCT`\% \cdot `SINGLE_PCT`\%

.
`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

, and the probability of making
three in a row was `PROB` \cdot `PROB`

.
`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

Then

`\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

of the times
that he missed the first shot, which happens `SINGLE_PCT`\%

of the time in general.
`SINGLE_PCT`\%

This is

, or
`SINGLE_PCT`\% \cdot `SINGLE_PCT`\%

.
`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

, and the probability of missing
three in a row was `PROB` \cdot `PROB`

.
`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`

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

of hitting the pirate ship.
The pirate only has one good eye, so `C_HIT_PRETTY``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`?

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)`}