WOO logo

Fibonacci Sequence part 1

This week we begin a three-park series on the Fibonacci Sequence, which appears in both mathematics and nature all over the place. However, before we get to that, I present the usual weekly logic puzzle.

fibonacci-sequence
Image source: Wikipedia

Logic Puzzle

You are with a unicorn and Pegasus. The unicorn lies on Mondays, Tuesdays and Wednesday and otherwise tells the truth. Pegasus lies on Thursdays, Fridays and Saturday and otherwise tells the truth.

Not knowing what day it is, you hear the following statements.

Unicorn, "Yesterday was one of my lying days."

Pegasus, "Yesterday was one of my lying days too."

What day is it?

Fibonacci Sequence part 1

Let me start the discussion with a math problem.

If you flip a fair coin 20 times, what is the probability of never getting two heads in a row?

Flip 1 – There are two successful combinations and two total combinations for a probability of 2/2 = 100% we never see two heads in a row. In other words, it’s impossible to see two heads in one flip.

Flip 2 – There are three successful combinations (HT, TH, TT) and 22= 4 total combinations for a probability of ¾ = 75% we never see two heads in a row in two flips.

Flip 3 – There are five successful combinations (HTT, HTH, THT, TTH, TTT) and 23=8 total combinations for a probability of 5/8 = 62.5% we never see two heads in a row in three flips.

However, it is starting to get tedious counting successful combinations at this point. Let’s try to go at it another way. If flip 3 is tails, then all successful combinations through two flips will still be good. In other words, we can just add a tails to all the combinations for two flips: HTT, THT, TTT. If flip 3 is heads, then any combination after one flip will be good by adding a TH afterward: HTH, TTH. Thus, the total successful combinations is 3 if flip 3 is tails and 2 if it is heads for a total of 5.

Flip 4 –If the flip is tails, we can use all the combinations from flip 3, which were 5, and add a T to each one. If the flip is heads, we go back to flip two and add a TH to each one. The total combinationsis 5+3=8.

Are you seeing a pattern? The pattern that starts with two ones and each successive member is the sum of the two previous ones goes like this: 1,1,2,3,5,8,13,21,34, … and is known as the Fibonacci Sequence. That is exactly what we are doing here by going back one if the last flip was tails and two if it was heads.

The following table shows the number of successful combinations, total combinations, and probability of no two consecutive heads for 1 to 20 flips.The probability is the number of successful combinations divided by total combinations, which is 2^n, where n is the number of flips. The bottom row shows the probability of no two heads in a row is 17711/1048576 =~ 1.69%.

table

This shows just one practical use of the Fibonacci Sequence. Next week we will expand on this by looking at the ratio of two consecutive terms in the sequence.

table
Image source: How Stuff Works

Logic Puzzle Answer

Thursday

Logic Puzzle Solution

Let's look at the unicorn's statement first. It is consistent with the truthfulness of the unicorn only on Monday and Thursday.

Let's look at Pegasus' statement second. It is consistent with the truthfulness of the unicorn only on Thursday and Sunday.