brain teaser

This is a discussion on brain teaser within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I liked the heated up conversation we had about 'sinners and 7 days', so here's a little brain teaser of ...

  1. #1
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597

    brain teaser

    I liked the heated up conversation we had about 'sinners and 7 days', so here's a little brain teaser of my own...

    You want to measure the weight of any object between 1 and 40 pounds [1, 2, 3, ...39, 40, integers]. you're given a balance scale and you have to choose 4 weights to use. What would they be?

    one more thing, if you've seen this before, please PM me instead of just giving out the answer
    This is my signature. Remind me to change it.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    Well, just to spice things up for your brain teaser, I shall volunteer to be wrong again. As soon as I read this problem I thought: binary counting system. This is because you either have the weight or you don't (on or off).

    To have the scale read 1, the only weight that works is a 1lb one. Thus 1 must be one of four answers. (In my own mind anyway.) In fact the same logic follows for each power of two just like in binary counting. For 2lb must have 2lb, then three is covered because you have 1+2.....

    However this only gives us up to 15 pounds, not nearly the 40 so I'm way off. My guess is that the solution has to do with the fact that it is a balance scale, but maybe this is one for jasrajva (for I really ought to get back to work)..
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  3. #3
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597
    Hey, I tried to PM you but can't ge tthe name into the recepient box right.. what's with the box (the weird character?)
    This is my signature. Remind me to change it.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    eh? Box? I clicked my PM button and it worked for me... emailpikeknightataol.com
    Last edited by Justin W; 11-06-2001 at 10:06 AM.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  5. #5
    Registered User Natase's Avatar
    Join Date
    Aug 2001
    Posts
    123
    By four weights do you mean four different degrees of heaviness (allowed more than one of each)... or four weights in total?

    If its a balanced scale there is probably a combination of four different weights you can add to each side to make any number - 1 thru 40... I'll have to think about it. If this is the right track though, I think I'll need a limit, otherwise I'll just take 40 * 1 pound weights

  6. #6
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597
    you get 4 weights (4 objects with masses of integer values). You get to pick what they are.

    Ex. 1, 2, 3, 4

    or

    1, 10, 20, 40

    etc.

    You have to use these to weigh objects from 1 to 40 kg on a balance scale (the masses of the objects go 1, 2, 3, 4, 5... 40)

    I hope that clears it up
    This is my signature. Remind me to change it.

  7. #7
    Prisoner of my own mind
    Join Date
    Aug 2001
    Posts
    203
    Are we definately measuring integer masses\weights?
    How many measurements are we allowed to make to tell you the weight of things?
    Lead me not into temptation... I can find it myself.

  8. #8
    Registered User The15th's Avatar
    Join Date
    Aug 2001
    Posts
    125
    my cat's name's Mittens.

    (you all know you love Ralph.
    arrh, i got nothing good to say.
    http://www.praxis1.vic.edu.au/home/dcola/

  9. #9
    Registered User jasrajva's Avatar
    Join Date
    Oct 2001
    Posts
    99

    Red face

    the answer is
    3^0 = 1
    3^1 = 3
    3^2 = 9
    3^3 = 27

    1
    3 -1 = 2
    3 =3
    3 +1 = 4
    9 - 3 -1 = 5
    9 - 3 = 6
    9 + 1 - 3 = 7
    9 - 1 = 8
    9
    9 + 1 = 10
    9 + 3 - 1 = 11
    9 + 3 = 12
    9 + 3 +1 = 13


    27 - 9 - 3 - 1 = 14
    27 - 9 - 3 =15
    27 - 9 - 3 +1 = 16

    27 - 9 - 1 = 17
    27 - 9 = 18
    27 - 9 +1 =19
    27 - 9 + 3 - 1 = 20
    27 - 9 + 3 = 21
    27 - 9 + 3 +1 = 22
    27 - 3 - 1 = 23
    27 - 3 = 24
    27 - 3 + 1 = 25
    27 - 1 = 26
    27

    and so on

    im too bored to write the whole thing out

    Justin was partially correct abt the binary logic
    if we are only alloewd to add the weights then to measure all weights from 1 to x

    we need 2^0 , 2^ 1, 2^2, .... till 2^n where

    2^n < x < 2^(n+1)

    but if we can both add and subtract(ie place weights on either side of the balance then we need

    3^0 , 3^ 1, 3^2, .... till 3^n where

    3^n < x < 3^(n+1)


    i know a friend who has proved this but couldnt find him today

    no i didnt know the answer i just got it by chance when i was trying to figure out the same for 1..10 with three weights

    though i suspect there mite be more answers to this as if the problem is

    to measure 1..10 with three weights the choices are many

    1,3,9
    1,2,8
    1,3,7
    ....
    .etc

    ill try to prove the 3^n result tell me if anyone of you gets it first

    jv

  10. #10
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597
    good job!

    I'm still trying to figure out if there are any other possibilities besides the base 3 weights....
    This is my signature. Remind me to change it.

  11. #11
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    Ah yes, a balance scale. The weight can be on side A, B, or not placed on the scale at all. That looks like three states to me. Base 3 it is then. 1+3+9+27 = 40. Given the rules of base, all answers less than 40 to 0 are covered.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Brain teaser
    By medievalelks in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 04-24-2008, 06:23 PM
  2. Brain teaser #2
    By medievalelks in forum A Brief History of Cprogramming.com
    Replies: 22
    Last Post: 04-24-2008, 05:18 AM
  3. Found a Brain Teaser
    By golfinguy4 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-26-2004, 10:37 PM
  4. Re: Girlfriend Post
    By PsychoBrat in forum A Brief History of Cprogramming.com
    Replies: 57
    Last Post: 05-13-2002, 06:11 AM
  5. Brain Teaser...
    By Paro in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-01-2002, 11:30 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21