Advertisement
MatsGranvik

Determinant equation and its tautological solution.

Jan 5th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. (*Mathematica 8 start*)nn = 7;
  2. a = RandomReal[{-1, 1}]
  3. Print["b = the numbers fed in"]
  4. b = Table[n + RandomReal[{-1, 1}], {n, 1, nn}]
  5. A = Table[
  6. Table[If[n == k, a, If[n > k, RandomReal[{-1, 1}], 0]], {k, 1,
  7. nn}], {n, 1, nn}];
  8. B = Transpose[A]*b[[Range[nn]]];
  9. c = (x /. Solve[Expand[Det[A.B - x*A]] == 0, x])/a;
  10. Print["c = solutions to the polynomial"]
  11. Sort[c, Less]
  12. Print["The matrix A.B"]
  13. TableForm[A.B]
  14. (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement