Successive matrix multiplication

AI Thread Summary
The discussion focuses on modeling the spread of a flu epidemic using matrix multiplication to predict the percentage of ill individuals over time. The initial conditions include a percentage Y of the population being ill and probabilities a and B for remaining healthy or sick, respectively. The equations for healthy and sick populations are derived, leading to a matrix-vector representation. Participants seek clarification on forming the appropriate coefficients for the transition matrix A, specifically A(21) and A(22), while expressing uncertainty about the equations for X[n+1]. The conversation emphasizes the need for a MATLAB function to compute the percentage of ill individuals after n days based on these parameters.
sara_87
Messages
748
Reaction score
0
On a given day of a flu epidemic, a given percentage Y of the population is ill and (1-Y) is healthy. The probability of remaining healthy on the next day is a, and that of remaining sick is B. The question is, what percentage will be ill after a given number of days as a function of B,a and Y.

Write down the problem as a matrix multiplication of the vector of healthy and ill people. Define a MATLAB function that gives the percentage of ill people after n days for arbitrary B a,and Y.

any hints will be appreciated v much
thank you
 
Computer science news on Phys.org
sara_87 said:
On a given day of a flu epidemic, a given percentage Y of the population is ill and (1-Y) is healthy. The probability of remaining healthy on the next day is a, and that of remaining sick is B. The question is, what percentage will be ill after a given number of days as a function of B,a and Y.

Write down the problem as a matrix multiplication of the vector of healthy and ill people. Define a MATLAB function that gives the percentage of ill people after n days for arbitrary B a,and Y.

any hints will be appreciated v much
thank you

# healthy people = # people staying healthy + # new healthy people

The odds of staying healthy are a, so
# people staying healthy = a * # healthy people

New healthy people are sick people who did not stay sick. The odds of staying sick are B, so the odds of NOT remaining sick, i.e. new healthy people is (1-B), so
# new healthy people = (1-B) * # sick people

So if Y is the number of healthy people and X is the number of sick people at a given time,
Y[n+1] = a*Y[n] + (1-B)*X[n]

Write down a similar equation for X[n+1]. Do you see how this can be written as a matrix-vector product?
 
would the equation for X[n+1] be:
X[n+1]=B*X[n]+(1-B)*X[n]

i understood everything you did but I'm struggling to write it as a matrix vector product.
would it be something like:
(X,Y)=(somthing with a)+(something with b)
?
thank you
 
You want to write

<br /> \begin{bmatrix} A_{11} &amp; A_{12} \\ A_{21} &amp; A_{22} \end{bmatrix}<br /> \begin{bmatrix} X_n \\ Y_n \end{bmatrix} =<br /> \begin{bmatrix} X_{n+1} \\ Y_{n+1} \end{bmatrix} <br />

Multiplying this out gives

<br /> \begin{array}{c} X_{n+1} \\ Y_{n+1} \end{array} =<br /> \begin{array}{cc} A_{11}X[n] + A_{12}Y[n] \\ A_{21}X[n] + A_{22}Y[n] \end{array}<br />

so find the coefficients for the A matrix that make this match your equations.
 
oh ok so A(21) would be=(1-B)
and A(22) would be=a
is that right?
and how do i find A(11) and A(12) because I'm not so convinced about my equation for X[n+1]??
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...
Back
Top