HW7, Practice with NumPy and Linear Algebra¶
1. Probability fundamentals¶
i. There are 27 students in the class. Assuming that everyone turns in a project, and I grade them in random order, how many ways (orders) can I evaluate the projects?¶
In [ ]:
2. Matrices and Linear Algebra¶
i. Find C¶
\[\begin{split} \mathbf{AB} = \left[ \begin{array}{cc}
4 & 3 \\
7 & 2 \end{array} \right] \left[ \begin{array}{cc}
2 & 5 \\
1 & 6 \end{array} \right] = \mathbf{C}\end{split}\]
In [ ]:
ii. Find F¶
\[\begin{split} \mathbf{DE} = \left[ \begin{array}{cc}
3 & 6 & 1 \end{array} \right] \left[ \begin{array}{cc}
1 \\
2 \\
4 \end{array} \right] = \mathbf{F}\end{split}\]
In [ ]:
iii. Find det G Given:¶
\[\begin{split} \mathbf{G} = \left[ \begin{array}{ccc}
-1 & 1 & 2 \\
3 & -1 & 1 \\
-1 & 3 & 4\end{array} \right]\end{split}\]
In [ ]:
iv. Find \(\mathbf{G}^{-1}\) (G given above)¶
In [ ]:
v. Check that your answer to the previous question part is correct¶
In [ ]:
vi. Solve the following linear system of equations. Then check your work.¶
\[\begin{split} \begin{array}{ccc}
6x_0 &+& 4x_1 &=& 2 \\
3x_0 &-& 5x_1 &=& -34 \end{array}\end{split}\]
In [ ]:
vii. Find the eigenvalues and associated eigenvectors of the matrix below. Then check your answers.¶
\[\begin{split} \mathbf{H} = \left[ \begin{array}{cc}
-5 & 2 \\
2 & 2\end{array} \right]\end{split}\]
In [ ]:
1. Pandas¶
- Create a Pandas dataframe with the following data collected from 5 samples of the species Iris setosa:
sample_label | sepal_length | sepal_width | petal_length | petal_width |
---|---|---|---|---|
a | 5.1 | 3.5 | 1.4 | 0.2 |
b | 4.9 | 3.0 | 1.4 | 0.2 |
c | 4.7 | 3.2 | 1.3 | 0.2 |
d | 4.6 | 3.1 | 1.5 | 0.2 |
e | 5.0 | 3.6 | 1.4 | 0.2 |
Also name the dataframe “iris_setosa” and the indices “sample_label”.
In [ ]:
- Display only the data for sepal dimensions.
In [ ]:
- Display only the data for sample “c”.
In [ ]: