Wednesday, 13 November 2019

Scales Problem

The first weight which I think the vendor should have is 1 g weight. Then I was in a dilemma should I opt for 3 g or 2 g. Initially, I chose 2g and I was able to get a maximum of 3 g but if I chose 3g then 3-1 will give me 2 and 3+ 1 will give 4g. So, till now I thought 1g and 3g should be fine to weigh the herbs till 4g. Now in order to weigh 5 g next highest weigh should be 9 g since, 9-3-1 = 5 g, I tried with 8g but  Using 1, 3 and 8. I was able to get to the maximum at 12 g in comparison to 9,1,3 which leads to 13. For instance, I chose 1,3,8 then the highest weight I figured out was 25g since 25-8-3-1= 13g, But using 1,3,8,25 the maximum I was able to reach was 37g( 1+3+8+25). Therefore, I figured out I should choose 9 instead of 8. Since 1, 3, 9 covered all the weighs from 5g to 13g.
9-3-1=5
9-3=6
9-3+1=7
9-1=8
9+1=10
9+3-1=11
9+3=12
9+3+1=13
The weight should be 27g since 1+3+9+x= 40, so x=27g.
Moreover, using 1,3,9,27 we can have the weighs after 13g.
27-9-3-1=14                        27-9+3=21              27+3-1=29               27+9=36
27-9-3=15                           27-9+3+1=22          27+3=30                   27+9+1=37
27-9-3+1=16                       27-3-1=23               27+3+1=31               27+9+3-1=38
27-9-1=17                           27-3=24                   27+9-3-1=32             27+9+3=39
27-9=18                              27-3+1=25               27+9-3=33                27+9+1+3=40
27-9+1=19                          27-1=26                   27+9-3+1=34
27-9+3-1=20                       27+1=28                  27+9-1=35


No comments:

Post a Comment