A movie company wants to make movies featuring various monsters. They want each movie to have at least 2 different monsters and no two movies to have the exact same set of monsters. What is the minimum number of monsters the company must use in order to make a million movies?
Details and assumptions
1 million = 1 , 0 0 0 , 0 0 0 .
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.
OMG!!! I made a silly calculation mistake :-( I entered 21 22 and 23....I will remember this till I die...
If the number of monsters is equal to n , then the number of subsets (the ways to choose the monsters) is equal to 2 n . This is because every monster can be included or not included in the movie. However, since we want every movie to have at least two monsters, we must subtract the possibilities where there is only 1 or no monsters.
For no monsters, there is only one possibility. None are included For one monster, there are n possibilities; the one included can be any of the n .
So, we have the inequality
2 n − 1 − x ≥ 1 0 0 0 0 0 0
Notice that 2 2 0 = 1 0 4 8 5 7 6 and 1 0 4 8 5 7 6 − 2 0 − 1 = 1 0 4 8 5 5 5 . If we try 19, we will obtain an amount too small (less than one million), so the correct answer is equal to 2 0 .
Let us consider, the minimum number of monsters required to make million movies=n. By the problem, each movie should have at least 2 different monsters. So, the number of movies can be formed = n C 2 + n C 3 + . . . . . . . + n C n = n C 1 + n C 2 + . . . . . . . + n C n − n C 1 = 2 n − n − 1 . Here, 2 n − n − 1 > 1 0 0 0 0 0 0 . By solving this, the minimum value of n = 2 0 . So, minimum 20 monsters will be needed to make a million movie.
We have a set of n monsters. We can choose 2, 3, 4... all the way to n monsters. This is Pascal's triangle sum minus the 0th and 1st terms, or 2^n - 1 - n >= 1000000 possibilities. Note 2^10=1024, so 2^20 is greater than a million. Verify that 20 is indeed the first number that works. And we're done.
that's pretty clever
We want to evaluate the value of: nC2+nC3+...+nCn We see from the binomial expansion that (1+1)^n = 1+n + (nC2+nC3+...+nCn) We want that value to be larger than 1 million, we see that 2^20 >1000,000. Hence, n=20
Let the minimum number of monsters be N. Numbers of ways to choose k out of N objects is k ! ( N − k ) ! N ! , and 2 N = ∑ k = 0 N k ! ( N − k ) ! N ! .
We cannot choose the sets which only have 1 or 0(means that it is an empty set) monster,each set have N and 1 types respectively.So we have 2 N -(n+1)> 1 0 6 . Trying a few times, we get 2 2 0 -21=1048555, thus N=20.
Here's this solution, implemented in C
https://github.com/gubatron/brilliant/commit/2e1e25fabd7fd25bad2ab79ce463dce9b427b184#commitcomment-4438715
If M=number of monsters they need, then the sum ( 2 M ) + ( 3 M ) + . . . + ( M M ) should be equal to or greater than 1 , 0 0 0 , 0 0 0 since it is just the sum of the combinations of monsters possible. This is similar to ( 0 M ) + ( 1 M ) + . . . ( M M ) which is just 2 M . We see that 2 2 0 is just above 1 , 0 0 0 , 0 0 0 , and after subtracting ( 0 2 0 ) and ( 1 2 0 ) , the answer is still above 1 , 0 0 0 , 0 0 0 So, our answer is 2 0 .
if n is the number of monster and 2 is the number used in each movie from n monsters then 2^n=1,000,000 . solving this equation results in the solution n=20
Basically, if there are n monsters to choose from, we will select nC2+nC3+nC4+.....+nCn
Now, we know that, nC0+nC1+nC2+..+nCn= 2^n
Checking for 1,000,000=1000x1000=(2^10)x(2^10) {approx} =2^20 therfore, n is 20
Suppose we have N as the minimal amount of monsters needed.
So, we have ( 2 N ) ways of choosing 2 monsters for a movie, ( 3 N ) ways of choosing 3 monsters for a movie.... ( N N ) ways of choosing N monsters for a movie.
So, we must find minimal N for which ∑ i = 2 n ( i N ) ≥ 1 , 0 0 0 , 0 0 0 ( I ) .
Since ∑ i = 0 n = 2 n , we must find minimal N for which 2 N − ( 0 N ) − ( 1 N ) ≥ 1 , 0 0 0 , 0 0 0 → 2 N − N − 1 ≥ 1 , 0 0 0 , 0 0 0
As this is a transcendental inequation, and the exponential grows way faster than a one-degree polynomial, let's find m ≤ N for which 2 m ≥ 1 , 0 0 0 , 0 0 0 → m = 2 0 (m must be an integer)
By trying N = m = 2 0 , we get, from ( I ) : 2 2 0 − 2 0 − 1 = 1 , 0 4 8 , 5 5 5 ≥ 1 , 0 0 0 , 0 0 0 and there is no other small N, since m ≤ N
Problem Loading...
Note Loading...
Set Loading...
Assume that there are n distinct monsters.
Now consider a set of n distinct numbers. In each movie there must be atleast 2 different monsters, so numbers of way in which we can select two numbers from this set is ( 2 n ) Therefore, there will be ( 2 n ) distinct subsets (this distinction meets the criteria that the two movies cannot have same set of monsters)
But the movie can also have more than 2 monsters, so consider 3 set of monsters, then there will be ( 3 n ) different subsets. Similarly consider for 4 , 5 , 6 … n set of monsters.
Now the total distinct subsets will be ( 2 n ) + ( 3 n ) + ( 4 n ) + … ( n n ) and hence these many set of monsters.
But we need to make 1 million movies so
( 2 n ) + ( 3 n ) + ( 4 n ) + … ( n n ) ≥ 1 , 0 0 0 , 0 0 0
2 n − ( 0 n ) − ( 1 n ) ≥ 1 , 0 0 0 , 0 0 0
Now here you need to calculate that for which value of n it is true.
We get it is true for all n ≥ 2 0 . Hence n m i n = 2 0