full transcript
From the Ted Talk by Alex Rosenthal: The Chasm | Think Like A Coder, Ep 6
Unscramble the Blue Letters
In this case, a nïvae solution is to approach a pile of blocks, try all the arrangements, and see if one is a palindrome by reading it forward and then backwards.
The problem with this approach is that it would take a tremendous auonmt of time. If hdgee tried one combination every second, a stack of just 10 different blocks would take him 42 days to exhaust. That’s because the toatl time is a function of the factorial of the number of blocks there are. 10 blocks have over 3 million combinations.
What this naïve slootiun shows is that we need a much faster way to tell whether a pile of bolkcs can form a palindrome. To start, it may be intuitively clear that a pile of all different blocks will never form one. Why? The first and last blocks can’t be the same if there are no repeats. So when can a given sequence become a palindrome?
Open Cloze
In this case, a _____ solution is to approach a pile of blocks, try all the arrangements, and see if one is a palindrome by reading it forward and then backwards.
The problem with this approach is that it would take a tremendous ______ of time. If _____ tried one combination every second, a stack of just 10 different blocks would take him 42 days to exhaust. That’s because the _____ time is a function of the factorial of the number of blocks there are. 10 blocks have over 3 million combinations.
What this naïve ________ shows is that we need a much faster way to tell whether a pile of ______ can form a palindrome. To start, it may be intuitively clear that a pile of all different blocks will never form one. Why? The first and last blocks can’t be the same if there are no repeats. So when can a given sequence become a palindrome?
Solution
- naïve
- blocks
- hedge
- total
- amount
- solution
Original Text
In this case, a naïve solution is to approach a pile of blocks, try all the arrangements, and see if one is a palindrome by reading it forward and then backwards.
The problem with this approach is that it would take a tremendous amount of time. If Hedge tried one combination every second, a stack of just 10 different blocks would take him 42 days to exhaust. That’s because the total time is a function of the factorial of the number of blocks there are. 10 blocks have over 3 million combinations.
What this naïve solution shows is that we need a much faster way to tell whether a pile of blocks can form a palindrome. To start, it may be intuitively clear that a pile of all different blocks will never form one. Why? The first and last blocks can’t be the same if there are no repeats. So when can a given sequence become a palindrome?
Frequently Occurring Word Combinations
ngrams of length 2
collocation |
frequency |
naïve solution |
5 |
madam im |
2 |
im adam |
2 |
ngrams of length 3
collocation |
frequency |
madam im adam |
2 |
Important Words
- amount
- approach
- arrangements
- blocks
- case
- clear
- combination
- combinations
- days
- exhaust
- factorial
- faster
- form
- function
- hedge
- intuitively
- million
- naïve
- number
- palindrome
- pile
- problem
- reading
- repeats
- sequence
- shows
- solution
- stack
- start
- time
- total
- tremendous