0% found this document useful (0 votes)
14 views

MP_Dec2023

Mathematical python delhi university

Uploaded by

Apeksha Sharma
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)
14 views

MP_Dec2023

Mathematical python delhi university

Uploaded by

Apeksha Sharma
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
You are on page 1/ 8

pages.

]
This question paper contains 8 printed
Your Roll Noa)2a3
Sr. No. of Question Paper : 7212 G

Unique Paper Code : 2353012002

Name of the Paper Mathematical Python

Name of the Course B.Sc. (Hons.) Mathematics


Discipline Specific Elective
Course (DSE)

Semester : III

Duration:3 Hours Maximum Marks : 90

Instructions for Candidates

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, and any three parts from
question
numbers 2 to 6
respectively.
3. All commands to be written in
Python code.

P.T.0.
7212 2
Total marks: 2.5x6=15
1. Attempt any 6 parts.

f-string Python
(a) Write the output of the following
command:

places, is
print (f 'n, rounded to two decimal
{pi:.2f}.")

(b) For the system Ax = b, the inverse matrix can be


computed using function from NumPy,
and the solution can be computed using the
method.

(c) What will be the output of the following Python


code:

>>> a = 123

>>> b = 4

>>> [a + b, 2*b]

(d) Write SymPy code to evaluate : lim a-b*)


X-’0| X

(e) Write SymPy code to find the first


and second
derivative w. r. t. x of the function:
a cos (log(x)) + b sin (log(x)).
P.T.0.
number. that to
numbers
up natural all ofsum find to
andnumber
natural any input program
to Python Writea (c)
5. 95, 100, 105, (ii)
200 30,.., 20, 10, (i)
sequences finitefollowing
the print to
code Python usingstatement for Write (b)
speed. slowest the moves turtle the makes
that square each after degrees right6 turning
triangles, 60
draws thatprogram Python Wriate (a)
5x3=15 narks: Total parts. any3Attempt
2
lexicographical
order. reverse in
1 +cxbx?t ax'- printing
of pretty fSymPy
or Use (h)
[1,2,3,4,5,6,7]. array: the from
[3,4,5] numbers the print to
code Python the Write (g)
sin(log(x))
dx. compute: code
to SymPy Write (0
2
3 7212
4 3. 7212
(a) Attempt (d) (c) (b) (a) Attempt (d)
matrix : the Write mark
joiningWrite a -T -TGive ratioWrite functions
commands f(x) Give subplot.
using
[0,1] Write
igenvalues S
a any = the S between
XPython
XS any
Python three a a
python x3 Python S
3 points Python 3 Python
to 2. 2r e
parts. points: commands parts.
evaluate 3x2
commands on 10 and
program
and with program program
the consecutive
+ program
envectors 5, (1, e
size 1), top 4
that f(x) -1 to cos(2nt)
to ofplot
marks:
Total at s to as (0, draw to to
determines 5x3=15 the marks:
Total
critical xplot 12-2), plot 5x3=15
thFibonacci
e plot
of s on and graph graph over
the 3. the graph on
the graphs
points. Also (4, a
following and function line. 10). of of the
the ofnumbers.graph
prints give
sin(x),sin(x), interval of
Also line
the two
7212
(d) (c) (b)
display Write
x 100],89, List greater Write 2x X Xmatrix.
LinAlgError
system Write
+ + +
= +
4x'y' y 3y
(65, a 6y +
the SymPy thanlambda
4z - of a
-
22, 4z 2z linear Python
result 3xy' +
85 = to
= 7 =
code 97, -2
-4
from
function 9 5 equationshandle 4 -2
using +
y* 85, program
to
and 54, a the 1 5
pretty factorize given
to to 5 2
86, filter with error 2
expand
printing. 62, list: using
numbers
singular in
the 77, solving
(x
expression
+ 90, NumPy
.T.O. y)', coefficient
73, strictly following
and
61, and
5. 7212

(b) (a)Attempt
**2-1))>>>
*x**2-z*x**2+x**3, commands X=
>>> cancel(sin(x)*
tan(x)/sec(x)
>>>x) >>> >>> What
: p.Show() p[0].linecolor
p[1].linecolor'r' = b'= p= from correctly:
from rewrite itFind
together(1/(x-1) simplify(x* plot(4*x
symbol(x)
will sympy.plotting
sympy the any
error 3
be **2+3,
the import parts.
(if
*2+2*x+1 output 3*x+5, any)
- symbol import 6
1/(x+1)) in
of legend=True,
)/(x**2+x)) the
the Plot 5x3=15
marks:
Total
following
following

Show=False)
code
Sympy
and
6 7212
(b) (a) Attempt (d) (c)
Write codesequence =
P.,n+3(4Pprogram {P,}, Given thatWrite For integral: Write

to any the the


SymPy that the SymPy a
print n+1 that solution second 14
to is, 3 SymPy
first dx2
code Pa)/(3P, + is find P,-3, parts. d'ydy
first code
x+3 recursively dx order
X-2 three is
to 6 the P,-2, (*-112 code
correct. to -12ySex -ordinary
<0. solve values 7
next elements find dx.
and to
the 2),
defined its print
of three P-1. 5x3=15
marks:
Total
rational for solution, differential
the
n1. of and
sequence. via
termsWrite the
inequality the evaluate
Also sequence and
0. relation: Python a equation:
of
give
check
the
: the
7212
(d) (c)
Give dataframe Read mathematicalnamed Use
(iii) (ii) (i) PyLaTeX
averages. Sohan,86,87,68,98
Python Bob,89,46,85,
Tom,78,94,,58 Name,
Sam,63,8
1,100,75 the
Fill Change
DropEngland. Mathematics
the using
following 2x2
the code Eng,
NaN expression to
name pandas, +
second 3x create
values for India,
scores.csv + 8
of the 1 and
row Africa, saving a
with following
the = document
in
of 0 the type
corresponding column it
Bob. Nepal in file section
: some the with
and
Eng variable following
content
make a
section
row to
: a :

You might also like