Please answer the following questions in complete sentences in a clearly prepared manuscript and submit the solution by the due date on Gradescope
Remember that this is a graduate class. There may be elements of the problem statements that require you to fill in appropriate assumptions. You are also responsible for determining what evidence to include. An answer alone is rarely sufficient, but neither is an overly verbose description required. Use your judgement to focus your discussion on the most interesting pieces. The answer to "should I include 'something' in my solution?" will almost always be: Yes, if you think it helps support your answer.
Please identify anyone, whether or not they are in the class, with whom you discussed your homework. This problem is worth 1 point, but on a multiplicative scale.
Make sure you have included your source-code and prepared your solution according to the most recent Piazza note on homework submissions.
As mentioned in the class video and briefly explored on the last homework, there is a neat relationship between viral spreading and matrix eigenvalues. We'll explore that here a bit more.
The two problems we'll use are the 10-node problem
Random.seed!(10)
A,xy = spatial_network(10, 2)
and the 1000-node problem
Random.seed!(10)
A,xy = spatial_network(1000, 2)
Consider using the approx_evolve_steps
function from Homework 1
for 10 steps. If we use the last step as an approximation of an eigenvector of , what
is the associated eigenvalue? (Hint: This is often called the Rayleigh quotient.)
Here, we'll use or p = 0.2
. Also x0 = zeros(size(A,1)); x0[1] = 1
for the 10-node problem and x0 = zeros(size(A,1)); x0[end] = 1
for the 1000-node problem.
To check your approach with Julia 1.8/1.9/1.10, for 10 nodes with 10 steps, I get 1.1671278134538403
.
(The final few digits may vary if you don't do this on an Intel machine.)
What happens
with and steps? For fun, I also tried this with the evolve_steps
function too
but you don't have to do that.
Use the power method to estimate the largest eigenvalues for for both the and node problems. How does it compare with the estimates from the previous step?
Use the power method to determine how much social distancing is required to get the largest eigenvalue of the matrix below for the -node graph. (The eigenvalue of is important because that's where you would expect an epidemic to occur.) Does it make sense that an epidemic wouldn't occur if you draw a picture of the graph with appropriate social distancing? How does this compare with reducing to achieve the same effect?
Vaccination behavior and epidemic thresholds. If we have a vaccine that is 90% effective and we have vaccinated 80% of the population, then we can simulate the impact of that by simply removing 72% of the nodes from the graph. Let's assume vaccination is done at random. (This is actually a very bad assumption in the United States right now, but that's a topic for a different class.) For the 1000 node graph, do you need more or less social distancing to get the largest eigenvalue of below one? Please run at least 25 trials of which nodes are randomly vaccinated. And report the mean and standard deviations of your estimates.
Implement backsolve and forward solve as functions in Julia. Show and document your code.
Use your backsolve and forward solve code, along with Julia's lu
factorization
in order to implement your own linear solver. Present a paragraph
or two (and a figure or two) comparing it's speed and accuracy to
using the \
solver.
Suppose we wish to solve and further suppose that you KNOW some of the values of .
Let us permute and partition to be a block system: where is what you know.
Show how to solve for given . Under what conditions is this possible?
Now, suppose that you have a very kind, but very confused dog that happened to eat your flash memory stick holding the piece of that you knew. However, you had saved your computed on your Purdue account, and so you have a backup. (This means you can assume that computing from is possible for this problem if you determined it wasn't always possible above.) Can you get back?
Combine these two parts to derive a single linear system to compute without computing . The system you'll derive is called the Schur complement.
These questions are not necessarily very hard, but ask you to relate mathematical details in a computational way.
Let , , be the output of an LU with partial pivoting. Write a software test to check if this is the correct output.
Recall that there is a quadratic function associated with a symmetric positive definite linear system and vector such that the minimizer of is the solution to . Draw a picture of the original quadratic and also draw a picture of the quadratic after you eliminate the variable (i.e. you do one variable elimination step as we did in class.) Your answer should have two quadratics. Do this for the system and .
Consider computing the LU decomposition on the matrix Write down a closed form solution for the matrix and such that .