Professional Documents
Culture Documents
NA Final Spring 2021 BS (Zeeshan)
NA Final Spring 2021 BS (Zeeshan)
To be filled by Student
Notes:
1. By filling out your name and registration number above, you Pledge that: “I affirm
that I have not given or received any unauthorized help on this exam/assignment,
and that this work is my own.”
2. Any student found breaching the “Regulations Relating to the Examinations of
PMAS-Arid Agriculture University, Rawalpindi”, will face severe penalties.
3. Any form of Cheating, Unauthorized Help, and/or Plagiarism found in the Answers
given below will have severe penalty for the student, ranging from cancellation of
paper to suspension from the University rolls for up to 2 years.
4. All questions carry equal marks.
Q.No.1. Write python code that finds the maximum value of the given function in the interval
[−4 ,6 ] by using Bisection method.
2
( x 2−10 )
f ( x )=3 x− +10
20
Answer:
Q.No.2. Write python GUI code to apply Newton method on the function f ( x )=x 3 + x−1 and
specifications of the GUI are as given below.
Answer:
Q.No.3
Write python code to find the point of intersection of two lines 4 x− y=−2 and 2 x+5 y =1 by
using any suitable numerical technique? Also give a reason to choose that method?
Answer:
Q.No.4. Simulate Rectangular Rule for the given integration, as given below
5
∫ (2 x 2−10 ¿)dx ¿
0
Answer:
Q # 5: Find the area of shaded region by Trapezoidal Rule for n=6.
Answer :
Q # 6:
A fruit juice company makes two special drinks by blending apple and pineapple juices. The first
drink uses 35% apple juice and 65% pineapple juice, while the second drink uses 65% apple juice and
35% pineapple juice. There are 1100 liters of apple juice and 1550 liters of pineapple juice available.
If the profit for the first drink is $.40 per liter and that for the second drink is $.60, find the number
of liters of each drink that should be produced in order to maximize the profit.
Answer :
Max z=3 x1 + 4 x 2+ x 3 +7 x 4
8 x 1+ 3 x 2 +4 x3 + x 4 ≤ 7
2 x1 +6 x 2 + x 3+5 x 4 ≤ 3
x 1+ 4 x 2 +5 x3 +2 x 4 ≤8
8 x 1+ 3 x 2 +4 x3 + x 4 ≤ 7
x1 , x2 , x3 , x4 ≥ 0
Answer :
Q # 8: In a tensile test of a metal bar, the following observation were made where x represents load
in tons and y elongation in ten thousands of an inch
x 1 2 3 4 5 6
y 14 27 41 56 68 75
Using principle of least squares, find a law of the form y=ax+ b
Answer :
Q # 9: Simulate the above problem given in question 8 and plot both observed values and estimated
law on a single graph.
Answer :
Q # 10: Write python code of the following system of linear equation which solve it by using Seidel
Method. Use x(0) =0
4 x1 + x 2−x 3=5
−x 1+ 3 x 2 + x 3=−4
2 x1 +2 x 2+5 x 3=1
Answer :