Question 1: 25 Marks
Consider the function
(0) =6°+20>—30—1.
(1.1) Give an algorithm for halving the interval(Bisection). (10)
(1.2) Use the bisection method to determine a root of f(#) in the interval [1.00000,2.00000], (10)
using a tolerance value of up to five significant figures. Limit your iterations to 5.
(1.3) Plot the function f(#), and indicate where the root you determined is to located. (5)
Question:
Question 1: 25 Marks
Consider the function
(0) =6°+20>—30—1.
(1.1) Give an algorithm for halving the interval(Bisection). (10)
(1.2) Use the bisection method to determine a root of f(#) in the interval [1.00000,2.00000], (10)
using a tolerance value of up to five significant figures. Limit your iterations to 5.
(1.3) Plot the function f(#), and indicate where the root you determined is to located. (5)
This is AI generated Response.
Asked by: gorle prasanth
Created at: 2025-06-24 01:34:17
Final Answer:
RenderedRaw Text
Did you like this answer?
Let's break down the solution step-by-step for each part of the question:
---
### (1.1) Algorithm for Halving the Interval (Bisection Method) **[10 marks]**
#### **Step-by-Step Algorithm:**
1. **Input:** Function \( f(\theta) \), interval \([a, b]\), and tolerance \( \epsilon \).
2. **Check:** Ensure \( f(a) \) and \( f(b) \) have opposite signs (i.e., \( f(a) \cdot f(b) < 0 \)), indicating a root exists in \([a, b]\).
3. **Repeat up to max iterations or until the interval is within tolerance:**
- Calculate midpoint: \( c = \frac{a + b}{2} \)
- Evaluate \( f(c) \)
- If \( |f(c)| < \epsilon \) or \( (b-a)/2 < \epsilon \):
- **Stop:** \( c \) is the root (within tolerance)
- Else:
- If \( f(a) \cdot f(c) < 0 \):
- Set \( b = c \) (root is in left half)
- Else:
- Set \( a = c \) (root is in right half)
4. **Output:** Approximate root \( c \)
---
### (1.2) Apply Bisection Method to \( f(\theta) = \theta^3 + 2\theta^2 - 3\theta - 1 \), interval \([1, 2]\) **[10 marks]**
#### **Given:**
- Initial interval: \([a, b] = [1.00000, 2.00000]\)
- Tolerance: Up to five significant figures
- Max iterations: 5
#### **Iterations Table:**
Let’s denote \( f(\theta) = \theta^3 + 2\theta^2 - 3\theta - 1 \).
| Iteration | \( a \) | \( b \) | \( c \) (midpoint) | \( f(a) \) | \( f(c) \) | Sign Change | New Interval |
|-----------|------------|------------|--------------------|------------|------------|-------------|--------------|
| 1 | 1.00000 | 2.00000 | 1.50000 | \(-1\) | \(2.125\) | \(-1 \cdot 2.125 < 0\)? No | [1.5, 2.0] |
| 2 | 1.00000 | 1.50000 | 1.25000 | \(-1\) | \(0.328\) | \(-1 \cdot 0.328 < 0\)? No | [1.25, 1.5] |
| 3 | 1.00000 | 1.25000 | 1.12500 | \(-1\) | \(-0.404\) | \(-1 \cdot -0.404 > 0\)? Yes | [1.0, 1.125] |
| 4 | 1.12500 | 1.25000 | 1.18750 | \(-0.404\) | \(-0.053\) | \(-0.404 \cdot -0.053 > 0\)? Yes | [1.125, 1.1875] |
| 5 | 1.18750 | 1.25000 | 1.21875 | \(-0.053\) | \(0.137\) | \(-0.053 \cdot 0.137 < 0\)? No | [1.1875, 1.21875] |
**Note:** The actual function values should be calculated for each midpoint for accuracy (shown approx above).
**Root after 5 iterations:** Approximate root \( \theta \approx 1.1875 \) (or midpoint of last interval).
---
### (1.3) Plot the Function \( f(\theta) \) and Indicate the Root **[5 marks]**
You can plot using Python, MATLAB, or manually sketch. Here’s how you can do it in Python (matplotlib):
```python
import numpy as np
import matplotlib.pyplot as plt
# Define the function
def f(theta):
return theta**3 + 2*theta**2 - 3*theta - 1
# Create theta values
theta = np.linspace(0, 2.5, 400)
y = f(theta)
# Plot the function
plt.figure(figsize=(8,5))
plt.plot(theta, y, label='$f(\\theta)$')
plt.axhline(0, color='black', linewidth=0.7)
plt.axvline(1.1875, color='red', linestyle='--', label='Approx. root')
plt.xlabel('$\\theta$')
plt.ylabel('$f(\\theta)$')
plt.legend()
plt.title('Plot of $f(\\theta)$ with Root Indicated')
plt.grid(True)
plt.show()
```
**On the plot:** Mark the vertical line at \( \theta \approx 1.1875 \) to indicate the root found.
---
### **Summary Table for Submission:**
- **1.1:** Algorithm steps (as above)
- **1.2:** Bisection method table, root after 5 iterations
- **1.3:** Plot with root indication
Let me know if you need the actual function values for each iteration or want the Python code output!
VIPSolutions focuses on clear, step‑by‑step explanations so you can learn quickly. Whether you need an AI‑generated walkthrough or a short hint to get unstuck, each solution is organized for fast reading and easy review later.
Search similar questions, compare approaches, and bookmark the best answers for revision. Our goal is simple: quick, reliable study help that feels natural—not noisy.