Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

import random import math z = 23086243 random.seed(23086243) t = random.uniform(

ID: 3732802 • Letter: I

Question

import random

import math

z = 23086243

random.seed(23086243)

t = random.uniform(0, 1)

print(t)

ching/2018/mad2502/hw/hw3.pdf Question 1. (2 points) Write a Python program to numerically approximate the value of where t is the random number generated previously Requirement: write a function with name "Approximate. Q1" ### Solution to Question 1 Your codes Hints: approximate its value by computing Vi, Vtt vi, Vi+ vit vi and successively You should not use the Python build-in command that computes the square root. Instead, use any algorithms/codes discussed in class to compute the square root. Note that (1) actually equals to + V41+1). Your approximation of (1) should be accurate up to tolerance 0.000001 (compared to 34t +1) 20 FS F4 F5 F7 F8 F9 F10 4 5 ok 6

Explanation / Answer

Here is the complete program. I have modified some of above code and implelemented Approximate_Q1 function

Sample output (t = 14)

Actual: 4.2749175288 , Expected: 4.27491721764, Difference: 3.11168349754e-07