Visit our sponsor Granny's Eggs  
Home
Microsoft Interview Process
Microsoft HR Questions
Technical Questions
Puzzles/Riddles
Resume Tips and Template
Discuss
Question to Interviewer
Interview Tips
Term Of Use
Site Feedback


Which bucket has the highest ratio between red and blue?
If you have two buckets, one with red paint and the other with blue paint, and you take one cup from the blue bucket and poor it into the red bucket. Then you take one cup from the red bucket and poor it into the blue bucket. Which bucket has the highest ratio between red and blue? Prove it mathematically.
Add your possible solutions in a comment, I will put the one which will convience me here

Comments:

Which bucket has the highest ratio between red and blue?
By Techamp on Wednesday, October 11, 2006 (UMST)
Let's suppose both buckets contain 1 unit each of red and blue paints. and x<1, be the capacity of cup. After first action, ratio of red to blue paint in red bucket is 1/x and quantity of red in cup is x/(1+x) and blue is x^2/(1+x). After 2nd action, red to blue in blue bucket is (x/(1+x))/(1+(x^2/1+x)) = (x/(1+x+x^2)) = (1/(1+x+(1/x)), so ratio of red to blue in red bucket is clearly more.

Reply to this Comment

paint
By gryyn on Monday, February 05, 2007 (UMST)

This is easily solvable by logics.

You have two buckets of pains. One bucket of red and one bucket of blue. They have the same amount of paint in them.

Now you take one cup from blue and pour it in red.

Blue bucket now has a full bucket minus one cup full.

Red bucket now has a full bucket plus one cup full.

 

Second step.

You pour one cup of mixed paint from 'red' bucket into blue bucket.

Now both the buckets have again the same amount of paint in them.

Since no new paint was gained from anywhere else, they both have the same ratio of blue:red and red:blue paint in them.

Reply to this Comment

Which bucket has the highest ratio between red and blue?
By dhochbaum on Thursday, February 15, 2007 (UMST)
Assuming the amount of paint in each bucket is equal, the ratios are equal.  If you take one cup from red and pour it in blue, and then take one bucket from blue and pour it in red, then they will both have the same amount of liquid as before.  If the red bucket has x amount of blue paint, but it has the same amount of paint as before, then the blue bucket must have x amount of red paint.

Reply to this Comment

Ratio will be the same.
By Miklovan on Sunday, February 18, 2007 (UMST)
Techamp: You forgot that the amount of blue in the first bucket became (1-x), not 1, after the first operation. If you will make everything right you will find that the ratio in the end will be the same for both buckets 

Reply to this Comment

Newbie
By xiztence on Wednesday, March 28, 2007 (UMST)
Hi. I am a newbie on here an am not sure if I am posting this in the right place. I do not follow the answer to this question about the buckets of red and blue paint. And there is a posting in the discussion area that says they are equal. Does anyone have a clearer explanation for this?

Reply to this Comment

Buckets and paint
By SantiagoICanepa on Friday, May 25, 2007 (UMST)

So... probably the same answer, but in other terms:

 

B1 = n * Cr (bucket 1 holds n cups of Red paint, assuming n > 0)

B2 = n * Cb (bucket 2 holds n cups of Blue paint, assuming n > 0)

 

We move one cup from B1 to B2

 

B1 = (n-1) * Cr

B2 = n * Cb + Cr

 

We move one cup of the mix in B2 to B1

 

B1 = (n-1) * Cr + (n * Cb + Cr) / n

B2 = n * Cb + Cr - (n * Cb + Cr) / n


Reducing this a bit...

 

B1 = (n-1) * Cr + Cb + 1/n * Cr

B1 = (n +1/n - 1) Cr + Cb

 

B2 = n * Cb + Cr - Cb +1/n Cr

B2 = (n-1) * Cb + (1+1/n) * Cr.

 

Considering that a bucket holds more than a cup of paint (n > 1) then

B1 => 1 to (n -1 + 1/n) is ratio Blue to Red

B2 => (n-1) to (1+1/n) is ratio Blue to Red

 

The result needs analysis:

If the buckets hold more than 2 cups (n > 2) then B2 has more blue

If the buckets hold exactly 2 cups (n = 2), then both buckets have the same amount of paint

If the buckets hold less than 2 cups (1 <= n < 2) then B1 has more blue

Reply to this Comment

techamp would be close
By msftpfessd on Wednesday, May 30, 2007 (UMST)
In a Microsoft interview, to get extra credit I would probably ask first if the same cup is being used and how big the bucket is and if the paint is being constantly mixed or if the thickness of the paint is the same.  If the bucket is HUGE and you poured the paint on the left side and the paint wasn't being mixed you could be grabbing the same amount of paint.  If the paint is being mixed then you can disallow that.  Of course we're looking at maroon paint after the blue is dumped into the red so it is technically not red anymore.  Also if you use the same cup and the bucket is huge and you don't rinse the cup there is still a little bit of blue paint residue left on the cup so you might want to account for that as well. 

Reply to this Comment

Ratio remains same
By DesiNeo on Tuesday, July 31, 2007 (UMST)

Let us say each bucket had 100 cups of paint. When u take out 1 cup out Blue bucket, the Blue bucket shall have 99 cups. After adding this to Red bucket, Red bucket has total 101 cups (100 Red:1blue).

 

Since the paint is mixed in the Red bucket, when u take out 1 cup from Red bucket the ratio of Red to blue remains same in Red bucket that is 100Red:1Blue.

 

Also the mixture in the cup has 100 parts of Red and 1 part of blue. Or we can say the Cup has 100/101 part Red and 1/101 part Blue. When we add this cup to blue bucket, the blue bucket shall have:

99Blue+1/101Blue+100/101Red = 10000/101Blue+100/101Red

Or 100Blue:1Red.

 

So ratio of Blue to red in blue bucket is same as ratio of Red to blue in Red bucket

Reply to this Comment

Logically - equal
By Senya on Saturday, August 04, 2007 (UMST)
Let's say, we have X of red and X of blue. After action 2 we have some Y of blue paint in red bucket. This means we have X-Y of red paint in that red bucket. But where is the remaining part of red: X-(X-Y)? Do you remember, we had X in the beginning. It should be somewhere. And I believe it's in the second, blue, bucket. So, the blue contains Y of red and X-Y of blue (remember, we found Y of blue in red bucket?).

Reply to this Comment

Equal
By Senya on Friday, August 10, 2007 (UMST)
Let's say we had X of paint in each bucket. After all the manipulations we still have X paint in each bucket, but the paint is mixed now. Let's take Red bucket: it has Y of blue paint. How much red paint does it have? X-Y. Where is the remaining red paint? It's in blue bucket. How much is it there? X minus quantity of red paint in red bucket (it could not disappear so, the total quantity of red paint total is still X): X - (X - Y). What gives us Y. So, we have Y blue paint in red bucket and Y red in blue one.

Reply to this Comment

The answer
By Leon on Monday, September 24, 2007 (UMST)

no, this question is not that simple.

 

there are three situation: lead to differents result.

 

case 1:one cup is less than half of  the bucket's volume.  ratio of red to blue in red bucket is  more.

 

case 2: one cup is equal to half of the bucket's volume. ratio of red to blue in red bucket is  equal to the other one.

 

case 3: u know that.

Reply to this Comment

Solution
By QuickSolver on Saturday, October 13, 2007 (UMST)
Lets take a scenario to ease the case ;-) 20 units of liquid in both buckets. Red Bucket Blue Bucket ========== =========== Quantity: 20R + 0B 20B + 0R -- 20B - 5B + 0R 20R + 5B 15B + 0R 20R + 5B - (4R + 1B) 15B + 0R 16R + 4B 16B + 4R Ratio: 4R:1B 4B:1R Therefore, the ratio of Red is to blue or blue is to red in the two buckets are the same. Bye, QS ;-)

Reply to this Comment

Add Your Comment

New Articles
  • Combinations in a character array.
    Write a program that takes input a char array and outputs all the combinations of the characters in the character array.
    Example: consier char array {'a','b','c'}
    the output shouold be abc,cab,bac,acb,cba,bca that is all the combinations of characters 'a','b','c'.


  • N-Queen Problem.
    Write a Program to solve N-Queen Problem.

  • Reverse a string
    Reverse a string using recursive function

  •  

    Most Popular Articles
  • Crazy Guy On The Airplane
    A line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight.

  • What are your greatest weaknesses
    Beware - this is an eliminator question, designed to shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview.

  • Question: Tell me about yourself.
    Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.

  •  

    New Posts

  • My News Topic 8
    Posted by evashy on 2008 წლის 05 09, პარასკევი (UMST)

  • 3StandwOnsIt
    Posted by undondorade on 2008 წლის 03 09, ოთხშაბათი (UMST)

  • 2SOnKeysOns
    Posted by undondorade on 2008 წლის 02 09, სამშაბათი (UMST)



  •