Skip to main content
gamedev.net
🔒 Locked

Need matrix help

Started by griffenjam 14 replies 550+ views
Original Post
griffenjam
griffenjam
I need a little help with a homework problem. Not really the math part,more of an application aspect. First we have a matrix
  | A   B   C |
A |.35 .24 .64|
B |.45 .25 .14| = P
C |.24 .14 .12|
 
I had to find the product of P times itself, that was easy, however the problem says that the letters represent political parties and the numbers represent the number of people leaving which party for whichever other party. I made up all these numbers so they don't match at all, in case you were wondering. P(sub ii) rebresents the percentage of people staying with their party. If this is the case then was does P*P represent? I don't have a clue. [edited by - griffenjam on January 28, 2004 11:48:35 AM]
amish1234
amish1234
ok.

___________________________________________________________
Proceeding on a brutal rampage is the obvious choice.
Where to find the intensity (Updated Jan 23, 2004)
___________________________________________________________Where to find the intensity (Updated Dec 28, 2004)Member of UBAAG (Unban aftermath Association of Gamedev)
smart_idiot
smart_idiot
ok.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
Andrew Russell
Andrew Russell
no, we''re not going to do the "ok." thing.


Anyway, what happened to the "no homework help" rule?

IIRC, it''s something to do with the projected probability that a system will be in a state, after X iterations (P*P is after 2 iteration, IIRC).

I think...

BTW, add some code tag-age to your matrix, it''s unreadable.
Promit
Promit
quote:
Original post by Andrew Russell
no, we''re not going to do the "ok." thing.



Lol that''s funny coming from a mod, especially a mod who has done the "ok." thing.

About the matrix...well, that''s a pretty weird question (plus there''s sort of a no homework help rule on GDNet). Doesn''t your math book say anything?
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
amish1234
amish1234
One time in high school we had these matrices that described tennis matches.

...|.A. .B. .C.|
.A.| - 1 1 |
.B.| 1 - 0 | = P
.C.| 0 1 - |


1's mean wins by the rows and 0's mean losses. For example, B beat A but lost to C. The diagonal is filled with '-' because it's meaningless.

Anyway, P*P showed indirect wins. For example, if B beat C who beat A, P(subBA would be 1).

I hope I remembered this correctly and that you can find a way to apply this to your problem.


___________________________________________________________
Proceeding on a brutal rampage is the obvious choice.
Where to find the intensity (Updated Jan 23, 2004)


[edited by - amish1234 on January 28, 2004 2:31:11 AM]
___________________________________________________________Where to find the intensity (Updated Dec 28, 2004)Member of UBAAG (Unban aftermath Association of Gamedev)
Eelco
Eelco
i think that if you multiply it with itself, the effect will simply be doubled, as if the same matrix applied for two years. after all, thats what matrix multiplication does in CG: adding two rotations.
Crispy
Crispy
quote:
Original post by Andrew Russell
no, we''re not going to do the "ok." thing.



Uh oh - you''re ALL about fun...





"Finishing in second place, simply means you are the first loser." - PouyaCat

"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
griffenjam
griffenjam
There isn''t anything about no homework help in the FAQ.

Neither my teacher nor the book described what the data would represent when multiplying matricies, they just describe how to do it. The solution in the back of the book gives the matrix I found, but doesn''t say what the data means.
Colin Jeanne
Colin Jeanne
This type of matrix is called a Transition Matrix.

In a transition matrix
*Each column adds up to 1

Powers of transition matrices represent what happens to a system as time progresses. For example:


A B
___ ___
A |___|___|
B |___|___|


In the above matrix the fields can be seen in this way:
AA : % that transition from state A to state A
AB : % that transition from state A to state B
BA : % that transition from state B to state A
BB : % that transition from state B to state B

An Example:
Suppose Store A exists and Store B just opens. Given a transition matrix you would be able to find out how many of your people will end up leaving A for B.


Colin Jeanne | Invader''s Realm
pinacolada
pinacolada
I think there is an unwritten rule where: if someone is asking a question that is so obviously a homework question, but they don''t say it''s homework, then you should make fun of them and not answer the question.

But if they say it''s homework, that''s ok. As long as you are explaining the concept and not just giving the answer.
Aerolithe
Aerolithe
quote:
Original post by pinacolada
I think there is an unwritten rule where: if someone is asking a question that is so obviously a homework question, but they don''t say it''s homework, then you should make fun of them and not answer the question.

But if they say it''s homework, that''s ok. As long as you are explaining the concept and not just giving the answer.


If thats not what the rule is then it should be, why not use what resources are available to help yourself (as opposed to cheating)? It''s not like he wants us to do the whole assignment or even a whole problem, he just doesn''t understand a part of it.

If you multiplied that matrix by a matrix of voters, then you''d have the result for next year. If you multiply it by itself, I think it''s the change for two years, so if you multiply it by a matrix of voters thats what it will look like in two years. It seems correct to me, but although I just studied them a few months ago I don''t recall any problem like that and I may have misunderstood.
Andrew Russell
Andrew Russell
Now I can read the matrix and understand it, I can answer your question better.

As far as I can tell, it''s a state matrix question.

for instance, take your first matrix, P. You say you changed the figures (which didn''t really help), so I''m changing them to something sensible. This is because each row must add up to one. Presumably they did before you changed them.


|.35 .24 .41|
|.45 .25 .30| = P
|.24 .34 .42|


Now, we have our new matrix, P.

What this represents is the chance of entering state change (after one iteration), depending on its current state. For instance, assume we are in state one (the first row). The chance that we''ll stay in state one after an iteration, is 35 percent, there''s a 24% chance we''ll end up in state two, and 41 percent that we''ll be in state three.

Multiplying P by P, will give you a matrix for two iterations, multiplying again by P will give 3 iterations, etc.

And the way this works, is you have a starting point matrix


|1|
|0| = S
|0|


This matrix is our current state. Our little guy is in state one. Multiplying as such:


S*P = |.35 .24 .41|


Thus, these are the chances of being in each state for our guy after one iteration. If you did S*P*P*P, that would be the chance of being in a state after three iterations.

You can expand this to populations, as such:


| 11 |
| 21 | = S
| 37 |


Multiplying that will give you the projected populations in each state, after as many iterations as you do multiplications.


A better example would have been the weather. We could simplify it a little, and say we have two states, rainy and sunny. Make the top row sunny, and the bottom row rainy. Here is our matrix:


| 0.8 0.2 |
| 0.5 0.5 |


All we need is a starting point, and then we can project the weather as many days ahead as we like. Basicly, if today is raining, there''s a 50-50 chance it will be raning or sunny tomorrow, whereas, if it''s sunny, then there''s a good chance it will stay sunny.


Another trick you can do is to trap things in a state. For instance, take pool and someone who is total crap at the game. The first row is "on the table", the second is "in a pocket".


| 0.9 0.1 |
| 0.0 1.0 |


As you can see, while its on the table, our guy will only pocket the ball one in 10 times, whereas, once the ball is pocketed it''s not going to ever become unpocketed.


Anyway, that covers pretty much everything I know about state matrixes, I hope this has been enlightning for you.
Boops
Boops
We missed you!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.