Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finding the variable of the equation?

  1. Jul 31, 2012 #1
    I was just wondering if it is possible to find b in this equation?


    where y=f(a,b).

    so the I guess f(x,f(a,b))=result.

    I know the actual value of x,a and result and it is possible to find b in the equation.

    I also know the function of f().

    Please ask me if this is the question is not clear and this is not a homework question.
  2. jcsd
  3. Jul 31, 2012 #2


    User Avatar
    Science Advisor

    Hey sunmaungoo and welcome to the forums.

    It should be possible to use what is known as a root finding algorithm to get an approximation at the very least for the value of b (possibly many solutions depending on the definition of f).

    The idea is the same for example trying to solve x^7 + xSQRT(x) + e^-x + 34 = 0 where we need to find x: in these kinds of problems, we use a computer algorithm to get a good enough approximation.

    Are you familiar with these kinds of methods?
  4. Jul 31, 2012 #3
    unfortunately chiro,I am not familiar of these kind of methods.To be honest,I does not take math major.The exponent (e) is the exponent of 10,2 ? Thank for taking your time answering to this thread.
  5. Jul 31, 2012 #4


    User Avatar
    Science Advisor

    No worries: just post the function definition here and I will run through it with you.
  6. Aug 31, 2012 #5
    It is actually a programming thing but I translated into the Mathematics so I don't know if it ok to post it here goes.I think this thread should be moved to a programming topic section.

    Code (Text):

    string str="5YD6ZNFC"

    bool result=(Method1(tempIntArray,Method1(temp2.ToArray(),str))==Method1(tempIntArray,text));

    string Method1(int [] array,string text)
    string result;

    int num=0;

    for(int i=0;i<text.Length;i++)
    int num2=(int)(text[i]-'0');

    num2=(num2+array[num] /new Int) * (array[num+1]/tempInt);




    return result;

    string Method2(string text)
    int num=text.Length/2;

    string text2=text.Substring(0,num);

    string text3=text.Substring(num);

    string text4;

    int num2=0;

    while(num2<text2.Length && num2 <text3.Length)
    int num3=(int)(text2[num2]-'0');

    int num4=(int)(text3[num2]-'0';

    return text4;

    Last edited: Aug 31, 2012
  7. Aug 31, 2012 #6


    User Avatar
    Science Advisor

    When you deal with strings, the best way IMO to deal with this in general is to treat the string as a number in some base.

    If you have a string and each character has b possibilities then you can write a string as number by using X = x0 + b*x1 + b^2*x2 + b^3*x3 + ... + b^n*xn.

    Once you have this you can convert your computer code into a mathematical kind of relationship in which you can look at the problem in terms of using a root finding algorithm for the variables that are free.

    It looks like your routine actually takes the string and converts it to a plain number (not in the same way I have done though) but it doesn't make sense because you have variables that I can't make sense of.

    Can you explain in simple terms what your function actually does?
  8. Aug 31, 2012 #7
    It has something to do with cryptography.I think it would be a best method to encode a sensitive message.I know there are a lot of better way to archive it but I particular want to know this algorithm because I wanted to treat it as a learning experience for my future complex development project.So basically it is for education purpose.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook