Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: MatrixPower problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124072] Re: MatrixPower problem
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Sun, 8 Jan 2012 04:21:44 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201201071024.FAA19580@smc.vnet.net>

e1 = {1, 0, 0, 0, 0};

Use parentheses to keep the print formatting (MatrixForm) from being
included in the definition of P

(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

Limit[MatrixPower[P, k].e1, k -> \[Infinity]]

{0, 0, 0, 0, 1}


Bob Hanlon

On Sat, Jan 7, 2012 at 5:24 AM, Per R=F8nne <per at 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
>



--
Bob Hanlon



  • Prev by Date: Re: Sorting point-arrays by rows and columns, cont.
  • Next by Date: Re: ListPolarPlot questions
  • Previous by thread: MatrixPower problem
  • Next by thread: Re: MatrixPower problem