wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> hard >> Weighings - A sack of rice
(Message started by: Altamira_64 on Jan 29th, 2012, 6:07am)

Title: Weighings - A sack of rice
Post by Altamira_64 on Jan 29th, 2012, 6:07am
A grocer has a sack of rice of 10 kgs, 2 weights of 200 and 300 grams and a 2-discs balance.
Unfortunately, he does not have any other scale in his store, so he is limited to selling the rice at multiples of 100 grams, and only if he can measure the desired quantity in only 3 weighings.
What is the probability that he can serve the first customer that enters the shop, who may desire to buy any quantity, starting from 100 grams and up to 10 kgs?
Suppose that each weighing is completed once the 2 discs balance and also that the bags have negligible weight.

Title: Re: Weighings - A sack of rice
Post by rmsgrey on Jan 30th, 2012, 9:18am
Some preliminary thoughts:

1) Why is he limited to multiples of 100g? With three weighings, I could produce 25g, 50g, 75g, 100g, 125g, 150g, 175g, 200g, ... Some achievable quantities aren't even whole numbers of grams...

2) The (sensible) operations you can do with the scales all consist of partitioning the set of two weights into three (left pan, right pan, unused), possibly adding a bag of rice to either or both pans, then taking one bag of rice and dividing it into two, either so they differ by the difference between left and right pan weights, or so one of the output bags is the difference between the pan weights. After each weighing, you can merge bags of rice, so, after 3 weighings, you can have up to 4 bags of rice of known weight.

3) With (up to) one weighing, you can measure:

0g
10000g
5000g

100g
9900g
4950g
5050g

200g
9800g
4900g
5100g

300g
9700g
4850g
5150g

500g
9500g
4750g
5250g

Of which, 6 are not multiples of 100g, and we can probably eliminate 0 too, leaving 12 "valid" quantities.

From the second weighing, you can also use existing bags of rice as weights, so the branching number may increase (some operations would require you to borrow rice from somewhere, and then you'd have negative rice to keep track of too - avoiding this would limit the branching)


For one weighing, I make the answer 12%. Someone else can work out the rest :P

Title: Re: Weighings - A sack of rice
Post by Altamira_64 on Feb 1st, 2012, 11:37am
Very nice approach!
However, I guess, to get some of the weights you suggest, you need 2 weighings, isn't it?
For example, to get the 4900, you first need to split the 10kg into two parts (by using the scale once), then place 5kgs and 200 grams on one pan and the desired quantity plus 300 grams on the other pan. Then if they balance, we have the 4900 weight. This is 2 weighings.
Same goes for 5100.

Title: Re: Weighings - A sack of rice
Post by towr on Feb 1st, 2012, 11:59am
No, to get 5100 and 4900 you put 200 grams on in one pan of the scale, then split the 10kg over the pans to balance out. So it's one weighing.

Title: Re: Weighings - A sack of rice
Post by Altamira_64 on Feb 1st, 2012, 12:51pm
OK.
By the 2nd weighing, we can have the following:
100
200
300
400
500
600
700
800
900
1000
1100
2500
3400
3500
3600
3700
3800
3900
4000
4100
4200
4300
4400
4500
4600
4700
4800
4900
5000
5100
5200
5300
5400
5500
5600
5700
5800
5900
6000
6100
8400
8500
8600
8700
8800
8900
9000
9100
9200
9300
9400
9500
9600
9700
9800
9900
10000

(Including the ones from the first weighing).
These are 57, so we have 57% so far.
Now deep breaths so as to move on to the 3rd weighing!!
I will try to focus only to the weights that are missing!

Title: Re: Weighings - A sack of rice
Post by Altamira_64 on Feb 1st, 2012, 1:28pm
Well, if I haven't made any obvious mistake, the 3rd weighing gives us all the rest:

1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2600
2700
2800
2900
3000
3100
3200
3300
6200
6300
6400
6500
6600
6700
6800
6900
7000
7100
7200
7300
7400
7500
7600
7700
7800
7900
8000
8100
8200
8300

So we now have a 100% probability to cover every request.

Title: Re: Weighings - A sack of rice
Post by Altamira_64 on Feb 1st, 2012, 1:43pm
Ahh yes you are right!

on 02/01/12 at 11:59:07, towr wrote:
No, to get 5100 and 4900 you put 200 grams on in one pan of the scale, then split the 10kg over the pans to balance out. So it's one weighing.


Title: Re: Weighings - A sack of rice
Post by Altamira_64 on Feb 1st, 2012, 2:00pm
Hmmm... it seems I was not thinking straight...
Some of these weights or combinations of weights cannot be used together!
I must go through all of them again...  >:(


on 02/01/12 at 13:28:46, Altamira_64 wrote:
Well, if I haven't made any obvious mistake, the 3rd weighing gives us all the rest:

1200
1300
1400
1500
1600
1700
1800
1900
2000
2100
2200
2300
2400
2600
2700
2800
2900
3000
3100
3200
3300
6200
6300
6400
6500
6600
6700
6800
6900
7000
7100
7200
7300
7400
7500
7600
7700
7800
7900
8000
8100
8200
8300

So we now have a 100% probability to cover every request.


Title: Re: Weighings - A sack of rice
Post by antkor on Feb 25th, 2014, 3:58am
It is 100%!



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board