Finding i Given F[i] for a Given Equation

  • Thread starter ged25
  • Start date
In summary, the given equation is a linear congruential random number generator and the value of i cannot be determined mathematically if only F[i] is given. However, using the recursive relation and Euler's theorem, it is possible to calculate possible values of i for a given F[i] if a and b are known.
  • #1
ged25
6
0
I have the following equation

F = (F[i-1] * a) % b,
F[0] = 1;

Values of a and b are given. My question is whether it is possible to mathematically determine the value of i if you are given F.
 
Mathematics news on Phys.org
  • #2
Well first of all, we would have to know what that means! In some computer languages "a % b" is used to mean "the integer part of a divided by b". Is that what you mean?

It looks to me like there are going to be some values of n so that [itex]F\ne n[/itex] for any i so if you mean "solve F= n", then in general there is no solution. Assuming that F is, in fact, some value of F, then you could use that recursive relation to keep calculating F[1], F[2], etc. until you finally get the given F.
 
  • #3
the F must obviously repeat after at most b steps, since there are at most b values F can have.

This is a Linear congruential random number generator, and you can find lots about them.
The general equation for such a generator is F = (F[i-1] * a + c) % b.

If you have c = 0, you get [tex] F \equiv F[0] a^i [/tex] (mod b)

If you want to calculate possible i's for an F, you'll need Eulers theorem:
If a and n are coprime then:

[tex] a^{\phi(n)} \equiv 1 [/tex] (mod n)

[itex] \phi(n) [/itex] is the totient function, the number of positive integers, less than n that are coprime to n.
 

FAQ: Finding i Given F[i] for a Given Equation

How do you find i given F[i] for a given equation?

The first step is to understand the given equation and identify the variable i. Then, substitute the value of F[i] into the equation and solve for i using basic algebraic manipulation.

What if the given equation involves complex numbers?

In this case, you can still use the same process of substitution and algebraic manipulation. However, you may need to use complex number operations such as conjugates and imaginary numbers in your calculations.

Can you give an example of finding i given F[i] for a given equation?

Sure, let's say the given equation is F[i] = 2i + 3. We can substitute F[i] with the given value, say F[i] = 7, and solve for i. Using basic algebra, we get i = 2.

Is there a specific method or formula for finding i given F[i] for a given equation?

No, there isn't a specific formula or method for this. It ultimately depends on the given equation and the variable i involved. However, the general process of substitution and algebraic manipulation can be applied.

What are the practical applications of finding i given F[i] for a given equation?

This process is commonly used in various fields of science, such as physics and engineering, to solve equations and determine the value of unknown variables. It is also useful in data analysis and mathematical modeling.

Back
Top