Odd dolls

David has 2014 dolls. He has to choose odd number of dolls from the collection. Find the last three digits of the number which represents the total number of ways in which he could do this.

Details and Assumptions :- David can choose 1,3,5.....or any odd number of toys but not an even number of them


The answer is 192.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Python/Sage Code:

  1. Define the Factorial:

    f = lambda n: reduce(lambda x,y: x*y,range(1,n+1))
    
  2. Define c(n,r):

    c = lambda n,r: f(n)/(f(n-r)*f(r))
    
  3. Find the sum of all the terms in 2014Choose1, 2014Choose3,.... 2014Choose 2013

    sum(map(lambda n: c(2014,n),range(1,2014,2)))
    

Returns

940548665568669306251536958404757081311082661551059108231284930007667721 \ 332629761111375451190481936317190934232258529504007879852739014927504122 \ 966971722289472552871078398197765642478782382447586745769902600079317250 \ 993878191213477456421077323500371729653731804466371042874405729266169033 \ 000257306380965325571431702400684077894692739546431970516457689091514390 \ 255260678803636290619279616342108306500134556458970287457296562420600045 \ 913373517277196622966242525937013186214163166593344799391393518637733932 \ 076446381883519208233258347987390537033939221566465437167851936340727978 \ 540772997219818300612848648192 940548665568669306251536958404757081311082661551059108231284930007667721\ 332629761111375451190481936317190934232258529504007879852739014927504122\ 966971722289472552871078398197765642478782382447586745769902600079317250\ 993878191213477456421077323500371729653731804466371042874405729266169033\ 000257306380965325571431702400684077894692739546431970516457689091514390\ 255260678803636290619279616342108306500134556458970287457296562420600045\ 913373517277196622966242525937013186214163166593344799391393518637733932\ 076446381883519208233258347987390537033939221566465437167851936340727978\ 540772997219818300612848648192

There is a direct approach which tells us that there are 2 2013 2^{2013} total number of ways.

Calvin Lin Staff - 7 years ago

Log in to reply

Yes. Using binomial coefficients theorem one can even derive it. But Agni is such a computer geek that he never does problems without it,,, :P

Krishna Ar - 7 years ago

Consider this question: In how many ways can I select any number of dolls from a collection of 2014 dolls.

For each doll you have, 2 choices. To select it or not, so there are 2^2014 ways.

Now, for only odd number of dolls:

Half of those cases we selected odd number of dolls

Clearly the answr is 2^2013

Is that what you meant?

Agnishom Chattopadhyay - 6 years, 8 months ago

Does this work in Python too?

Krishna Ar - 7 years ago

Log in to reply

Yes. It does

Please re-share this

Krishna Ar - 7 years ago
Bernardo Sulzbach
Jun 23, 2014

Mathematica (half the world is already built-in, so one line kills it all)

Mod[Sum[Binomial[2014, 2 i - 1], {i, 1, 1007}], 1000]
= 192

Note: I solved it the hard way first.

Gaurav Pathak
Jun 13, 2014

The problem states choose the odd number of Dolls from 2014 dolls. This means we can choose 1, 3, 5 ... 2013 dolls out of 2014. Now, how many ways are there for choosing 1 doll ( 2014 1 ) \binom{2014}{1} Similarly to choose 3 dolls , there are ( 2014 3 ) \binom{2014}{3} ways and so on. So total number of ways is given by, ( 2014 1 ) + ( 2014 3 ) + ( 2014 5 ) + + ( 2014 2013 ) \binom{2014}{1} + \binom{2014}{3} + \binom{2014}{5} + \dots + \binom{2014}{2013} We know that, ( n 0 ) + ( n 1 ) + ( n 2 ) + + ( n n ) = 2 n \binom{n}{0} + \binom{n}{1} + \binom{n}{2} + \dots + \binom{n}{n} = 2^n This consists of equal number of odd and even terms so sum of only odd terms is 2 n / 2 2^n/2 In our case this is 2 2013 \boxed{2^{2013}} Finally we have to calculate 2 2013 % 1000 2^{2013} \% 1000 which comes out to be 192 \boxed{192}

By the way, can you prove your proposition for the sum of that extended binomial coefficents ...? 2^n and 2^n-1?

Krishna Ar - 6 years, 12 months ago

Good solution! But you could have done the last part too without a computer! :P

Krishna Ar - 6 years, 12 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...