Results 1 to 4 of 4

Math Help - Algorithm for finding arrangement of 5 variables in eqn with +/- b/w to satisfy it

  1. #1
    Junior Member cupid's Avatar
    Joined
    Feb 2011
    Posts
    37

    Lightbulb Algorithm for finding arrangement of 5 variables in eqn with +/- b/w to satisfy it

    Hi all

    My friend gave me a riddle (very well known) in which I had to break a 40kg block in 4 pieces ( of integral weight) such that using all those pieces one can measure all weights in range 1 - 40 on a physical balance thingy (I hope that's what its called).

    Then we decided to make a python program for it, but we cant find any algorithm to arrange 4 weights (i, j, k, l) and a weight w in equation.

    We might be able to do it using regular expressions and built in eval() ... (we just started with the idea but, i feel very confident about it) but that feels like cheating ... or more like a walkthrough ...

    It'll be great if someone could point me to the right direction by telling me what kind of algo do stuff like this (not too complex maths please :P)

    Thanks in Advance

    ___________________
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Jun 2012
    From
    AZ
    Posts
    616
    Thanks
    97

    Re: Algorithm for finding arrangement of 5 variables in eqn with +/- b/w to satisfy i

    It's impossible. With four pieces you can make at most 2^4 = 16 different weights.

    However, if you are allowed to "subtract" weights (e.g. by using a balance scale and putting one weight on the opposite end) then it's possible. Use 1,3,9,27 kg. This turns out to be a problem involving base 3. Also, 1+3+9+27 = 40.
    Last edited by richard1234; August 21st 2012 at 10:31 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member cupid's Avatar
    Joined
    Feb 2011
    Posts
    37

    Re: Algorithm for finding arrangement of 5 variables in eqn with +/- b/w to satisfy i

    Hi
    Thanks for the quick reply

    I did mentioned "with +/- between them" in my Title (I am very bad at explaining my ideas to other people :P )

    -can you please explain me how to solve this problem using base 3.
    -And also how did you decided to use base 3
    -And also some explanation for base 3. I've only read base 10, 2, 8, 16

    I know It's a pretty long list so we should start by ME studying a bit more about all the points above. Could you give me links to pages where I can understand all these stuff better and then I'll come back here for more help

    Thanks for your time
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Jun 2012
    From
    AZ
    Posts
    616
    Thanks
    97

    Re: Algorithm for finding arrangement of 5 variables in eqn with +/- b/w to satisfy i

    Base 3 works because, for a weight X

    *add X
    *not use X
    *subtract X

    If you don't know what base 3 is, it works just like any other base.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: June 9th 2012, 09:13 AM
  2. Replies: 3
    Last Post: July 12th 2010, 06:38 AM
  3. Finding an ideal to satisfy an algebraic variety
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: March 2nd 2010, 10:57 AM
  4. Finding an ideal to satisfy an algebraic variety
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: March 2nd 2010, 10:57 AM
  5. Replies: 3
    Last Post: August 2nd 2009, 02:00 PM

Search Tags


/mathhelpforum @mathhelpforum