How can I solve a^i=b in Objective C?

  • Thread starter Thread starter rhenretta
  • Start date Start date
  • Tags Tags
    Algebra
AI Thread Summary
To solve the equation a^i = b in Objective C, where a = 2^(1/12), logarithms are needed. The solution involves using the formula i = log_a(b), which can be expressed as i = ln(b) / ln(a) using natural logarithms. Since Objective C only supports logarithms for bases 2, 10, and e, the natural logarithm can be calculated using the log function. This approach allows for the computation of i effectively. Understanding the relationship between logarithms and exponentials is crucial for solving this problem.
rhenretta
Messages
65
Reaction score
0
My math skills are failing me, and I was hoping one of you could help me with this real quick..

I need to solve for i:
a^{i}=b

a in this case is based on the interval in the musical scale, so
a = 2^{\frac{1}{12}}

I have to solve this in objective c, and apparently it doesn't let me solve logarithms except for bases 2, 10, and e
 
Mathematics news on Phys.org
rhenretta said:
My math skills are failing me, and I was hoping one of you could help me with this real quick..

I need to solve for i:
a^{i}=b

a in this case is based on the interval in the musical scale, so
a = 2^{\frac{1}{12}}

I have to solve this in objective c, and apparently it doesn't let me solve logarithms except for bases 2, 10, and e

Hey rhenretta.

This kind of problems what is called logarithms. Basically logs and exponentials are inverses in that log(e^x) = x and e(log(x)) = x for valid x's. So we have:

log_a(a^{i}) = log_a(b) gives us
i = log_a(b) = \frac{ln(b)}{ln(a)}

where ln(x) is the natural logarithm function.
 
Thanks chiro :)
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top