Repeated division until the result is greater than a given number I have a problem of repeated multiplication with a fraction (strictly less than 1), until the result is greater than a given number. For example: Let's say the given two numbers are 3 and 1.5. We have to multiply 3 repeatedly with 0.667 (say) until the result is greater than 1.5 3 * 0.667 = 2.001 2.001 * 0.667 = 1.33 (which is less than 1.5) So the number of multiplications we made is 1 before we hit a number less than 1.5. Instead of brute-forcing the solution(the number of times we are able to multiply), is there a way that we can find it in a better way?

ubumanzi18

ubumanzi18

Answered question

2022-09-10

Repeated division until the result is greater than a given number
I have a problem of repeated multiplication with a fraction (strictly less than 1), until the result is greater than a given number.
For example: Let's say the given two numbers are 3 and 1.5. We have to multiply 3 repeatedly with 0.667 (say) until the result is greater than 1.5
3 0.667 = 2.001
2.001 0.667 = 1.33 (which is less than 1.5)
So the number of multiplications we made is 1 before we hit a number less than 1.5. Instead of brute-forcing the solution(the number of times we are able to multiply), is there a way that we can find it in a better way?

Answer & Explanation

cerfweddrq

cerfweddrq

Beginner2022-09-11Added 15 answers

Basically you want n such that
a b n = c
Take logarithms and get
n = log ( c ) log ( a ) log ( b )
So, if
a b n < c n = log ( c ) log ( a ) log ( b )

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?