[ISSUE] Pick Stone

Source: Internet
Author: User

The source of their own github.io

http://awarrior.github.io/pick-stone/

Describe

The players would like to pick up some from one heap of stones. Assume the quantity of stones is in and these the men pick up some one by one. The winner is whom brings, the last one.

solution that the prior picker wins the game.

Rule
    1. No one can pick up all the stones once if he is the prior picker;

    2. The number of stones player can pick up must does exceed the double of previous one pick after the first pick.

Resolve

There exits one assumption:

    • If The quantity of stones is a Fibonacci number (in Fibonacci sequence), the first picker would lose this game.

Give a proof using mathematical induction:

Let F (i) denotes the number of stones, X is the number the first player picks up and Y is the number the second player Doe S.

    1. When i=2, it's easy-to-comprehend that assumption meets the 1st rules.

    2. Assume when I<=k, which assumption is true.

When I=k+1, F (k+1) =f (k) +f (k-1).

The terms f (k) and F (k-1) is Fibonacci numbers and both let the first picker lose.

It ' s obvious to see that the first picker would lose when x>f (k+1)/3. Then if X<=f (k+1)/3, we'll get X<f (k-1) <f (k). Because of this:

F (k-2) <f (k-1) = f (k-1) +f (k-2) <2*f (k-1) + f (k-1) +f (k) <3*f (k-1) + f (k+1)/3<f (k-1) <f (k)

If X<f (k-1) <f (k), Y can be F (k-1)-X and let the number of stones become a Fibonacci number F (k). This proves the first picker must lose again.

Above all, first Picker was loser when stones number is a Fibonacci number.

Let's explore another situation, that's stones quantity is isn't a Fibonacci number (like the issue condition:100).

Before we expand the discussion of this situation and let's see Zeckendorf representation.

    • Each positive integer could is denoted as the cumulation of several discontinuous Fibonacci numbers (in Fibonacci sequence ).

We can get that f (k) >2*f (k-2) because of F (k-1) +f (k-2) >2*f (k-2). This can is more general, the F (k) >2*f (k-i) with i>=2.

The first picker would win if he pick up the minimal Fibonacci number as a part of the stones number. After this, the second player would become the first picker of the second minimal Fibonacci number so that the first picker has a opportunity to become the Last-one picker and according to the previous prove.

This progress would be is more clear if we use the one number to explain. This is the answer of the issue.

Answer

According to Zeckendorf representation, + stones can be represented by 100=89+8+3.

Let X and Y are the number of stones the first and second player picks up in one round.

Here is one example:

Round 1:x=3, y=6; left=91;
Round 2:x=2,|y=4; left=85;
Round 3:x=4, y=8; left=73;
Round 4:x=13, y=26; left=34;
Round 5:x=34. (Win)

[ISSUE] Pick Stone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.