Skip to content

Instantly share code, notes, and snippets.

@ssirowy
Last active December 25, 2015 02:49
Show Gist options
  • Save ssirowy/6904953 to your computer and use it in GitHub Desktop.
Save ssirowy/6904953 to your computer and use it in GitHub Desktop.
Hump Day ROTW: 10/9/2013
You have to answer both to win today. Both parts are closely related, in fact starting B first may help
A) Think of binary numbers: sequences of 0's and 1's. How many n-digit binary numbers are
there that don't have two adjacent 1 bits? For example, for three-digit numbers,
five of the possible eight combinations meet the criteria:
000, 001, 010, 011, 100, 101, 110, 111.
What is the number for sequences of length 4, 5, 10, n?
B) Prove it with output from a little script/program you write in your favorite language
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment