2

So the problem is Suppose there are $2n$ people in a circle; the first $n$ are “good guys” and the last $n$ are “bad guys.” Show that there is always an integer $m$ (depending on $n$) such that, if we go around the circle executing every $m$th person, all the bad guys are first to go.

I can see its true by simply visualizing $n=8, k=2$ so that if prisoners were at positions $2,4,6,8$ then all the bad guys would be dead. But how can I generalize and make proof work for everything?

TShiong
  • 1,257
  • 4
    I think you mean Josephus' problem: http://en.wikipedia.org/wiki/Josephus_problem... Josephine's problem is actually something different: http://en.wikipedia.org/wiki/Induction_puzzles... Also, could you replace your example (bad guys at 2,4,6,8) with one where the "bad guys" are all at the end as you say at the beginning... If you are asking the question for when they are in arbitrary positions, this becomes a much more difficult problem, one which I am not sure is known to have a positive answer actually... – Theo Douvropoulos May 09 '15 at 15:40

2 Answers2

1

You are working on a particular variant of the Josephus Problem. Executing every $m^{\text{th}}$ person in a circle of $n$ defines the Josephus Permutation $$J_{n,m}=\begin{pmatrix} 1&2&3&\cdots &n\\ a_1&a_2&a_3&\cdots&a_n\end{pmatrix}$$ where $a_i$ is the $i^{\text{th}}$ person to be killed.

Now, there is a simple condition via the Chinese Remainder Theorem for an arbitrary permutation to be a Jospehus Permutation. Observe that a permutation $J_{n,m}$ can be completely described by an $n$-tuple of numbers ${\bf b}:=(b_1,b_2,\cdots,b_n)$ such that $b_i\leq n+1-i$ denotes the number of steps, clockwise, we have to make to kill $a_i$ after we just killed $a_{i-1}$. For instance $$J_{8,m}=\begin{pmatrix} 1&2&3&4&5&6&7&8\\ 4&1&6&2&5&7&3&8\end{pmatrix}\quad \text{ gives }\quad {\bf b}=(4,5,4,3,2,1,2,1)$$ since we need $4$ steps to the right to kill the $4^{\text{th}}$ person, then $5$ steps to the right (which completes the circle and starts back at the beginning) to kill the $1^{\text{st}}$, then only $4$ steps to kill the $6^{\text{th}}$ becuse we don't count the $4^{\text{th}}$ anymore, etc... Therefore, to be able to find a suitable $m$ that realizes this permutation as $J_{8,m}$, we need a solution of $$ \begin{alignat*}{1} m&=4\ \operatorname{mod}8\\ m&=5\ \operatorname{mod}7\\m&=4\ \operatorname{mod}6\\&\cdots \\m&=2\ \operatorname{mod}2\\ m&=1\ \operatorname{mod}1 \end{alignat*}$$

It is easy to check, using the Chinese Remainder Theorem, that such a solution does indeed exists. However, not all permutations are realized as Josephus Permutations:

Indeed, there can only be $\operatorname{lcm}(1,2,\cdots,n)$-many such systems that have a solution (and hence equally many Josephus Permutations) but the Prime Number Theorem implies that $$\operatorname{lcm}(1,2,\cdots,n)\sim e^{n(1+o(1))}$$ which by Stirling's formula grows much slower than $n!$ ...

Now, for your particular question, you only need a Josephus permutation $J_{2n,m}$ such that the first $n$ people to die are a rearrangement of the numbers $n+1,n+2,\cdots,2n$. We can be even more precise:


Proposition The Permutation $$\sigma=\begin{pmatrix} 1&2&3&\cdots &n-1&n\\ n&n-1&n-2&\cdots& 2&1 \end{pmatrix}$$ is a Josephus permutation.

Indeed, just notice that the corresponding ${\bf b}$ is just $(n,n-1,n-2,\cdots,2,1)$ and then, of course, the system $b_i=0\ \operatorname{mod}(n+1-i)$ always has a solution.


The problem becomes more interesting once one tries to study other aspects of the permutations $J_{n,m}$. Traditionally, people attempt to find algorithms (some times there exist formulas! ) that give the last (one or two) survivors, ie $J_{n,m}(n)$, etc.

For references, consult MathSciNet with the term "Josephus" or have a look at these particular papers:

  1. The feline Josephus Problem.
  2. An application of Fourier transforms on finite abelian groups to an enumeration arising from the Josephus problem.
  3. The Josephus problem: once more around.
  4. The Josephus problem.
  • Ah cool there is one for finite abelian groups. That's probably related to my answer. Although it seems to be paywalled and I'm a poor dude. – mathreadler May 09 '15 at 16:39
1

Are we allowed to start at any point in the circle? Anyway we can view it as using clock arithmetic or "modulus" or $\mathbb{Z}_{2n}$. Another approach is by matrix representation of groups. Then we can write the problem as $$ \left(P^l\sum_{k=1}^n P^{kt} \right)[1,0,\cdots,0]^T = v$$ where v is a binary vector being 1 in the bad guys positions and P being generator for the 1-step forward permutation matrix and $t,l$ some integers deciding where to start and how many steps for between each "shot".

mathreadler
  • 25,824
  • Not really, after each execution the size of the circle changes.., (from $2n$ to $2n-1$, etc..) so you cannot stay in the same modulus or vector space as in your answer – Theo Douvropoulos May 09 '15 at 16:43
  • Aaah, Ok. Yes of course you are right. Didn't think about that. Will update if I get to think of some way to fix that. – mathreadler May 09 '15 at 16:51