A secret society uses a peculiar handshake code: each member wears 5 distinct rings (one per finger on their right hand), and during a handshake, they interlock some subset of their fingers with their partner. The code works as follows: a handshake is "valid" if and only if no two consecutive fingers are interlocked (e.g., interlocking thumb-index-middle is invalid, but interlocking thumb-middle-pinky is valid). How many distinct valid handshake patterns exist? (Note: interlocking no fingers at all counts as one valid pattern.)
Enter a whole number
Show solution
Let an be the number of valid patterns for n fingers. We need to find a5.
Consider the n-th finger (rightmost). Either:
1. It is **not interlocked**: Then the first n−1 fingers can form any valid pattern, giving an−1 ways.
2. It **is interlocked**: Then the (n−1)-th finger cannot be interlocked (no consecutive), so we have a valid pattern on the first n−2 fingers, giving an−2 ways.
This gives the recurrence: an=an−1+an−2
Base cases:
- a0=1 (empty pattern: no fingers interlocked)
- a1=2 (either interlock the single finger or don't)
Computing forward:
- a2=a1+a0=2+1=3
- a3=a2+a1=3+2=5
- a4=a3+a2=5+3=8
- a5=a4+a3=8+5=13
Alternatively, we can verify: these are Fibonacci numbers! Specifically, an=Fn+2 where Fk is the k-th Fibonacci number with F1=F2=1.
Therefore, there are **13** distinct valid handshake patterns.