Question: Give the best lower bound that you can for the following code fragment, as a function of the initial value of n. while (n >
Give the best lower bound that you can for the following code fragment, as a function of the initial value of n.
while (n > 1)
if (ODD(n))
n = 3 * n + 1;
else n = n / 2;
Do you think that the upper bound is likely to be the same as the answer you gave for the lower bound?
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
This is a very famous number sequence called the 3n1 conjecture or Collatz conjecture ... View full answer
Get step-by-step solutions from verified subject matter experts
