Wednesday, February 10, 2010

Weighty problem

You have goods to sell whose weights are whole numbers of kilograms, between 1 and 80. Using only 4 weights, what do they need to be?

Labels:

36 Comments:

Blogger Zaux said...

selling those kilos could get you in trouble

February 10, 2010 4:14 PM  
Blogger Ethan said...

20kilograms each

February 10, 2010 4:35 PM  
Blogger Chris said...

My secret's out ;)

February 10, 2010 4:36 PM  
Blogger Chris said...

Hi Ethan. How would you measure 1kg, say?

February 10, 2010 4:40 PM  
Blogger Ragknot said...

What do they need to be?

Easy, they need to be kilogram weights.

..............................

We did this before, but it was for 40 pounds,
and we found that 1, 3, 9, and 27 could be used
by sometimes adding a weight to the balance with
the item being weighted. I thought this was a neat
solution, and noted these are powers of three.
I think I remember reading a web page on it.
The next power of three would be 81. So I know
there must be another "trick". Reaching 40 with
four weights was a stretch. Now we are reaching for
80 with 4 weights again?

hummm, a good one.

February 10, 2010 4:57 PM  
Blogger Chris said...

I posted the 40 pounder (too).

Ragknot, how do you use blogspot.com? I don't understand it at all. Not even sure if I've properly got a site.

February 10, 2010 5:05 PM  
Blogger Chris said...

Ragknot, I worked it out. Chris's blog

February 10, 2010 5:45 PM  
Blogger Knightmare said...

i hope this is not cheating

you only need the same 4 weights that Ragknot pointed out-1,3,9 and 27

for 1kg to 40kg:you have the needed weights on one side of the balance, and the weed...oh,i mean "goods" on the other

for 41kg to 80kg:you first measure out 40kg then use the weights in the same way but reversed.(you will be using the 40kg of goods as a weight)

i.e.41kg
a-measure 40kg
b-remove all weights
c-put the 1kg weight on the same side as goods
d-add goods to blank side until balanced=41

i.e.42kg
a-measure 40kg
b-remove all weights
c-put 3kg weight on the same side as goods
d-on blank side,put 1kg weight and goods until balanced

February 10, 2010 6:40 PM  
Blogger Knightmare said...

hi Chris
i saw your blog thingy but can't seem to post a comment

is that your leg in the pic?

February 10, 2010 6:43 PM  
Blogger Chris said...

Hi Knightmare. That was a good answer, but it isn't the one that I want.

I don't know how to allow posts, and I don't really want to either. I only made it so that I can post pictures.

Yep, that's my leg. I call her Pequod (not really). I'll put a bigger picture up in a few minutes.

Chris's blog

February 10, 2010 6:54 PM  
Blogger Knightmare said...

i would guess you can measure out ANY weight using the 1,3,9,27 weights(or just the 1kg weight for that matter)if you kept on going back and forth

February 10, 2010 6:54 PM  
Blogger Knightmare said...

i've been lucky,no broken bones...yet

February 10, 2010 6:58 PM  
Blogger Knightmare said...

it may not be the answer you want but it does work and does use only four weights

do i at less 1/2(win)

February 10, 2010 7:09 PM  
Blogger Chris said...

You 3/4 win.

There is another answer that doesn't use the stock as weights.

February 10, 2010 7:13 PM  
Blogger Zaux said...

Chris ... saw you leg pic. As of June of last year, I have 2 rods, one on each side of my spine, with cross pieces, and screws... looks like a freakin' ladder in my back.

February 10, 2010 8:23 PM  
Blogger Chris said...

Is that permanent?

February 10, 2010 8:27 PM  
Blogger Ragknot said...

I did the weights from 1 to 40 with the 1,3,9,27 but I didn't see how to go on without a fifth weight. I added an 81# and went to eighty, but the procedure didn't give a clue as how to do it.

The trick I would use, (and it would be cheating), would be to find one item that weighed 40 KG and use as an extra weight to weight items over 40.

February 10, 2010 8:30 PM  
Blogger Zaux said...

I'm afraid so ... protate cancer metastized .. 4 tumors against my spine nearly paralyzed me ...surgeon cut me from neck to waist ... but I'm still kickin' ... not pushing up daisies, so it's okay.

February 10, 2010 8:33 PM  
Blogger Zaux said...

you guys are such good thinkers, and problem solvers, I have a time finding puzzles tough enough to post

February 10, 2010 8:37 PM  
Blogger Knightmare said...

Zaux...that sounds so bad
i feel for you,man

and if i may ask,what caused this?(same to you Chris)

the wrost accident i have been in was last March.i was going thru an intersetion(with the green light) at about 75 kph and a truck (coming the other way) stoped right in front of me.both car and truck were writen off.everyone was OK cuz,let me tell you,in my case,those air bags really,really really work.

February 10, 2010 8:43 PM  
Blogger Zaux said...

Knightmare ... my problemresukted from prostate cancer ... I ignored the symptoms for way to long. Didn't go to a doctor for 40 years ... now I have 6 docs... and at one of them nearly every week ... but, I'm not complaining ... I'm still here ... just not quite as active :-)

February 10, 2010 8:46 PM  
Blogger Chris said...

Zaux. I knew you weren't well, but I had no idea it was that bad. I assume that's why you've got the time.

Ragknot. I've already excluded that approach.

February 10, 2010 8:48 PM  
Blogger Zaux said...

Knightmare ... check out Buying Flowers which was posted yesterday

February 10, 2010 8:49 PM  
Blogger Zaux said...

Chris ... huge benefit ... I haven't had to work since June :-)

February 10, 2010 8:50 PM  
Blogger Chris said...

I busted my leg doing a U-turn when running away from a wasp.

February 10, 2010 8:51 PM  
Blogger Knightmare said...

Zaux...Godspeed

i wish you well
i havn't many friends,but i consider you one of them

February 10, 2010 8:59 PM  
Blogger Zaux said...

Knightmare ... thanks buddy ...right back at ya!

February 10, 2010 9:10 PM  
Blogger Knightmare said...

Zaux

saw the "buying flowers"

LOL...but the really,me and Pequid are just friends

and she is mad at me for spilling so much beers on her

February 10, 2010 9:24 PM  
Blogger Ragknot said...

I think you would have to eliminate the ONE kg, then you could add a heavier one to reach 80 kg. But if the weight was an odd number, you would have to use weights that gave one KG above and one KG below and assume it was in between. But I have not figured out the four weights you
would need. I would guess that the heavy one would be 50 to 60 kg.

February 10, 2010 9:38 PM  
Blogger Ragknot said...

I'll use brute force to test it out.

February 10, 2010 9:40 PM  
Blogger Ragknot said...

2 6 18 54

The logic was not simple. I am now going to read the above

February 10, 2010 11:10 PM  
Blogger Ragknot said...

If that is right, I'll post the VBA,

If it's wrong, I'll get red faced.

February 10, 2010 11:12 PM  
Blogger Ragknot said...

Everyone gone to bed?
I need to also.
Here's my VBA
There are 4 weights; wt1,wt2,wt3.wt3

The a,b,c,d are modes for each weight. if a = -1 then the weight is negative (put on the opposite of the scale, if zero, not used, and if 1 then it's on the scale (not on the opposite side).. same for b,and d
I checked for a solution for all even weights. Example, if it is lighter than 42 and heavier than 40 then it must be 41 kg. But you can't arrange the scales for 41.

I didn't check the time, because I was printing the results on each pass, and it stops when a solution is found. But I would guess about 5 minutes to run, but an hour to assemble the program.


Sub test80kg()
Dim a, b, c, d, i As Integer
Dim wt1, wt2, wt3, wt4 As Integer
Dim works(80)
wt1 = 2
For wt2 = 4 To 80 Step 2
For wt3 = 4 To 80 Step 2
For wt4 = 4 To 80 Step 2
For i = 2 To 80 Step 2
GoSub testnum
Next i
For i = 2 To 80 Step 2
If works(i) = 0 Then
Exit For
End If
If i = 80 Then Stop
Next i
Next wt4
Next wt3
Next wt2

testnum:
works(i) = 0
For a = 0 To 2
For b = 0 To 2
For c = 0 To 2
For d = 0 To 2
test = wt1 * (a - 1) + wt2 * (b - 1) + wt3 * (c - 1) + wt4 * (d - 1)
'Debug.Print i, test, wt1; a - 1, wt2; b - 1, wt3; c - 1, wt4; d - 1
If test = i Then
Debug.Print i, wt1; wt2; wt3; wt4
works(i) = -1
End If
Next d
Next c
Next b
Next a
Return
End Sub

February 10, 2010 11:31 PM  
Anonymous Karl Sharman said...

Zaux, I feel for you! As I am on a different time zone, I always get to your batch of posts a little late, so I am only reading this in the morning as I am now at work.
Seems like we are all a bunch of knackered has-beens! I have a replaced knee joint after a motorbike accident. It squeaks in winter. Small price to keep the leg!

February 11, 2010 2:12 AM  
Blogger Zaux said...

Thanks Karl ...
I'm went from being a very active person to being very non-active ... but, there's usually some good in every bad situation. Became a vegetarian and lost 60lbs.... and I've not worked since June :-)
So all is not bad.

February 11, 2010 4:36 AM  
Blogger Chris said...

Ragknot is the winner. 2, 6, 18 and 54. They're exactly double
the weights that were used in the "40 in the balance" problem.

Using the weights you can make 2, 4 = (6-2), 6, 8, 10 = (18-6-2),
12 = (18-6), 14 = (18+2-6), 16 = (18-2), 18, 20 = (18+2) etc.

Now for the odd weights. Consider e.g. weighing 3kg. Compare
it with 2 kg and then with 4 kg. You'll see it's in between them,
so it must be 3 kg. etc.

February 11, 2010 5:04 AM  

Post a Comment

Links to this post:

Create a Link

<< Home