Miss Demeanor decides to climb up a flight of 100 stairs. She starts from the floor, and can go up either one or two steps at a time. (She flips a fair coin each time to decide which one). What is the probability that at some point she will land on the 20th step?
Image credit : https://img.freepik.com
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
... with a general solution for landing on the n th step of P n = 3 2 + 3 1 × ( − 2 1 ) n .
Surprised how quickly it goes to 2 / 3 . Things would get really interesting if Miss Demeanor could also have the option (misfortune?) of taking one step down as well, say a 1 / 2 chance of taking one step up, a 1 / 4 chance of taking one step down (unless already on the floor), and a 1 / 4 chance of taking two steps up.
P.S.. Glad to see you're still up for posting problems. :)
Log in to reply
Yes Sir.....Even I found out the general sequence and was amazed!! And also, if you convert P n into a single fraction, the numerators, interestingly follow the Jacobsthal Sequence !!!
Hahaha... Thanks! Still holding out hope that Brilliant will return to a community focused model! :)
Log in to reply
I'm hoping that happens too, but I'm not holding my breath. :/
I guess when she can go up and down the problem becomes a bit more complex... I was also considering a "tetranacci like" problem where she flips a four sided die and has equal probability of going up 1-4 steps at a time... Whats P n ?
Great job, was really frustrated I couldn't find out how to get a formula without having to rely on previous terms. This was really fun to try.
You haven't really justified your recurrence relationship. If she lands on the nth step, the probability of landing on step (n+2)
immediately
is (1/2). But that's not the probability of landing on the (n+2)th step
ever
. This analysis skips over the multiple paths from n to n+2, and also treats the events "lands on nth step" and "lands on (n+1)st step" as disjoint, but they really aren't.
Somehow you've ended up with a recurrence relationship that is algebraically correct, but you haven't give us a justification as to
why
that's the case.
Here are the details for obtaining the closed form for P n given by @Brian Charlesworth.
We learn from @Geoff Pilling's solution that
P 1 = 2 1
P 2 = 4 3
P n + 2 = P n + 1 × 2 1 + P n × 2 1 for n ≥ 2 or 2 P n + 2 − P n + 1 − P n = 0
For this linear recurrence formula, let's suppose there is a solution for P n of the form x n . We would then have
2 x n + 2 − x n + 1 − x n = 0 , which simplifies to 2 x 2 − x − 1 = 0 , with solutions x 1 = 1 and x 2 = − 2 1
Being the recurrence linear, the general solution takes the form P n = a ⋅ 1 n + b ⋅ ( − 2 1 ) n .
Knowing that P 1 = 2 1 and P 2 = 4 3 , the values for the coefficients are a = 3 2 and b = 3 1 .
The closed form for the probability of landing at the n th step is therefore P n = 3 2 + 3 1 ⋅ ( − 2 1 ) n , which rapidly converges to a value of 3 2 .
The Jacobsthal Sequence mentioned by @Aaghaz Mahajan arises when we approach the solution through combinatorics. Let's consider all the different ways of landing on the n th step by going up one or two steps at a time:
n "one's": only one way of doing this with a probability of p 0 = 2 n 1
one "two" and n − 2 "ones": ( 1 n − 1 ) ways, p 1 = 2 n − 1 1 each.
two "two's"and and n − 4 "ones": ( 2 n − 2 ) ways, p 2 = 2 n − 2 1 each.
⋮
⋮
There are two possible ways this sequence ends:
2 n − 1 "two's" and one "one" ( n odd): ( 1 2 n − 1 ) ways, p 2 n − 1 = 2 2 n − 1 1 each.
2 n "two's" and zero "ones" ( n even): ( 0 2 n ) ways, p 2 n = 2 2 n 1 each.
P n is the sum of all these possible cases and it can be expressed as:
P n = 2 n 1 k = 0 ∑ ⌊ 2 n ⌋ 2 k ( k n − k )
The Jacobsthal numbers are the result of the summation for the different values of n :
J n = k = 0 ∑ ⌊ 2 n ⌋ 2 k ( k n − k ) = 3 1 ( 2 n + 1 − ( − 1 ) n + 1 ) ( 1 , 3 , 5 , 1 1 , 2 1 , 4 3 , 8 5 , 1 7 1 , 3 4 1 , 6 8 7 , … )
While the other solutions are more elegant, this can also be done with "brute force". One way to get to the twentieth step is to take zero "two steps" and 20 "one steps". The probability of this is (20 choose 0) (.5^20). You can also take one "two step", with 19 "one steps" (with probability (19 choose 1) (.5^19)). All combinations have probability of the form (20 - k choose k)*(.5^(20-k)). You can use Excel to sum all 11 terms to get the required result.
Let
p
n
be the probability of
not
stepping on the
n
th step. Observe that, to skip the
n
th step, Miss Demeanor
must
step on the
(
n
−
1
)
st step, and if she does that, there is a 50-50 chance of skipping the
n
th step.
Thus, the recurrence relationship is
p
n
=
(
1
−
p
n
−
1
)
∗
(
1
/
2
)
=
2
1
−
p
n
−
1
.
p
n
converges to
3
1
, and it's easy to see via direct calculation that, rounded to three digits,
p
n
=
0
.
3
3
3
for
n
≥
1
0
.
Of course the question asks for the probability of not skipping step 20, and that would be
1
−
p
2
0
, i.e.
0
.
6
6
7
.
Problem Loading...
Note Loading...
Set Loading...
Clearly there is a 2 1 probability that she will land on step 1.
And there is a 4 3 probability that she will land on step 2, since 3 of the 4 possibilities for the first 2 coin flips {11, 21, and 22} result in her landing on the second step.
After that, for each step, n + 2 , she can get there two ways, from step n or from step n + 1 , each with the same probability.
Therefore, if P n = the probability that at some point she will land on the n th step, then:
So,
P 2 0 = 0 . 6 7