Module 3 – Linear Algebra and Statistical Inference
Assessment 3
General Instructions:
1. The assessment consists of 4 sections.
2. Submit solutions for all 4 sections.
3. Read the problem statement carefully before answering.
4. Provide appropriate comments in your code.
5. Perform all the mentioned tasks programmatically using Python libraries.
6. Create separate Jupyter Notebook for all the 4 sections.
7. Place all 4 Jupyter Notebooks in the folder.
Assessment 3 – A
Consider a system of linear equations ‘Ax = b’. The coefficient matrix ‘A’ is a square matrix of order ‘n x n’, ‘x’ and ‘b’ are column vectors of order ‘n’. (Note that, A, x, b are the usual notation for system of linear equations.)
i. Write a Python function, eqn_solve(A, b), which takes matrix ‘A’ and vector ‘b’ as input, to solve the system of linear equations Ax=b.
ii. If the linear system Ax=b does not have any solution, then the function eqn_solve(A, b) should return the message, “The given system of linear equations are inconsistent.”
iii. If the system of linear equations Ax=b has multiple solutions, then the function eqn_solve(A, b) should return with one possible solution.
iv. Use the python function eqn_solve(A, b) to solve the following system of linear equations:
4x + 2y = 4 , 10x + 5y = 10
Assessment 3 – B
Let P be a parallelogram having vertices at (-2, 2), (4, 2), (2, -2), and (-4, -2). Let the matrix representation of the vertices of P be:
Each column of the matrix ‘P’ represents a vertex of the parallelogram.
a. Find an appropriate matrix which scales down the Parallelogram to 1/4th of its area around the origin as shown in the diagram below. Let the resultant Parallelogram be P1.
b. Find an appropriate matrix which rotates P1 by 60 degrees in clockwise direction. Let the resultant Parallelogram be P11.
c. Plot the Parallelograms P, P1, P11 to visualize them.
Hint: In the diagram below, the blue color parallelogram is P, the black colour parallelogram is P1 and the green colour Parallelogram is P11.
Assessment 3 – C
A farmer owns two dairy farms. He wants to know if the milk produced by the buffalos in the two farms differ statistically. He selects a random sample of buffalos from each farm and computes the sample statistics listed below.
Farm 1
Farm 2
Mean
3.5 L/day
3.9 L/day
Standard Deviation
1.2 L/day
0.8L/day
No. of Buffalos
21
24
Conduct a 2-sample t-test for the below steps by assuming significance level as 0.05. Calculate the following with the given details.
a. Define the null and alternate hypothesis
b. Calculate standard error of sampling distribution of difference in two sample mean
c. Calculate the test statistic
d. Calculate critical test statistics
e. Compare tStatistics and tCritical
f. State the conclusion
Assessment 3 – D
A company produces three variants of nutritional supplement drinks. They want to compare the energy (Kcal/100grams) level gained by consuming these three variants of nutritional drinks. Therefore, decides to conduct a statistical analysis using ANOVA.
The sum of squares and degree of freedom for the three nutritional drinks are calculated and given below.
Sum of Squares (SS)
Degree of Freedom (df)
Between (B)
23.0
2
Within (W)
316.9
18
Is there a significant difference in the mean energy (Kcal/100grams) for the varieties at a 0.05 significance level?
Calculate the following with the given details, considering that the ANOVA test assumptions are fulfilled.
a. Define the null and alternate hypothesis
b. Calculate the mean square values
c. Calculate the F-statistic
d. Calculate the critical F-statistic
e. Compare FStatistic and FCritical and state the conclusion