Math question (easy one)

Discussion in 'Physics & Math' started by Jerrek, Mar 27, 2003.

  1. Jerrek Registered Senior Member

    Messages:
    1,548
    How many bit strings of length 10 have exactly 3 zeros?

    I'm unsure how to calculate it except by some brutish method:

    If the length was 4, then:

    1000
    0100
    0010
    0001

    So (4) in total.


    If the length was 5, then:

    1( result from 4) +

    0 (1100)
    0 (1010)
    0 (1001)

    0 (0110)
    0 (0101)

    0 (0011)

    So we get something like 4 + 3 + 2 + 1 = (10) in total.

    Does this go on for 6, 7, etc.? I don't want to do a proof by induction. Lol.

    By that logic, 10 would be 9+8+...+1 = 45. But that seems a little too low. I don't think that is right. I think I need to do another step (6) and check out the values and maybe then do some induction, but I'm lazy.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. slimshady2357 Registered Member

    Messages:
    20
    Love the avatar.

    It's just 10 choose 3, which is 10!/7!3!

    Which is = 120

    Please Register or Log in to view the hidden image!



    In general, the way to choose x things from y choices is =

    Y!/X!(Y-X)!

    In this case, you have to choose 3 spots for 0's amongst 10 spots altogether.

    Please Register or Log in to view the hidden image!



    Oh, in case you don't know what a factorial is....

    7! = 7*6*5*4*3*2*1 = 5040

    So 10!/7!3!

    is 362880/5040*6 = 120

    Please Register or Log in to view the hidden image!



    Adam
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Jerrek Registered Senior Member

    Messages:
    1,548
    Thanks a lot. That makes more sense.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. Jerrek Registered Senior Member

    Messages:
    1,548
    Damn I feel stupid now. I did this in high school, but for some reason I always fail something like Occam's Razor. I feel ... stupid.

    Please Register or Log in to view the hidden image!

     
  8. slimshady2357 Registered Member

    Messages:
    20
    That's how I do it too!

    And it's quick in your head

    Please Register or Log in to view the hidden image!



    I mean I did it EXACTLY like that in my head, right down to the 10*3*4

    Please Register or Log in to view the hidden image!



    Adam
     

Share This Page