0
$\begingroup$

Suppose we have an $n$ x $m$ grid, and an object situated in that grid at position $(x,y)$ of size $1$ x $1$ with an initial vector (direction) $v$.

Would this object necessarily repeat its motion or stated another way does it have always have to have a period?

We can assume when the object hits an edge it is reflected.

EDIT: I have perhaps emphasized the real world aspect of this question too much. Let me make this clearer

  • We should not concern ourselves with the computer internals (memory, how the $n$ x $m$ grid is displayed)

  • The intial $(x,y)$ position does not need to be composed of integers (or indeed rationals)

  • The direction must be rectilinear

$\endgroup$
8
  • 2
    $\begingroup$ The old-school term for this is kind of thing is a "billiards [table] problem". See, for instance, "The simplest billiards problem". A site search for "billiards" gives over 100 results, many regarding non-rectangular tables, but you might be able to find some relevant posts. (Note: Typically, the billiard ball is assumed to be a point. The fact that your bouncing object has a specific, non-zero size changes things slightly.) $\endgroup$
    – Blue
    May 30, 2019 at 10:28
  • 1
    $\begingroup$ @Blue Thanks! From perusing the questions I'm surprised by how deep this field is. $\endgroup$
    – Abe
    May 30, 2019 at 10:42
  • $\begingroup$ Conjecture. If the angle of vector is a rational factor of $\pi,$ then it would repeat. $\endgroup$ May 30, 2019 at 10:48
  • 1
    $\begingroup$ Just think: there’s only a finite amount of memory on any computer, so however the screensaver has been implemented, it can only take on finitely many states (even if they appear at first to be continuous, they are bot). It has to exhaust them eventually, at which point it will have memory identical to an earlier point in its operation and hence will deterministically repeat all of its action within period. (Unless there is hardware failure or an external force changes things, or perhaps if the computer operates probabilistically with quantum weirdness.) $\endgroup$ May 30, 2019 at 11:33
  • $\begingroup$ @JackCrawford. Every time somebody comes within Wi-Fi range the ball is given a new location and direction. $\endgroup$ May 30, 2019 at 12:33

1 Answer 1

1
$\begingroup$

As you store the state of your screensaver digitally with bits and bytes, it can only have $2^n$ possible states, where $n$ is the number of bits needed to represent its state. Thus after $2^n$ steps (or earlier), it must to repeat. Of course, if its state is sufficiently complex, this will take a long time.

However, if I understand your scenario correctly, it will repeat much earlier:

  • As your object is reflected perfectly by perpendicular walls, it can only have four possible directions (whatever you can obtain by mirroring the direction vector on the coordinate axes).
  • Also, your object can only have as many possible locations as there are pixels on your screen.

For example, on a 1024×768 screen, the motion has to repeat every $4·1024·768 = 3145728$ steps. If you have 10 steps per second, this would be every 87 hours.

$\endgroup$
2
  • $\begingroup$ What happens if it hits a corner? $\endgroup$ May 30, 2019 at 22:49
  • $\begingroup$ @WilliamElliot: That’s a question you have to ask the OP. $\endgroup$
    – Wrzlprmft
    May 31, 2019 at 5:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .