# Number of Unique Permutations of 3 digits (-1,0,1) given a length that match a sum

Say you have a vertical game board of n length (length being number of spaces). And you have a three sided die that has the options: go forward one, go back one, and stay. If you go below or above the number of board game spaces it is an invalid game, and the only valid move once you reach the end of the board is "stay". Given an exact number of die rolls t, is it possible to mathematically work out the number of unique dice rolls that result in a winning game?

• Welcome to Mathematics Stack Exchange! I would suggest you to explain a little bit how you tried to solve it, your thoughts about the solution, etc. so other people could help you better. Good luck! – iadvd Apr 23 '15 at 2:45
• What are the winning conditions? Reach the end first? Assuming that's the case and that there are are three or more spaces on the board, couldn't the game go on forever if the rolls alternate between -1 and 1? – Todd Wilcox Apr 23 '15 at 2:55
• Thanks for the welcoming! So far I've figured out that it n=3 then you can solve the question with the equation: 1/2(-2+2^n). But if n=4 or anything higher then I have no clue. Also I mistyped and meant to say "an exact number of dice rolls". So if you have t=1 & n=2 then you should get 1 unique winning dice roll. If you have t=3 and n=2 then you should get 3 unique dice rolls. I really appreciate any input, and please let me know if I need to change anything to help clarify. – Andrew Apr 23 '15 at 3:03
• If the spaces are numbered $1$ to $n$ where do you start? When you say the only valid move once you reach the end of the board is stay, do you mean that go forward is invalid if you are on space 1-that once you hit the end of the board you have to keep throwing $0$ until the end? – Ross Millikan Apr 23 '15 at 3:20
• You start at space 1 and you end at space n. If you go one beyond the end of the board in either direction then it's an invalid game – Andrew Apr 23 '15 at 3:53