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

Day_3_and_4_Assignment_Questions

Day_3_and_4_Assignment_Questions
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)
12 views

Day_3_and_4_Assignment_Questions

Day_3_and_4_Assignment_Questions
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/ 1

One Week Online Hands-On Workshop

Mastering Python Programming for Mathematics


Day 3 & 4 Assignment Questions
Below are assignment questions based on the topics covered in the last two days: Symmetric Groups,
Derivatives, Integration, and Graph Theory.

1. Symmetric Group – Permutations


Write Python code to generate the symmetric group S_3 (the group of all permutations of 3
elements). Display all the elements of the group and calculate the order of the group.
2. Find the Derivative
Compute the derivative of the following functions using Python's sympy library:
- f(x) = x^3 + 2x^2 - 5x + 3
- g(x) = e^x ⋅ sin(x)
Plot the derivative alongside the original function over the interval x ∈ [-2, 2].
3. Higher-Order Derivatives
Find the second and third derivatives of h(x) = ln(x^2 + 1). Print the results and evaluate h''(2) and
h'''(2).
4. Definite Integration
Calculate the definite integral for any three functions
5. Numerical Integration
Implement a Python function to approximate the integral of f(x) = x^2 over [0, 1] using the
Trapezoidal Rule with 100 subintervals.
6. Graph Creation
Create a directed graph with 5 nodes labeled A, B, C, D, E, and the following edges:
- A → B, B → C, C → D, D → A, A → C
Use networkx to plot the graph and display edge labels.
7. Properties of Graph
For the graph in question 6, compute and display the following properties:
- Degree of each node
- Number of edges
- Whether the graph is connected
8. Adjacency Matrix
Generate the adjacency matrix of the graph in question 6 using Python's networkx library. Print
the matrix.

You might also like