2
$\begingroup$

Here k is an integer number. How can I simplify the result by adding conditions like k is odd or even?

Also why are the 0^k terms not simplified to 0?

A = {{0, 0, -1}, {0, 0, -1}, {0, 1, -2}};
MatrixFunction[#^k &, A] // FullSimplify // MatrixForm

Enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ Try Simplify[A^k, {Element[k, PositiveIntegers] }] $\endgroup$ May 11 at 6:48
  • 2
    $\begingroup$ MatrixFunction[#^k &, A] // FullSimplify[#, k > 0 && Mod[k, 2] == 0] & // MatrixForm? $\endgroup$
    – kglr
    May 11 at 6:52
  • $\begingroup$ @kglr that Mod is neat $\endgroup$
    – anhnha
    May 11 at 7:04
  • $\begingroup$ @kglr Why the restriction Mod[k,2]? A^1 , A^3,...is allowed, I think. $\endgroup$ May 11 at 7:06
  • $\begingroup$ @UlrichNeumann, Mod[k, 2] == 0 is to add the assumption/condition that k is even. For simplification under the assumption that k is odd, we need ``Mod[k, 2] ==1`. $\endgroup$
    – kglr
    May 11 at 7:10
4
$\begingroup$

You can get some simplification by assuming k>0

A = {{0, 0, -1}, {0, 0, -1}, {0, 1, -2}};
Simplify[MatrixFunction[#^k &, A], Assumptions -> k > 0] // MatrixForm

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.