Skip to main content
added 277 characters in body
Source Link
f''
  • 33.8k
  • 4
  • 121
  • 165

It is:

possible!

because:

Let $M\ge5$ be some multiple of $N$ such that $M-1$ is prime. (This is possible by Dirichlet's theorem.)

Consider the polynomial $x^{M-1}+(1-x)^{M-1}-\frac{1}{M}$. The value of this polynomial is positive for $x=0$ and negative for $x=\frac{1}{2}$, so it must have a real root in the interval $(0,\frac{1}{2})$. Choose $p$ as such a root.

Now flip the coin $M-1$ times. The probability that it comes up all heads or all tails is $p^{M-1}+(1-p)^{M-1}=\frac{1}{M}$.
Otherwise, there are $j$ heads for some $0<j<M-1$. For every $j$, there are $M-1\choose j$ equally likely ways to get $j$ heads. Because $M-1$ is prime, it divides $M-1\choose j$ for all $0<j<M-1$, so the remainingthese cases can be divided into $M-1$ equivalentequal groups (one way to do this is to sum the indices of the flips that came up heads and reducing mod $M-1$). By putting together one group from each $j$, we can make $M-1$ equal sets of results, which must alsoeach have a probability of $\frac{1}{M}$ each.

We have now chosen equally from $M$ items. Because $M$ is a multiple of $N$, we can combine probabilities if necessary to choose equally from $N$ items.

It is:

possible!

because:

Let $M\ge5$ be some multiple of $N$ such that $M-1$ is prime. (This is possible by Dirichlet's theorem.)

Consider the polynomial $x^{M-1}+(1-x)^{M-1}-\frac{1}{M}$. The value of this polynomial is positive for $x=0$ and negative for $x=\frac{1}{2}$, so it must have a real root in the interval $(0,\frac{1}{2})$. Choose $p$ as such a root.

Now flip the coin $M-1$ times. The probability that it comes up all heads or all tails is $p^{M-1}+(1-p)^{M-1}=\frac{1}{M}$. Because $M-1$ is prime, it divides $M-1\choose j$ for all $0<j<M-1$, so the remaining cases can be divided into $M-1$ equivalent groups, which must also have a probability of $\frac{1}{M}$ each.

We have now chosen equally from $M$ items. Because $M$ is a multiple of $N$, we can combine probabilities if necessary to choose equally from $N$ items.

It is:

possible!

because:

Let $M\ge5$ be some multiple of $N$ such that $M-1$ is prime. (This is possible by Dirichlet's theorem.)

Consider the polynomial $x^{M-1}+(1-x)^{M-1}-\frac{1}{M}$. The value of this polynomial is positive for $x=0$ and negative for $x=\frac{1}{2}$, so it must have a real root in the interval $(0,\frac{1}{2})$. Choose $p$ as such a root.

Now flip the coin $M-1$ times. The probability that it comes up all heads or all tails is $p^{M-1}+(1-p)^{M-1}=\frac{1}{M}$.
Otherwise, there are $j$ heads for some $0<j<M-1$. For every $j$, there are $M-1\choose j$ equally likely ways to get $j$ heads. Because $M-1$ is prime, it divides $M-1\choose j$, so these cases can be divided into $M-1$ equal groups (one way to do this is to sum the indices of the flips that came up heads and reducing mod $M-1$). By putting together one group from each $j$, we can make $M-1$ equal sets of results, which must each have probability $\frac{1}{M}$.

We have now chosen equally from $M$ items. Because $M$ is a multiple of $N$, we can combine probabilities if necessary to choose equally from $N$ items.

Source Link
f''
  • 33.8k
  • 4
  • 121
  • 165

It is:

possible!

because:

Let $M\ge5$ be some multiple of $N$ such that $M-1$ is prime. (This is possible by Dirichlet's theorem.)

Consider the polynomial $x^{M-1}+(1-x)^{M-1}-\frac{1}{M}$. The value of this polynomial is positive for $x=0$ and negative for $x=\frac{1}{2}$, so it must have a real root in the interval $(0,\frac{1}{2})$. Choose $p$ as such a root.

Now flip the coin $M-1$ times. The probability that it comes up all heads or all tails is $p^{M-1}+(1-p)^{M-1}=\frac{1}{M}$. Because $M-1$ is prime, it divides $M-1\choose j$ for all $0<j<M-1$, so the remaining cases can be divided into $M-1$ equivalent groups, which must also have a probability of $\frac{1}{M}$ each.

We have now chosen equally from $M$ items. Because $M$ is a multiple of $N$, we can combine probabilities if necessary to choose equally from $N$ items.