how to change all counting numbers when people stand a circle and the starting position change

20 Views Asked by At

if there are $n$ people standing a circle. everyone's number is from 1 to $n$ clockwisely. if we change the initial No.$1$ position to the $k$ th(that means change the initial $k$ th position to $1$st, then count the circle in clockwise order). here is my question:

what the relation between initial number(denote $i$) and changed number(denote $j$) if $k\le n$?

what the relation between initial number(denote $i$) and changed number(denote $j$) if $k\gt n$?

i inducted to the equation when $k\le n$ $$ j= \begin{cases} n-k+1+i, & \text{$i\le k$} \\ -k+1+i, & \text{$i\gt k$} \end{cases} $$

i inducted to the equation when $k\gt n$

$$ j=n-k\pmod n+1+i $$

can i combine these two condition $k\gt n$ and $i\gt k$ into one equation? can i just use one formula to express their ralation?

2

There are 2 best solutions below

0
On

You can write the new position of the $i$th person as the unique number which equals $i-k+1\pmod{n}$ and lies in the interval $[1,n]$. This is probably the cleanest way to write it.

0
On

Your equations are all equivalent to $$j \equiv i+1-k \pmod n$$. The $\bmod n$ means adding or subtracting $n$ doesn't matter, and if you erase the $n$ from the right side they are all the same. The only hiccup is that people often consider this to count from $0$ to $n-1$ while you want $1$ to $n$