User Tools

Site Tools


gibson:teaching:spring-2016:math445:lab6

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 lab 6: Google Page Rank ====== ----- **Problem 1: Hamster dynamics.** Suppose you have 100 hamsters living in the following set of eight hamster houses connected by one-way tunnels. {{:gibson:teaching:fall-2012:math445:network1.png?direct&400|}} Suppose that every minute at sound of a bell, each hamster runs down one of the tunnels in its present hamster house and appears in the house it connects to. **(a)** Let $p_i^n$ represent the population of hamsters in the $i$th house in the $n$th minute. Write down a set of eight equations for $p^{n+1}_1$ through $p^{n+1}_8$ in terms of $p^{n}_1$ through $p^{n}_8$. **(b)** Let $p^n$ be the vector whose elements are $p^n_1, p^n_2, \ldots, p^n_8$. Write the set of equations from (a) in terms of a matrix-vector multiplication, $p^{n+1} = A p^n$. **%%(c)%%** Write Matlab code to compute the steady-state distribution of hamsters by computing $p^n$ for some large value of $n$, say $n=100$. Start with a random initial arrangement of hamsters $p^0$. Plot your results in a histogram. Hint: don't worry about fractional hamsters. ...to be continued...

gibson/teaching/spring-2016/math445/lab6.1456173889.txt.gz · Last modified: 2016/02/22 12:44 by gibson