Results 1 to 5 of 5

Math Help - [SOLVED] Need help...is there an equation to solve this easily?

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    5

    Question [SOLVED] Need help...is there an equation to solve this easily?

    I'm new to this site, and I apologize if I've put this question in the wrong forum, but I really wasn't sure where it should go. This is not for a class.
    ...
    So, right now I'm stuck with guess & check for this, unless someone knows a formula I can use.

    I have the following equation:
    A1+2B+C4+D8+E16+F32 = X

    X is given. It is one value out of the set {1,2,3...63)

    A,B,C,D,E,F can only be 0 or 1.

    Is there a way to solve for A through F? There is only one right answer per value of X. For example, If X=1, then A=1 and B through F=0. Or, If X=3 then A=1, B=1, and C through F=0.

    Having an equation to solve this will make this a lot simpler for me than creating a table of all 63 possibilities (64 if you include X=0).

    Thanks!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Behold, the power of SARDINES!
    TheEmptySet's Avatar
    Joined
    Feb 2008
    From
    Yuma, AZ, USA
    Posts
    3,764
    Thanks
    78
    Quote Originally Posted by elleg View Post
    I'm new to this site, and I apologize if I've put this question in the wrong forum, but I really wasn't sure where it should go. This is not for a class.
    ...
    So, right now I'm stuck with guess & check for this, unless someone knows a formula I can use.

    I have the following equation:
    A1+2B+C4+D8+E16+F32 = X

    X is given. It is one value out of the set {1,2,3...63)

    A,B,C,D,E,F can only be 0 or 1.

    Is there a way to solve for A through F? There is only one right answer per value of X. For example, If X=1, then A=1 and B through F=0. Or, If X=3 then A=1, B=1, and C through F=0.

    Having an equation to solve this will make this a lot simpler for me than creating a table of all 63 possibilities (64 if you include X=0).

    Thanks!
    If I am understanding this correctly

    You want to know how many solutions there are to the eqution

    A+2B+4C+8D+16E+32F=X where X=1...63

    This equation is just like binary numbers

    2^0A+2^2B+2^2C+2^3D+2^4E+2^5F=X

    The expression of numbers is Binary is unique so there is only one solution for each X.

    I hope this helps
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2009
    Posts
    5
    You're right. I was thinking of A through F as booleans, but rather than true-false they are 1 or 0, so yes, binary numbers.

    My problem is that I'm not sure how to solve that equation. It's been years since I had to deal with binary numbers. I'm currently googling binary/boolean equations, binary/boolean algebra, etc. to see if I can find an answer.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,561
    Thanks
    785
    Any number from 0..63, when it is converted into binary, can be written using 6 binary digits. In fact, there is a bijection between the set X={0,...,63} and the set Y={(A,B,C,D,E,F) | each of A,...,F is 0 or 1}. This means that there are two mutually inverse functions f: X -> Y and g: Y -> X. The function g(A,B,C,D,E,F) is in fact given by the formula A+2B+4C+8D+16E+32F. The function f is the one that converts decimal into binary. So, given n in X, to find the solution to the equation A+2B+4C+8D+16E+32F = n you calculate f(n). This is the only solution because f and g constitute a 1-1 correspondence.

    I may have described it a little too heavily; the intuitive idea is simpler than this.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Dec 2009
    Posts
    5
    Awesome...that just clicked for me.

    So, basically, my variables A,B,C,D,E,F actually make up the positions of the base 2 version of my base 10 variable X.

    Thus
    If X=1 Then:
    FEDCBA
    000001
    (A=1, All others=0)

    If X=2 Then:
    FEDCBA
    000010
    (B=1, All others=0)

    If X=3 Then:
    FEDCBA
    000011
    (A=1,B=1, All others=0)

    So, all I have to do is convert X to base 2, and then use each position of the base 2 number.

    Thanks!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] solve the equation
    Posted in the Algebra Forum
    Replies: 5
    Last Post: February 4th 2010, 02:22 PM
  2. [SOLVED] How to solve this equation?
    Posted in the Algebra Forum
    Replies: 5
    Last Post: July 1st 2009, 05:38 AM
  3. [SOLVED] Solve the equation
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: January 30th 2009, 06:00 AM
  4. [SOLVED] solve equation
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: December 15th 2008, 03:49 PM
  5. [SOLVED] [SOLVED] Can Generating Functions be easily explained?
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: December 13th 2007, 06:57 AM

Search Tags


/mathhelpforum @mathhelpforum