Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

One - dimensional solitaire is played on an infinite strip of 'holes' in which there are initially some pegs. A move is a hop of

One-dimensional solitaire is played on an infinite strip of 'holes' in which there are
initially some pegs. A move is a hop of one peg over another (adjacent) peg into a hole; the peg that has been hopped over is removed. You win the game if you can remove all pegs but one. Some games are winnable and some are not.
For instance, with 7 pegs (pegs denoted by *, and holes denoted by )
000***0****000 can be won but 000***000****000 cannot.
Task:
By hand work out the number of distinct winnable starting positions with 7 pegs. By
'distinct' we mean that we regard a position and its mirror image as being the same,
e.g.**** is the same as ****.
Then:
Write a program to find the number of distinct winnable starting positions with
20 pegs.
Print out the winnable starting positions in an easily understandable way.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions