Results 1 to 3 of 3
Like Tree1Thanks
  • 1 Post By chiro

Math Help - Reversing an calculation

  1. #1
    Newbie
    Joined
    Aug 2013
    From
    New Zealand
    Posts
    2

    Reversing an calculation

    Hello.

    I've ran into a problem reversing a calculation I'm doing. I'm not sure if this is solvable but I figure if there's a way to move forward there must be a way to move backwards too.

    here are the constraints
    b1=1+v4, b2=1+v3, b3=1+v2, b4=1+v1,
    if b1=b4 then b4=0
    if b1=b3 then b3=0
    if b1=b2 then b2=0
    if b2=b4 then b4=0
    if b2=b3 then b3=0
    if b3=b4 then b4=0

    So say for example I started with
    v4 = 70
    v3 = 00
    v2 = 00
    v1 = 00

    b1 = v4 + 1 = 70 + 1 = 71
    b2 = v3 + 1 = 01
    b3 = v2 + 1 = 01
    b4 = v1 + 1 = 01

    Now b2 = b3 = b4 so b3 and b4 now = 00

    So results for the calculation is b1 = 71, b2 = 01, b3 = 00, b4 = 00.

    The problem sets in when I need to reverse this. assuming I have no other information except the end value of b1 = 71, b2 = 01, b3 = 00, b4 = 00

    now b1 - 1 = v4
    v4 = 71 - 1 = 70

    if b2 = 0 then b2 must be = to b1, b2 is not 0, therefore b2 -1 = v3, 01 -1 = 00 = v3.

    So far so good nothing complicated but then..

    when I get to b3 and b3 = 00, for b3 to = 00 either b1 = b3, or b2 = b3, therefore v2 is either 70 or 00 and this is where I'm stuck

    what I need is to reverse it back into its original form of 70 00 00 00 (assuming I don't know what the original form looks like) but since starting from b3 onwards there's more than 1 answer I'm completely stuck. also consider than b4 is also dependent on b3.

    additional information include that

    there can't be b2 if b1 is 0
    there can't be a b3 if b2 is 0
    there can't be b4 if b3 is 0

    ie it's hierarchical.

    any help would be much appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,607
    Thanks
    591

    Re: Reversing an calculation

    Hey Lilstormcloud.

    Because you have multiple conditions that can be met, it means that if you meet multiple conditions then you will set multiple things to zero and thus lose information.

    If you want to avoid this you will need to restrict the number of zeroing operations to such that you can actually reverse the computation.

    This will involve looking at all combinations of zero operations and structuring the if statements so that the maximum number of zero operations for a given permutation is set. Otherwise you will lose information.
    Thanks from Lilstormcloud
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2013
    From
    New Zealand
    Posts
    2

    Re: Reversing an calculation

    Cool Thanks, I thought as much. the problem is those constraints weren't set by me I actually just use them to convert an ID into a usable format then use it to match and retrieve another set of IDs which I then have to convert back in order to use. I guess more information is required so I'll go digging around and perhaps find out why those conditions are required, perhaps the total of v1+v2+v3+v4 has to equal some predefined maximum number. In any case I really appreciate the fast reply, thanks .

    anyone know how I change this thread to [solved]?
    Last edited by Lilstormcloud; August 24th 2013 at 04:13 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Looking for help on reversing a limit?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 14th 2012, 09:25 PM
  2. Reversing A Formula
    Posted in the Algebra Forum
    Replies: 4
    Last Post: August 4th 2009, 07:07 AM
  3. Reversing an equation
    Posted in the Advanced Applied Math Forum
    Replies: 4
    Last Post: January 17th 2008, 06:11 AM
  4. percentages and reversing them
    Posted in the Algebra Forum
    Replies: 5
    Last Post: December 10th 2007, 06:03 PM

Search Tags


/mathhelpforum @mathhelpforum