A pirate captures you and your ship, hands you 4 0 9 5 identical balls and 1 2 bags. The pirate says, "Arrange these balls in these bags however you like, but soon you will be required to give a specific number of balls(by handing over some bag or bags), and you cannot change the number of balls in any of the bags once you have arranged them all. If you are able to do so, your ship will be given back to you and you will be freed! But, if you are unsuccessful, you will be thrown in the water!"
Can you fulfill this demand for any positive integer n less than or equal to 4 0 9 5 and save you, your companions and your precious ship?
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.
We can convert any natural number into its binary equivalent using a specific string of 0s and 1s.
Below are some examples:-
1037 = 10000001101; 2020 = 11111100100; 4040=111111001000 ...
At first, the wicked captain wants us to hand him over any random number of coins. As, every coin has same value, we can say that the number of coins given to him is proportional to total price. So, one of the best approach is to distribute the coins in a binary way( 2^0,2^1,2^2...2^11) in bags.
By this way, this situation would be then resembled into binary and decimal numbers. In this resemblance, the bags given to the pirate represent 1 and the remaining bags will be 0.
So, we ought to surprise the pirate by this shrewdness and our ship and crew members would be back to us soon!
Note: Could someone explain me how to use Latex? Please help me so to make others' attracted to my solution.
In latex you need to use this http://s1.daumcdn.net/editor/fp/service nc/pencil/Pencil chromestore.html when you are done typing the equation put it in the brackets that latex is surounded with
Log in to reply
Hey, you deceived me! The AI says that URL is not in the server. (Error 404)
Please give me correct information about Latex.
@Pradeep Tripathi - L A T E X is very easy to learn, here are some links for beginners -
Link to my L A T E X Guide(My guide sucks)
Link to Páll Márton's L A T E X Guide(Better than mine)
Link to Daniel Liu's L A T E X Guide(The best guide)
@Pradeep Tripathi @Vinayak Srivastava - Are you guys commenting and then deleting, coz I have like 6-8 notifications from this problem, yet there is not a single comment here :)
Problem Loading...
Note Loading...
Set Loading...
We need to fill every bag with a distinct power of 2 number of balls.
12 bags 2 0 + 2 1 + 2 2 + 2 3 + ⋯ + 2 9 + 2 1 0 + 2 1 1 = 12 bags 1 + 2 + 4 + 8 + ⋯ + 5 1 2 + 1 0 2 4 + 2 0 4 8 = 4 0 9 5 balls, using all of them!
When the pirate asks us for a number of balls, you have to express this number in binary number system (base 2) and give them the bags that correspond to the right powers of 2 .
So, we can save ourselves from this evil yet clever pirate!