Hot answers tagged

2

Supposing that you have defined your function f(a,b) and g(a,b), and that a and b are to be 2 by 2 matrices: Select[Table[a = RandomReal[{-1, 1}, {2, 2}]; b = RandomReal[{-1, 1}, {2, 2}]; If[f[a, b] - g[a, b] < 0, {a, b}], {i, 1000}], #=!=Null &] This lists all the {a,b} for which the condition holds. You can save a bit (...


1

You can use Catch and Throw: SeedRandom[0]; Block[{a, b, f, g}, exception = Catch[ Do[ a = RandomReal[{-1, 1}, {2, 2}]; a = a\[Transpose].a; b = RandomReal[{-1, 1}, {2, 2}]; b = b\[Transpose].b; f[x_, y_] := Det@MatrixFunction[Log, (x + y)/2] - Log[Det[x.y]]/2; g[x_, y_] := Det[x + y]^(1/2) - Det[x]^(1/2) - Det[y]^(1/2); ...


Only top voted, non community-wiki answers of a minimum length are eligible