# Modeling the problem

### Modeling the problem

I'm having a problem while solving this problem, when i implement the solution it happens a loop and it doesn't go to the answer

Consider a model for the long-term eating behavior of students at a University. It was found that 25% of students who ate at canteen A would come back to eat again the next day, while those who ate at canteen B had a 93% chance of going back to eating again the next day. Assume that this university has only 2 canteen on campus and further assumes that all students eat at either canteen. Then, in the long run, what is the percentage of students going to eat at canteen A and B, respectively?

A. 8% and 92%
B. 8,5% and 91,5%
C. 9,5% and 90,5%
D. 10% and 90%

Hope everyone help, thank you everyone!
kan

Posts: 1
Joined: Thu May 28, 2020 11:53 am
Reputation: 0

### Re: Modeling the problem

Let x be the number of students who eat at A one day and let y be the number of students who eat at B that day. The number of students who eat at A the next day is 0.25x+ 0.07y and the number of students who eat at B the next day is 0.75A+ 0.93y (B must be a whole lot better than A!).

We can represent this as a matrix multiplication. If we let u be the number of students who eat at A the next day and let v be the number of students who eat at B the next day then
$$\begin{bmatrix}u \\ v \end{bmatrix}= \begin{bmatrix}0.25 & 0.07 \\ 0.75 & 0.93 \end{bmatrix}\begin{bmatrix}x \\ y \end{bmatrix}$$

To determine what happens in the long run you need to determine what $$\begin{bmatrix}0.25 & 0.07 \\ 0.75 & 0.93 \end{bmatrix}^n$$ looks like for large n.

One way to do that is to find the eigenvalues and eigenvectors for the matrix.

If matrix $$\begin{bmatrix}a & b \\ c & d \end{bmatrix}$$ has eigenvectors $$\lambda_1$$ and $$\lambda_2$$ with eigenvectors $$\begin{bmatrix}u_1 \\ u_2 \end{bmatrix}$$ and $$\begin{bmatrix}v_1 \\ v_2 \end{bmatrix}$$ as eigenvectors corresponding to eigenvalues $$\lambda_1$$ and $$\lambda_2$$ respectively, then we can write
$$\begin{bmatrix}a & b \\ c & d \end{bmatrix}= \begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$$$\begin{bmatrix}\lambda_1 & 0 \\ 0 & \lambda_2\end{bmatrix}$$$$\begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$.

And then
$$\begin{bmatrix}a & b \\ c & d \end{bmatrix}^n=$$$$\begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$$$\begin{bmatrix}\lambda_1 & 0 \\ 0 & \lambda_2\end{bmatrix}^n$$$$\begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$$$= \begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$$$\begin{bmatrix}\lambda_1^n & 0 \\ 0 & \lambda_2^n\end{bmatrix}$$$$\begin{bmatrix}u_1 & v_1 \\ u_2 & v_2 \end{bmatrix}$$.

So start by finding the eigenvalues and eigenvectors of the matrix $$\begin{bmatrix}0.25 & 0.07 \\ 0.75 & 0.93 \end{bmatrix}$$.
Guest