0

I'm stuck in figuring out a problem, and I can't quite figure out a way out right now. any suggestion is highly appreciated.

we have a 10bit number(made up of 1s and 0s), and we do not know the number. what is the probability of having even number of 1s? So, what i did:

-0 ones

-2 ones

-4 ones

-6 ones

-8 ones

-10 ones

I started to look at each case. The first and the last can only be one number, I also found that the second has $90$ numbers possibilities of construction. When we have $4$ ones, i calculated we get 10*9*8*7 numbers etc. I'm getting really weird numbers though at the final step of adding it all in.

Is there an easy way to go about this counting problem? I feel my solution is very error-prone and tedious. :/

MR_BD
  • 5,942
phoenix
  • 671
  • 1
    I'm sorry, I don't understand, what probability; probability of which event are you trying to calculate? – DBFdalwayse Sep 10 '13 at 03:18
  • sorry! the original problem's idea is to find sth else using this probability... – phoenix Sep 10 '13 at 03:22
  • You have $2^{10}=1024$ possibilities, and for each bit, exactly half of your possibilities have that particular bit set. Does this help clarify? – abiessu Sep 10 '13 at 03:24
  • 1
    Are leading zeros permitted? Your calculations seem to indicate so. If so, the first nine bits have either an odd or an even number of $1$'s. The last bit can make it even or odd with probability $\frac 12$, so the overall probability of even is $\frac 12$ – Ross Millikan Sep 10 '13 at 03:31
  • i'm not so sure... should probably emphasize that having zero 1s is also considered as having even number of 1s, thus im not sure the suggested 1/2 is true... we'd have as odd number of 1s: 1 ones, 3, 5, 7, 9 ones. even number of 1s: 0, 2, 4, 6, 8, 10 ones. – phoenix Sep 10 '13 at 03:57
  • ugh i'm probably just confused. will look this again tomorrow morning. thank you as always for your quick and reliable responses :) – phoenix Sep 10 '13 at 03:58

2 Answers2

1

The probability is the same as the probability that a randomly chosen subset of $\{1,2,\ldots,10\}$ has an even number of elements. Prove that if $S$ is any non-empty set, exactly half of the subsets of $S$ have an even number of elements.

There are many ways to prove this, including induction on the size of the set $S$; if you search the site, you’ll find several versions of this question, of which this probably has the most complete set of answers.)

Brian M. Scott
  • 616,228
1

Just look at the last bit, which is $0$ or $1$ with equal probabilities. As it flips the parity of the outcome half of the time, the end result will be equally likely to be even or odd regardless.

Reasoning more formally, after you have chosen and counted the other bits, you will have an even count with some probability $p$ and an odd number with probability $p-1$. Now is the last bit is $0$ the whole count will be even with probability$~p$, but if the last bit is $1$ the whole count will be even with probability$~1-p$. All in all you get probability $(p+(1-p))/2=1/2$, regardless of $p$.