mtc-243-python-programing-language-ii-slips-semester-iv
mtc-243-python-programing-language-ii-slips-semester-iv
Slip No. : 01
Time: 3 Hours Max. Marks: 35
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
Slip No. : 02
Time: 3 Hours Max. Marks: 35
Max Z = 5x + 3y
subject to x + y ≤ 7
2x + 5y ≤ 1
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 3x + 2y + 5z
subject to x + 2y + z ≤ 430
3x + 2z ≤ 460
x + 4y ≤ 120
x ≥ 0, y ≥ 0, z ≥ 0.
Slip No. : 03
Time: 3 Hours Max. Marks: 35
(a) Write a Python program to reflect the line segment joining the points A[5, 3] & B[1, 4] through the
line y = x + 1
1 2
(b) If the line with points A[2, 1], B[4, −1] is transformed by the transformation matrix [T ] = ,
2 1
then using python, find the equation of transformed line.
(c) Generate line segment having endpoints (0, 0) and (10, 10) find midpoint of line segment.
Q.3 Attempt the following.
(a) Attempt any ONE of the following. [7]
(i) Write a Python program to solve the following LPP:
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Slip No. : 04
Time: 3 Hours Max. Marks: 35
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ −20
−8x − 3y + 3z + 2w ≤ 20
x + y ≤ 11
x ≥ 0, y ≥ 0, z ≥ 0, w ≥ 0.
Slip No. : 05
Time: 3 Hours Max. Marks: 35
Max Z = 5x + 3y
subject to x + y ≤ 7
2x + 5y ≤ 1
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ 20
−3x − 2y + 4z + w ≤ 10
−8x − 3y + 3z + 2w ≤ 20
x + y ≤ 11
x ≥ 0, y ≥ 0, z ≥ 0, w ≥ 0.
10
Slip No. : 06
Time: 3 Hours Max. Marks: 35
Max Z = x + y
subject to 2x − 2y ≥ 1
x+y ≥2
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
11
12
Slip No. : 07
Time: 3 Hours Max. Marks: 35
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = x + 2y + z
subject to x + 2y + 2z ≤ 1
3x + 2y + z ≥ 8
x ≥ 0, y ≥ 0, z ≥ 0.
13
14
Slip No. : 08
Time: 3 Hours Max. Marks: 35
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 3x + 5y + 4z
subject to 2x + 3y ≤ 8
2y + 5z ≤ 10
3x + 2y + 4z ≤ 15
x ≥ 0, y ≥ 0, z ≥ 0.
15
16
Slip No. : 09
Time: 3 Hours Max. Marks: 35
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ 20
−3x − 2y + 4z + w ≤ 10
−8x − 3y + 3z + 2w ≤ 20
x ≥ 0, y ≥ 0, z ≥ 0, w ≥ 0.
17
18
Slip No. : 10
Time: 3 Hours Max. Marks: 35
Max Z = x + y
subject to x − y ≥ 1
x+y ≥2
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 3x + 2y + 5z
subject to x + 2y + z ≤ 430
3x + 4z ≤ 460
x + 4y ≤ 120
x ≥ 0, y ≥ 0, z ≥ 0.
19
20
Slip No. : 11
Time: 3 Hours Max. Marks: 35
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≥ 11
x ≥ 0, y ≥ 0.
(ii) Write a program in python to solve the following LPP and to find optimal solution if exists:
Max Z = 3x + 5y + 4z
subject to 2x + 3y ≤ 8
2y + 5z ≤ 10
3x + 2y + 4z ≤ 15
x ≥ 0, y ≥ 0, z ≥ 0.
21
22
Slip No. : 12
Time: 3 Hours Max. Marks: 35
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
(ii) Write a python program to solve LPP and find optimal solution if exists.
Max Z = 3x + 5y + 4z
subject to 2x + 3y ≤ 8
2y + 5z ≤ 10
3x + 2y + 4z ≤ 15
x ≥ 0, y ≥ 0, z ≥ 0.
23
24
Slip No. : 13
Time: 3 Hours Max. Marks: 35
Max Z = 5x + 3y
subject to x + y ≤ 7
2x + 5y ≤ 1
x ≥ 0, y ≥ 0.
(ii) Write a python program to display the following LPP by using pulp module and simplex
method. Find its optimal solution if exist.
Max Z = 3x + 2y + 5z
subject to x + 2y + z ≤ 430
3x + 4z ≤ 460
x + 4y ≤ 120
x ≥ 0, y ≥ 0, z ≥ 0.
25
26
Slip No. : 14
Time: 3 Hours Max. Marks: 35
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
27
28
Slip No. : 15
Time: 3 Hours Max. Marks: 35
(c) Write the python program to plot the graphs of sin x, cos x, ex and x2 in [0, 5] in one figure with
2 × 2 subplots.
Q.2 Attempt any TWO of the following. [10]
(a) Write the Python program to rotate the triangle ABC by 180 degree, where A[1, 2], B[2, −2] & C[−1, 2].
(b) Write the Python program to plot the graph of function f (x) = ex in the interval [−10, 10].
(c) Write a Python program to plot the 3D graph whose parametric equation is (cos(2x), sin(2x), x)
for 10 ≤ x ≤ 20 (in red color ), with title to the graph.
Q.3 Attempt the following.
(a) Attempt any ONE of the following. [7]
i. Write a Python program to solve the following LPP:
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
29
30
Slip No. : 16
Time: 3 Hours Max. Marks: 35
Max Z = 5x + 3y
subject to 3x + 5y ≤ 15
6x + 2y ≥ 24
x ≥ 0, y ≥ 0.
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
31
Slip No. : 17
Time: 3 Hours Max. Marks: 35
(a) Write a python program to rotate the line segment by 180 degrees having end points (1, 0) and
(2, −1).
(b) Write a python program to plot triangle with vertices [3, 3], [5, 6], [5, 2], and its rotation about the
origin by angle −π radians.
(c) Write a python program to drawn a polygon with vertices (0, 0), (1, 0), (2, 2), (1, 4) and find its area
and perimeter.
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ −20
−8x − 3y + 3z + 2w ≤ 20
x ≥ 0, y ≥ 0.
Max Z = x + y
subject to x ≤ 6
y≤6
x + y ≤ 11
x ≥ 0, y ≥ 0.
32
33
Slip No. : 18
Time: 3 Hours Max. Marks: 35
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
Max Z = 2x + 3y
subject to 5x − y ≥ 0
x+y ≥6
x ≥ 0, y ≥ 0.
34
35
Slip No. : 19
Time: 3 Hours Max. Marks: 35
Max Z = 3x + 5y + 4z
subject to 2x + 3y ≤ 8
2y + 5z ≤ 10
3x + 2y + 4z ≤ 15
x ≥ 0, y ≥ 0.
Min Z = x + 2y + z
1 1
subject to x + y + z ≤ 1
2 2
3
x + 2y + z ≥ 8
2
x ≥ 0, y ≥ 0.
36
37
Slip No. : 20
Time: 3 Hours Max. Marks: 35
Max Z = x + y
subject to x − y ≥ 1
x+y ≥2
x ≥ 0, y ≥ 0.
Min Z = 3.5x + 2y
subject to x − y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
38
39
Slip No. : 21
Time: 3 Hours Max. Marks: 35
Min Z = 4x + 2y
subject to x + y ≤ 3
x−y ≥2
x ≥ 0, y ≥ 0.
Max Z = 2x + 4y
subject to 2x + y ≤ 18
2x + 2y ≥ 30
x + 2y = 26
x ≥ 0, y ≥ 0.
40
41
Slip No. : 22
Time: 3 Hours Max. Marks: 35
(a) Write a python program to find the angle at each vertices of the triangle ABC where A[0, 0], B[2, 2]
and C[0, 2].
(b) Write a Python program to Reflect the Point P [3, 6] through the line x − 2y + 4 = 0.
(c) Write a Python program to find area and perimeter of the triangle ABC where A[0, 0], B[5, 0], C[3, 3].
Q.3 Attempt the following.
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ −20
−3x − 2y + 4z + w ≤ 10
−8x − 3y + 3z + 2w ≤ 20
x, y, z, w ≥ 0.
Min Z = x + y
subject to x + y ≤ 11
x≥6
y≥6
x ≥ 0, y ≥ 0.
42
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14 34
Write a Python programme to solve transportation problem for minimize the costs of whole
operation.
43
Slip No. : 23
Time: 3 Hours Max. Marks: 35
Max Z = 3x + 5y + 4z
subject to 2x + 3y ≤ 8
2x + 5y ≤ 10
3x + 2y + 4z ≤ 15
x, y, z ≥ 0.
Min Z = 3x + 5y + 4z
subject to 2x + 2y ≤ 12
2x + 2y ≤ 10
5x + 2y ≤ 10
x ≥ 0, y ≥ 0.
44
45
Slip No. : 24
Time: 3 Hours Max. Marks: 35
(c) Write a Python program to plot graph of the function f (x) = log(3x2 ), in [1, 10] with black dashed
points.
Q.2 Attempt any TWO of the following. [10]
(a) Write a python program to plot triangle with vertices [3, 3], [5, 6], [5, 2], and its rotation about the
origin by angle −π radians.
(b) Write a Python program to generate vector x in the interval [−22, 22] using numpy package with
80 subintervals.
(c) Write a Python program to draw a polygon with vertices (0, 0), (1, 0), (2, 2), (1, 4). Also find area
and perimeter of the polygon.
Q.3 Attempt the following.
Min Z = 3.5x + 2y
subject to x + y ≥ 5
x≥4
y≤2
x ≥ 0, y ≥ 0.
Min Z = x + y
subject to x ≥ 6
y≥6
x + y ≤ 11
x ≥ 0, y ≥ 0.
46
47
Slip No. : 25
Time: 3 Hours Max. Marks: 35
Max Z = 4x + y + 3z + 5w
subject to 4x + 6y − 5z − 4w ≥ 20
−3x − 2y + 4z + w ≤ 10
−8x − 3y + 3z + 2w ≤ 20
x ≥ 0, y ≥ 0, z ≥ 0, w ≥ 0.
48
49