2

I am told that a random variable can take a value of $+1$ or $-1$. I am given the total number of times the random variable is counted, $N$, and the sum of the random variables, $n$, and asked to find how many ways such an outcome is possible. So if $N=3$ and $n=1$ I can have $(1, 1, -1)$, $(1, -1, 1)$ or $(-1, 1, 1)$. I figure this is a permutation problem and attempted to tackle it as follows.

If $A$ is the number of times our random variables takes the value +1, and $B$ is the number of times our random variable takes the value -1 then the number of ways this outcome is possible is

$$P(A,B)=\frac{(A+B)!}{A!B!}.$$

Obviously

$$A+B=N,$$

and

$$A-B=n.$$

Solving this for $N$ and $n$ in terms of $A$ and $B$ we get

$$A=\frac{N+n}{2},$$ $$B=\frac{N-n}{2}.$$

Therefore our permutation formula takes the following form:

$$P(N,n)=\frac{N!}{\left( \frac{N+n}{2} \right) ! \left( \frac{N-n}{2} \right) !}$$

I think this works for allowed values of $A$ and $B$, however based on that last formula I can choose values of $N$ and $n$ that should not be allowed such as $N=3$ and $n=2$. This gives fractional values for $A$ and $B$, which is not allowed. Therefore $P(3, 2)$ ought to be zero, however it's not based on my formula. I'm not really sure how to resolve this issue. Any help would be appreciated.

  • I understand what you're saying, however it is unclear to me how I would write this in a clear format. I suppose I could write something like

    $$P(N,n)=\left[ \frac{N!}{\left( \frac{N+n}{2} \right) ! \left( \frac{N-n}{2} \right) !} \right] (-((N+n) mod 2)+1) $$

    but that just looks ugly. I was wondering if there was a better way to write this.

    – Dargscisyhp Feb 25 '15 at 03:01

2 Answers2

3

One way to look at it is as the coefficient of $x^n$ in $\left(x+x^{-1}\right)^N$, which is the coefficient of $x^{n+N}$ in $\left(1+x^2\right)^N$. This the count is zero if $N+n$ is odd, and you get your formula when $N+n$ is even.

When $N+n$ is odd, your formula doesn't make sense. We can define the $\Gamma$ function to define $x!$ in a sense when $x$ is a half-integer, but it isn't a combinatorial value.

Note that $(A+B)+(A-B)=2A$ is even, so you can't have $N+n$ odd.

Thomas Andrews
  • 177,126
1

Here is a similar problem. A fair coin, whose sides are labelled $0$ and $1$, is tossed. The probability that the output is $n \in \{0,1\}$ is $P(n) = 1/2$. Plugging $2$, we obtain the absurd consequence that $2$ is obtained with probability $1/2$. What went wrong? The formula only works for $n \in \{0,1\}$. The same happens in your case.

Yuval Filmus
  • 57,157