All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Jump around (Posted on 2005-07-09) Difficulty: 3 of 5
On a giant tape measure sits an N-frog: that is, a frog with a special preference for the number N. The frog's location at the beginning of each of its jumps is called M. The frog moves on the tape measure according to the following rules:

  • Whenever M>N, then the N-frog makes an N-jump to the left and lands on the number M-N.

  • Whenever M<N, then the N-frog makes an N-jump to the right and lands on number M+N; during landing it also changes its preference and becomes an M-frog.

  • Whenever M=N then the frog is happy and stays on that number.
  • Where will a 851-frog that sits on 1517 be happy?
    Where will an N-frog that sits on M be happy?

    See The Solution Submitted by Hugo    
    Rating: 3.5714 (7 votes)

    Comments: ( Back to comment list | You must be logged in to post comments.)
    Some Thoughts Aberrant Frogs, a.k.a. Flys in the Ointment | Comment 3 of 7 |
    a) Whole frogs that start at fractional locations become fractional.  A 1-frog that starts at 7/4 is happy as a 1/4 frog.

    b) Rational frogs that start at irrational locations turn irratational, hop forever, are never happy, and become closer and closer to 0-frogs.  Unless they can hop faster and faster (like in zeno's paradox) in which case after a finite amount of time and infinite number of jumps (and a lot of computing) they do become happy 0-frogs.  Both of these seem to me to defy nature.  I suspect that they die hopping, but near the end they look like they are already dead.

    c) And negative start points are a problem, so I hope your tape measure starts at zero.  If a positive frog starts on a negative location, he tends to become negative and hop off the positive end of the tape measure.  Unless your tape measure is very long, in which case he hops off to positive infinity.

      Posted by Steve Herman on 2005-07-09 11:48:41
    Please log in:
    Login:
    Password:
    Remember me:
    Sign up! | Forgot password


    Search:
    Search body:
    Forums (1)
    Newest Problems
    Random Problem
    FAQ | About This Site
    Site Statistics
    New Comments (6)
    Unsolved Problems
    Top Rated Problems
    This month's top
    Most Commented On

    Chatterbox:
    Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information