Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 12th, 2003, 03:22 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
Weighing Puzzle - Another Brain Exercise

All right folks, time for another puzzle to exercise your minds and test your ingenuity. You have a set of scales. You want to measure any weight from 1 to 40 kg.

1. What is the minimum # of weights you need, in order to do this?
2. What are the values of these weights?

I'll post the correct answer in a few days, if no one gets it by then

Reply With Quote
  #2  
Old February 12th, 2003, 03:32 PM
tony825 tony825 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Greece
Posts: 63 tony825 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Hint

I know the answer but im not going to write it, for now!

Ill let the others to find it,

Comment : the weights must be of integer values.

Hint : the same can be used IF You want to measure any weight from 1 to 81 kg.
__________________
No sign

Reply With Quote
  #3  
Old February 12th, 2003, 03:34 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
Good point tony, I forgot to mention that the weights must all be integer values (though this is more of a hint rather than a restriction)

Reply With Quote
  #4  
Old February 12th, 2003, 04:16 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
Q:
Could the problem be described also similar to "which base do you need for a numbering system that you could identify any value between 0 and 40 (39? - what about weighting a zero-weight? you did say "1-40") uniquely and how many digits would you need for an ideal solution?" (sorry for the bad english, hope you still understand my point...)

like for identifying 32 unique values, you can use a numbering system based on 2 with 5 digits (damn, i canī find the words...)
2log32-1=5 -> you would need 5 wages with values of 1 or 0. (Could one still optimize this? probably to a base of 4 or 8, eh?)

I can't make up any other equations for this. School is too long ago

Or am i on the totally wrong track?
Get me a hint please. I am really interested in the solution but i donīt want to break my brain on a "way to nowhere"...
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #5  
Old February 12th, 2003, 04:42 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
Well, you are sort of on the right track there. However you can do it with fewer weights than you're thinking

Reply With Quote
  #6  
Old February 12th, 2003, 04:52 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
do you need to be able to weight a zero-weight then or not?

Reply With Quote
  #7  
Old February 12th, 2003, 06:19 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
Nope, you don't weigh a 0 weight. You only need to weigh anything between 1 and 40 kg. (whole numbers only. you're not required to weigh something say 22.5 kg).

To clarify matters, click here to see what a balance scale looks like. Hopefully, this makes the problem clearer.

Reply With Quote
  #8  
Old February 13th, 2003, 06:39 AM
mathew mathew is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Slovak republic
Posts: 14 mathew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 27 sec
Reputation Power: 0
Send a message via ICQ to mathew
I got it

it could be done with 4 weights.
values are: 1, 3, 9 and 27.

btw. it took's me 15 minutes to solve this.

Reply With Quote
  #9  
Old February 13th, 2003, 09:19 AM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
Warning - discussion of the answer

Unless you can place weights on both sides of the balance, then the 4-weight solution above won't work. It can't measure something weighing 2kg. If you can't place weights on both sides of the balance, then you simply do base 2 to get the minimum number of weights to get the answer. I.e., 1, 2, 4, 8, 16, 32 - will weigh anything from 1 to 63 (which doesn't match the hint, so I've got a feeling it's not the correct solution) - using only one pan. But you know it's the minimum number because there's no duplication of combinations that produce the same weight, and taking away any of them would remove several possible weights.
__________________
Debian - because life's too short for worrying.
Best. (Python.) IRC bot. ever.

Reply With Quote
  #10  
Old February 13th, 2003, 12:37 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,507 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 7 m 35 sec
Reputation Power: 865
Mathew wins the virtual cigar. I didn't put any restrictions on using both sides of the balance . The answer is 4 weights -- 1kg, 3kg, 9kg and 27 kg. To elaborate on mathew's answer further --

For 1 kg - Put 1 kg on one pan
For 2 kg - Put 3 kg on one pan, 1 kg on the other pan
For 3 kg - Put 3 kg on one pan
For 4 kg - Put 3 kg and 1 kg on one pan
For 5 kg - Put 9kg on one pan, 3 and 1 kg on the other pan
...
For 40 kg - Put 1, 3, 9, 27 kg on one pan

Cheers!

Reply With Quote
  #11  
Old February 24th, 2003, 05:35 AM
Mincer's Avatar
Mincer Mincer is offline
.DOTTY
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: London
Posts: 206 Mincer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 51 sec
Reputation Power: 6
Re: Weighing Puzzle - Another Brain Exercise

Quote:
Originally posted by Scorpions4ever
You have a set of scales.


Then I'm most probably a fish. What would a fish be bothered about this problem for?

If I had a balance however....

__________________
Team Phoenix Rising - All Your Distributed Computing Are Belong To Us!

"Whoever fights monsters should see to it that in the process he does not become a monster."
- Friedrich Nietzsche
.

Reply With Quote
  #12  
Old March 8th, 2003, 05:16 PM
Jason Doucette's Avatar
Jason Doucette Jason Doucette is offline
jasondoucette.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada
Posts: 378 Jason Doucette User rank is Private First Class (20 - 50 Reputation Level)Jason Doucette User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 23 m 8 sec
Reputation Power: 6
Quote:
Originally posted by Strike
...If you can't place weights on both sides of the balance, then you simply do base 2 to get the minimum number of weights to get the answer. I.e., 1, 2, 4, 8, 16, 32 - will weigh anything from 1 to 63 (which doesn't match the hint, so I've got a feeling it's not the correct solution) - using only one pan. But you know it's the minimum number because there's no duplication of combinations that produce the same weight, and taking away any of them would remove several possible weights.
In fact (assuming again that you cannot use both sides of the scale), you can remove weight 1kg, since you only need to weigh 1, 2, 3 .. 40kg (integer amounts). Without the 1kg weight, you can determine any weight that is a multiple of 2. Since there exists only one possible weight that cannot be weighed exactly between each possible weighing of an exact number, then you can determine these weights. For example, if you have a mass of 5kg, then you can determine that it weights more than 4kg, and less than 6 kg. There is only one possibility: 5kg.

Last edited by Jason Doucette : March 8th, 2003 at 05:18 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Weighing Puzzle - Another Brain Exercise


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off