# Finding the variable of the equation?

1. Jul 31, 2012

### sunmaungoo

I was just wondering if it is possible to find b in this equation?

f(x,y)=result.

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. Jul 31, 2012

### chiro

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?

3. Jul 31, 2012

### sunmaungoo

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.

4. Jul 31, 2012

### chiro

No worries: just post the function definition here and I will run through it with you.

5. Aug 31, 2012

### sunmaungoo

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);

str+=num2.ToString();

num++;
}
if(num>array.Length-2)
{
num=0;
}

result=Method2(Method2(Method2(str)));

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';

text4+=(num3+num4).ToString();
}
return text4;
}

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

### chiro

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?

7. Aug 31, 2012

### sunmaungoo

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.