- 4 reserve slots which can hold one card, and
- 8 tableau slots which can hold a stack of cards.
How big a stack can you move, given some open reserve and tableau slots?
- If you have no open reserves, you can move a stack of size 1. (One card only.)
- If you have one open reserve, you can move a stack of 2. (Given a red 3 on a black 4: you can move the red 3 to the open reserve, then move the black 4 to its destination, then move the red 3 onto the black 4.)
- What if you have 2 open reserves? (A stack of 3 can be moved.)
- What if you have r open reserves? (A stack of r+1 can move.)
- What if you have 1 open tableau and 0 open reserves?
- What if you have t open tableaux and r open reserves?
- S(0,r) = r+1, and
- S(t,r) = 2S(t-1,r), for t>0.
Here's a solution to the recurrence for S:
- S(t,r) = 2t(r+1)
- g(x) = 0, if g(x)=0, and
- g(x) = 1, otherwise.
- f(x) = 0, if f(x)=1, and
- f(x) = 1, otherwise.