You are viewing this question as it will appear in the manual grading interface. Return to the normal view when you are done.

Autograder demo: Using NumPy arrays

This question uses the built-in methods in code_feedback.py to check NumPy arrays. In addition, specific library functions can be disabled by hooking them in the setup autograder code.

Given a full rank matrix ${\bf A} \in \mathbb{R}^{n \times n}$ and vector ${\bf b} \in \mathbb{R}^n$, compute ${\bf x}$ such that ${\bf x} = {\bf A}^{-1}{\bf b}$. You may use any NumPy function except for numpy.linalg.inv() and numpy.linalg.pinv().

The setup code gives the following variables:

Name Type Description
n integer Dimensionality of $\mathbf{A}$ and $\mathbf{b}$.
A numpy array ($n \times n$) Matrix $\mathbf{A}$.
b numpy array (length $n$) Vector $\mathbf{b}$.

Your code snippet should define the following variables:

Name Type Description
x numpy array (length $n$) Solution to $\mathbf{Ax}=\mathbf{b}$.
user_code.py

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Autograder demo: Using NumPy arrays

Variant

Started at:
2026-09-19 11:10:13 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg