CLL113 Quiz 1 Solution
CLL113 Quiz 1 Solution
CLL113 Quiz 1 Solution
Answer:
Answer: b
Explanation: If a function is real and continuous in the region from a to b and f(a) and f(b)
and if both have different signs then there is at least one real root between a and b. This is
because the function has to cross the x-axis at least once.
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Answer:
Answer: b
Explanation: Iterative formula for Newton Raphson method is given by
x(1)=x(0)+𝑓(𝑥(0))𝑓′𝑥(𝑥(0)).
Hence x0=2 (initial guess), f(x0)=8 and f’(x0)=12.
Substituting the values in the equation we get x1=1.33
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Answer:
Answer: a
Explanation: The Iterative formula for a Secant Method is given by
x(n+1)=𝑥(𝑛−1)𝑓[𝑥(𝑛)]−𝑥(𝑛)𝑓[𝑥(𝑛−1)][𝑓[𝑥(𝑛)]−𝑓[𝑥(𝑛−1)]]
Since there are 2 points considered in the Secant Method, it is also called 2-point method.
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Q: Secant method converges faster than Bisection method.
a) True
b) False
Answer:
Answer: a
Explanation: Secant method converges faster than Bisection method. Secant method has a
convergence rate of 1.62 where as Bisection method almost converges linearly.
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Q: The Bisection method is also known as ___________________
a) Binary Chopping
b) Quaternary Chopping
c) Tri region Chopping
d) Hex region Chopping
Answer:
Answer: a
Explanation: Bisection Method is also called as Binary Chopping. It is a method involving
the division of the interval into half.
Q: Solve this system of equations and comment on the nature of the solution using Gauss
Elimination method.
x+y+z=0
-x – y + 3z = 3
-x – y – z = 2
a) Unique Solution
b) No solution
c) Infinitely many Solutions
d) Finite solutions
Explanation: By Gauss Elimination method we add Row 1 and Row 3 to get the following
1 1 1 𝑥 0
matrix: [−1 1 3] [𝑦] = [3]
0 0 0 𝑧 2
Q: The elimination process and reduced form of the Matrix in Gauss Elimination method is
respectively known as:
a) Backward Elimination and Column Echelon Form
b) Sideways Elimination and Row-Column Echelon Form
c) Crossways Elimination and Column-Row Echelon Form
d) Forward Elimination and Row Echelon Form
Q: Starting with initial approximation of values x=y=z=0, what will be the next value of x in
the following set of simultaneous equations with gauss elimination method?
27x + 6y – z = 81,
6x + 15y + 2z = 75,
x + y + 50z = 110
a) 2.25
b) 3.0
c) 3.25
d) 4.0
Answer: b) 3.0
Q: What will be the appropriate C codes for Gauss Elimination & Back Substitution.
a) if(i!=j)
{
ratio = a[j][i]/a[i][i];
for(k=1;k<=n+1;k++)
{
a[j][k] = a[j][k] - ratio*a[i][k];
b) ratio = a[j][i]/a[i][i];
for(k=1;k<=n+1;k++)
{
a[j][k] = a[j][k] - ratio*a[i][k];
}
c) for(i=n-1;i>=1;i--)
{
x[i] = a[i][n+1];
for(j=i+1;j<=n;j++)
{
x[i] = x[i] - a[i][j]*x[j];
}
x[i] = x[i]/a[i][i];
}
d) for(i=n-1;i>=1;i--)
{
x[i] = a[i][n+1];
for(j=i+1;j<=n;j++)
{
x[i] = x[i] - a[j][i]*x[j];
}
x[i] = x[i]/a[i][i];
}
Answer: b & c.
Q: Solve the following equations by Gauss Elimination Method.
x+4y-z = -5
x+y-6z = -12
3x-y-z = 4
Q: Using the given expansion of 𝑒 𝑥 for x=1, evaluate the true percent relative error and
approximate percent error:
𝑥
𝑥2 𝑥3
𝑒 = 1 + 𝑥 + + +. ..
2! 3!
Given; True value of 𝑒 = 2.718282, use the first 6 terms
a) 𝜀𝑡 = 0.054949 and 𝜀𝑎 = 0.406760
b) 𝜀𝑡 = 0.059449 and 𝜀𝑎 = 0.306736
c) 𝜀𝑡 = 0.059449 and 𝜀𝑎 = 0.307636
d) 𝜀𝑡 = 0.054994 and 𝜀𝑎 = 0.356760
Solution: b
Value using 6 terms = 2.716666
Value Using 5 terms = 2.708333
True value = 2.718282
𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒−𝑉𝑎𝑙𝑢𝑒 𝑜𝑏𝑡𝑎𝑖𝑛𝑒𝑑 𝑢𝑠𝑖𝑛𝑔 6 𝑡𝑒𝑟𝑚𝑠
➔ True percent relative error = 𝜀𝑡 = ∗ 100% =
𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
2.718282−2.716666
∗ 100% = 0.059449
2.718282
𝐶𝑢𝑟𝑟𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛−𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
➔ Approximate percent error = 𝜀𝑎 = ∗
𝐶𝑢𝑟𝑟𝑒𝑛𝑡 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
2.716666−2.708333
100% = ∗ 100% = 0.306736
2.716666
Q: On a hypothetical decimal computer with 5 digit mantissa and 1 digit exponent, operate
the following:
0.12472 ∗ 10−3 ∗ 0.74259 ∗ 102
a) 9.21656*10−1
b) 9.26158*10−2
c) 9.26156*10−2
d) 9.26158*10−3
Solution: d
On multiplication we get, 0.00926158248; which is 9.26158*10−3 by chopping off the extra
digits.
Q: For a 8 bit binary computer with 4 bits for mantissa, 1 bit for number sign, 3 bits for
exponent and 1 bit for exponent sign find the statements that are not true?
a) Largest number that can be stored is 102
b) Increasing the number of bits for exponent will decrease the smallest number
that can be stored
c) Smallest positive number that can be stored is 0.0039
d) Increasing the number of bits for mantissa will decrease the smallest number
that can be stored
Solution: a & d
➔ The largest number for the following system will be
0 0 1 1 1 1 1 1 1
Magnitude of mantissa: (2−1 ∗ 1) + (2−2 ∗ 1) + (2−3 ∗ 1) + (2−4 ∗ 1) =0.9375
Magnitude of exponent: (22 ∗ 1) + (21 ∗ 1) + (20 ∗ 1)= 7
Number obtained will be: 0.9375 × 27 = 120
Q: Which of the following is not a sufficient condition for infinite solutions of a system of
linear equations in two variables?
𝑎11 𝑥 + 𝑎12 𝑦 = 𝑏1
𝑎21 𝑥 + 𝑎22 𝑦 = 𝑏2
a) Det ([A])=0
b) Rank {[A|B]} = Rank {[A]} <2
c) Graph of the two equations is collinear
d) None of the above
Solution: a
Determinant being zero doesn’t guarantee infinite solutions as the conditions also hold for the
case of no solutions.
Quotient Remainder
803/3 267 2
267/3 89 0
89/3 29 2
29/3 9 2
9/3 3 0
3/3 1 0
1/3 0 1
Q: Given a small square matrix with n=13, compute the ratio of floating point operations per
second involved in the back substitution step of using gauss elimination to solve a set of
equations to the total floating point operations per second. (Gauss Elimination)
Solution: FLOPS due to back substitution = n^2
1. 0.896
2. 0.104
3. 0.448
4. 0.552
Q: Given a small square matrix with n=17, compute the ratio of floating point operations per
second involved in the elimination step of using Thomas algorithm to solve a set of equations
to the total floating point operations per second. (Thomas)
1. 0.744
2. 0.256
3. 0.372
4. 0.628
Q: Solve the following set of questions using iterative method of Gauss Seidel Method with
initial guess as (0,0,0). Calculate number of iterations required until two successive iterations
are identical when rounded to three significant digits.
5x-2y+3z=-1
-3x+9y+z=2
2x-y-7z=3
Solution :-
5x-2y+3z=-1
-3x+9y+z=2
2x-y-7z=3
yk+1=1/9(2+3xk+1-zk)
zk+1=1/-7(3-2xk+1+yk+1)
Iteration x y z
1 -0.2 0.1556 -0.5079
2 0.167 0.3343 -0.4286
3 0.1909 0.3335 -0.4217
4 0.1864 0.3312 -0.4226
5 0.1861 0.3312 -0.4227
1. 4
2. 5
3. 3
4. 6
20x + y – 2z = 17
3x + 20y – z = -18
2x – 3y + 20z = 25
Solution :
x = 1/20 (17 – y +2z)
y = 1/20 (-18 -3x + z)
z = 1/20 (25 -2x +3y)
2. x = 1/3 (-18-20y+z)
y = -1/3 (25-20z-2x)
z = -1/2 (17-20x-y)
3. Cannot find solution. Divergent
4. x = 1/2(25-20z+3y)
y = 17+2z-20x
z = -1(-18-20y-3x)
𝑑2 𝑇
– 0.15T = 0
𝑑𝑥 2
𝑇(0) = 𝑇1 = 240
𝑇(10) = 𝑇2 = 150
Obtain a tridiagonal matrix (suitable for numerical solution) for a wire of L=10-m length. Use
n = 6 i.e. there exist 6 temperatures [T1, T2, T3, T4, T5, T6] .
Solution =
Using BCs,
r1 = 1 , r2 = 1 , r3 = 1
p2 = 1 , p3 = 1 ,p4 = 1
s1 = -240 , s2 = 0 , s3 = 0 , s4 = -150
r1 = 1 , r2 = 1 , r3 = 1
p2 = 1 , p3 = 1 ,p4 = 1
s1 = -240 , s2 = 0 , s3 = 0 , s4 = -150
r1 = 1 , r2 = 1 , r3 = 1
p2 = 1 , p3 = 1 ,p4 = 1
s1 = -150 , s2 = 0 , s3 = 0 , s4 = -240
p2 = 1 , p3 = 1 ,p4 = 1
s1 = -150 , s2 = 0 , s3 = -240 , s4 = 0