Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7656 > unrolled thread
| Started by | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| First post | 2012-01-08 09:29 +0000 |
| Last post | 2012-01-09 08:23 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: MatrixPower problem Ralph Dratman <ralph.dratman@gmail.com> - 2012-01-08 09:29 +0000
Re: MatrixPower problem per@RQNNE.invalid (Per Rønne) - 2012-01-09 08:23 +0000
| From | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| Date | 2012-01-08 09:29 +0000 |
| Subject | Re: MatrixPower problem |
| Message-ID | <jebnln$1do$1@smc.vnet.net> |
MatrixForm, as well as Column, Row, TableForm, and some others, are
really only for display. Their output cannot be calculated with, or at
least not in the same way as the original matrix.
I do think that should be mentioned more prominently in the Wolfram
documentation.
Just write
p =
{
{0, 1/2, 0, 1/2, 0},
{1/2, 0, 1/3, 0, 0},
{0, 1/2, 0, 1/2, 0},
{1/2, 0, 1/3, 0, 0},
{0, 0, 1/3, 0, 1}
};
MatrixForm[p]
e1 = {1, 0, 0, 0, 0};
Limit[MatrixPower[P, k].e1, k -> \[Infinity]]
and you should get the desired result.
You don't have to put the p array into a nice arrangement like that. I
just like the way it looks.
One other point: don't create a capitalized variable name like "P".
Always put the first letter of a new name in lower case, or you will
likely get your variables mixed up with Mathematica's reserved names
-- which all start with capital letters.
Good luck.
Ralph (or more safely, ralph)
On Sat, Jan 7, 2012 at 5:24 AM, Per R=F8nne <per@rqnne.invalid> wrote:
> I have defined the following matrix:
>
> P = {{0, 1/2, 0, 1/2, 0}, {1/2, 0, 1/3, 0, 0},
> {0, 1/2, 0, 1/2, 0}, {1/2, 0, 1/3, 0, 0}, {0, 0, 1/3, 0, 1}}
>
> And the following vector:
>
> e1 = {1, 0, 0, 0, 0}
>
> I try to solve:
>
> Limit[MatrixPower[P, k].e1, k -> \[Infinity]]
>
> And get the correct result:
>
> Out[7] = {0, 0, 0, 0, 1}
>
> But if I write the first statement as:
>
> P = {{0, 1/2, 0, 1/2, 0}, {1/2, 0, 1/3, 0, 0},
> {0, 1/2, 0, 1/2, 0}, {1/2, 0, 1/3, 0, 0}, {0, 0, 1/3, 0, 1}}
> //MatrixForm
>
> I will not only get a more readle Out-format of the matrix. My
> Mathematica 8.1 for Students will also deny to calculate what is
> demanded. It will just list
>
> Limit[MatrixPower[P, k].e1, k -> \[Infinity]]
>
> with P replaced with the contents of the 5*5 matrix.
>
> I simply don't understant why.
>
>
> The output I can be pasted as:
>
> At least I get the following output:
>
> Limit[MatrixPower[\!\(\*
> TagBox[
> RowBox[{"(", "", GridBox[{
> {"0",
> FractionBox["1", "2"], "0",
> FractionBox["1", "2"], "0"},
> {
> FractionBox["1", "2"], "0",
> FractionBox["1", "3"], "0", "0"},
> {"0",
> FractionBox["1", "2"], "0",
> FractionBox["1", "2"], "0"},
> {
> FractionBox["1", "2"], "0",
> FractionBox["1", "3"], "0", "0"},
> {"0", "0",
> FractionBox["1", "3"], "0", "1"}
> },
> GridBoxAlignment->{
> "Columns" -> {{Center}}, "ColumnsIndexed" -> {},
> "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},
> GridBoxSpacings->{"Columns" -> {
> Offset[0.27999999999999997`], {
> Offset[0.7]},
> Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
> Offset[0.2], {
> Offset[0.4]},
> Offset[0.2]}, "RowsIndexed" -> {}}], "", ")"}],
> Function[BoxForm`e$,
> MatrixForm[BoxForm`e$]]]\), k].{1, 0, 0, 0, 0}, k -> \[Infinity]]
>
> --
> Per Erik R=F8nne
> http://www.RQNNE.dk
> Errare humanum est, sed in errore perseverare turpe
>
[toc] | [next] | [standalone]
| From | per@RQNNE.invalid (Per Rønne) |
|---|---|
| Date | 2012-01-09 08:23 +0000 |
| Message-ID | <jee86r$d19$1@smc.vnet.net> |
| In reply to | #7656 |
Ralph Dratman <ralph.dratman@gmail.com> wrote: > MatrixForm, as well as Column, Row, TableForm, and some others, are > really only for display. Their output cannot be calculated with, or at > least not in the same way as the original matrix. > > I do think that should be mentioned more prominently in the Wolfram > documentation. So do I. Being a computer science major it surprises me. > One other point: don't create a capitalized variable name like "P". As mentioned in another reply in this thread (which by now seem to have broken into two pieces), it is meant for a Linear Algebra assignment at college. I have returned to school again to get a further degree in Physics, Astronomy and Mathematics. And the college teacher has given the matrix the name 'P'. -- Per Erik Rønne http://www.RQNNE.dk Errare humanum est, sed in errore perseverare turpe
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web