Finding the variable of the equation?

  • Thread starter sunmaungoo
  • Start date
  • Tags
    Variable
In summary: The function takes a string and turns it into a number in a particular base. This number can then be used to solve equations or do other mathematical operations.
  • #1
sunmaungoo
6
0
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.
 
Physics news on Phys.org
  • #2
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
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
No worries: just post the function definition here and I will run through it with you.
 
  • #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:
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:
  • #6
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
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.
 

FAQ: Finding the variable of the equation?

1. What is a variable in an equation?

A variable in an equation is a symbol that can take on different values and is used to represent an unknown quantity. It is usually represented by a letter, such as x or y.

2. How do I identify the variable in an equation?

The variable in an equation is usually the letter that is not a constant or a known value. It is the symbol that can vary and is often found on one side of the equal sign.

3. Why is finding the variable important in an equation?

Finding the variable in an equation allows you to solve for the unknown quantity and understand the relationship between different variables in the equation. It is crucial in problem-solving and making predictions in various fields of science.

4. What are some strategies for finding the variable of an equation?

One strategy is to look for any known values or constants in the equation and then identify the remaining symbol as the variable. Another approach is to rearrange the equation to isolate the variable on one side of the equal sign.

5. Are there different types of variables in an equation?

Yes, there are independent and dependent variables in an equation. Independent variables can be changed or manipulated, while dependent variables are affected by the independent variables and their values are determined by the values of the independent variables.

Similar threads

Replies
1
Views
741
Replies
30
Views
3K
Replies
3
Views
1K
Replies
5
Views
1K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
1
Views
712
Back
Top