Use the bisection method to find the minimum of the function is $f(x)= 3x^2–4x+1$ over the interval $[0,2]$ . Determine the optimal value of $x$ within $5\%$ of the initial interval and How many function evaluations are needed to get within x* ± 0.001?
My attempt
The first iteration $a=0,b=2, m=(a+b)/2=1$
$f(a)=1, f(b)=5, f(m)=0$
$x^*=6x-4=0$
$x^*=2/3=0.6667$
I do not understand what the first part question is asking.Is it mean that I need to continue the evaluation until I find the value of $b-a$ is closed to $0.05$? After the 11 evaluations , I get $a=0.3321$ and $b=0.3341$.But $x*=0.6667$ instead of $0.3333$
Although it's an old question, I felt it merited a response.
Then answer Adrian is mixing two concepts - root finding using the bisection method, and minimisation.
However, for the minimisation, it would indeed depend on whether you chose the first $[a,m]$ or second $[m,b]$ interval to determine the minimum, but that is not directly related to whether the function changes sign in the numerical method, but whether the derivative changes sign, so one could indeed solve the derivative function for 0 using the bisection method, but that is not the question.
What is needed is to take both intervals $[a, m]$ and $[m,b]$ and then calculate the midpoints of those, lets call them $a_1$ and $b_1$. Then to determine the value of the function at these midpoints. If $f(a_1) < f(a)$ and $f(a_1) < f(m)$ then you replace $b$ by $m$, and go round the loop finding the midpoint of the interval $[a,a_1]$ and $[a_1,m]$ and so on.
If neither condition is true, then test for $f(b_1) < f(m)$ and $f(b_1) < f(b)$. If both of these are true, then set $a = m$ and start again.
If none of these conditions are true, then either:
i) the interval does not contain a genuine minima, only the extreme of the function at either $f(a)$ or $f(b)$ or:
ii) you minima happens to be m.
If your issue is ii) then starting again, with a slightly different interval would likely resolve this.
Technically, numerically simply solving $f'(x) = 0$ for $x = x_{min}$ and then evaluating $f''(x_{min})$ would give the solution, but that is not finding the minimum by the numerical method, that is solving for the root of the derivative.