Give the most compact theta notation for the number of times the statement
x = x + 1 is executed in the following pseudo-code:
for i = 1 to i = 3n − 1{
for j = 1 to j = n{
x = x + 1
}
}
2. a) Find by Newton’s method the roots of the following equations correct to three places of
decimals.
i) log .4 772393 x 10 x = near x = 6 .
ii) f (x) = x − 2sin x near x = 2 .
Draw a flowchart that reads the names , sex and score of each student and outputs the names of the male students that scored above 75% and how many they are?
For the given functions f (x), let x0 = 0, x1 = 0.6, and x2 = 0.9. Construct interpolation polynomials
of degree at most one and at most two to approximate f (0.45), and find the absolute error.
a. f (x) = cos x