0% found this document useful (0 votes)
28 views4 pages

Mathematical Python 2476

The document is a question paper for a course examination, containing various programming tasks using Python, SymPy, and Pandas. It includes instructions for candidates on how to attempt the questions and covers topics such as differentiation, limits, data manipulation, and plotting. The paper requires candidates to write Python code for specific problems and evaluate outputs based on given code snippets.

Uploaded by

bocosa7990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views4 pages

Mathematical Python 2476

The document is a question paper for a course examination, containing various programming tasks using Python, SymPy, and Pandas. It includes instructions for candidates on how to attempt the questions and covers topics such as differentiation, limits, data manipulation, and plotting. The paper requires candidates to write Python code for specific problems and evaluate outputs based on given code snippets.

Uploaded by

bocosa7990
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3r/~~20i4 (E)L .

2476 8
[This question paper contains 8
(c) Using the SymPy library, create a symbolic Your Roll No
expression for the following equation
Sr. No. of Question Paper : 2476
f(x) = x3 - 4x + 2
Unique Paper Code 2353200009
Give Python code for the following : Name of the Paper

• Name of the Course


(i) Differentiate the function f(x) with respect
to X. Semester V - Discipline Specific Elective
(DSE)
(ii) Substitute x = 2 m the f(x) and evaluate Duration : 3 Hours Maximum Marks : 90
the result.
Instructions for Candidates
(iii) Find the limit of f(x) as x approaches
infinity. 1. Write your Roll No. on the top immediately on receipt
of this question paper.

2. Attempt all questions by selecting any six parts from


question number 1, any three parts from question
number 2, and any two parts from question number 3
to 6 respectively.

3. All commands to be written in Python code.

1. Attempt any 6 parts : Total marks: 2.5x6=15

(a) (i) What will be the output of the following


Python Code

(2000) P.T.O.
2476 2 2476 7

6. Attempt any two parts : Total marks: 7.5x2=15


>>> b = '123'

>>> C = '4'
(a) Read the following students.csv file and create a
>>> b + C
DataFrame using Pandas, saving as df.

(ii) >>> 'HELLO' + '123'


Name, Math, Science, English

(b) What will be the output on execution of t'he Priya 85, 90, 85,
following code segment?
Aman 75, 78, 88
>>> myList = ["I", "Love", "using", "Python"]
Reema 85 , 72, 80
>>> for index, value in enumerate(myList):
Kiran 85,90,92
>>> print(index, value)

Give Python code for the following :


( c) Write the python code for finding the magnitude
of the complex number (i) Rename the column Math to Mathematics

z = a+ ib.
(ii) Drop the row where name is Reema.

(c) Write the following arithmetic operators in


(b) Write the Matplotlib commands to create a bar
increasing order in their preference
plot for the data names= ['Alice', 'Bob',
**, +, (),+,II 'Charlie'] and scores = [85, 90, 88] with labels
for the x-axis and y-axis as "Name" and "Score",
(e) Find the output of the Python code
respectively.
>>> c = [7, True, 'Python']

>>> 2*c
P.T.0.
2476 6 2476 3
(b) (i) Write a Python program to check that the (f) Write the output of the Python code
given number is prime. or not.
>>> a = [12, "apple", True, 0.25]
(ii) Write a program that adds two numbers a
and b, n times and prints their sum. >>> for thing in a:

(c) Write Python code to find the first derivative f'(x) >>> print(thing, end = ' ')
and second derivative f"(x) with respect to x of
the function f(x). = x3sinx. Also write code to (g) Write the code for finding average of two numbers
evaluate the values of f'(x) and f"(x) at x = n. a and b. Hence, write the code and output for
finding average of 10 and 20.

5. Attempt any two parts : Total marks: 7.5x2=15


(h) Give an example to show that alphanumeric
symbols inside quotes are a string.
(a) Give Python commands to plot the function f(x)
and find its critical points, where

f(x) = x4 - 4x2 + 3, -3 :,; x :,; 3 2. Attempt any three parts. Total marks: 3x5=15

(b) Write SymPy code to factorize the expression (a) Evaluate the following expressions involving
2 2
x + 2xy + y and to expand (x + y)"-5, and display arithmetic operators
the result using pretty printing.
(i) -7*20 + 8/16*2 + 54

(c) Use PyLaTeX to create a document with a section


(ii) (7-4*2) *10/5**2+15
named Mathematics and type the following
mathematical expression in section content (iii) 5%10 + 10 - 25*8//5
x3 + x2 + x + I = 0.

P.T.O.
2476 4 2476 5

(b) What is the output of the following python code

>>> name_list= ['Abe', 'Bob', 'Chloe', 'Doc']


(b) For the matrix A- [2 -2]-2 5 '
write the Python

commands to perform the following operations:


>>> score list = [55, 64, 70, 58]

>>> print( name_list[4], score_list[4]) (i) Create the matrix A.

(ii) Determine the characteristic polynomial of


( c) Write a Python program to find the factorial of a
A.
number n.
(iii) Find eigen values and eigen vectors of A.
(d) Write a python code to determine the solution of
the quadratic equations ( c) Write a Python program that will ask user to input
a number n and print the series :
ax2 + bx + c = 0
x2 x3 x"
x+-+-+···-.
2 3 n

3. Attempt any two parts: Total marks: 7.-Sx2=15

4. Attempt any two parts : Total marks: 7.5x2=15


(a) Write a Python program that solves

(a) For the second order differential equation


(i) the system of linear equations

2x - Sy - 11 d2y
-2 +9y=0,
dx
3x + 4y = 5
write Python code to find its solution and check
(ii) the quadratic equation x2 + x + 1 = 0.
that the solution is correct.

P.T.0.

You might also like