-1
$\begingroup$

I generate several algebraic matrices of 12x12 where each element is a combination no repeat of the variables x, y, z and operations +, -, *, /, power, establishment (square root), any of them or any of them

example: [x + y + z, x ^ 2 + y-z, (x + y + z) ^ 2, .....]etc.

$\endgroup$
  • $\begingroup$ So, any algebraic expression like $\sqrt{1 - x^2 +y}$ or $\frac{1+x}{2+y^2}$ can be an element? $\endgroup$ – J. M. will be back soon Jun 5 '16 at 20:39
  • $\begingroup$ Isn't x^2 a "repeat" of x since it is x*x? $\endgroup$ – bill s Jun 5 '16 at 22:55
  • $\begingroup$ so not so complex, but may be future options $\endgroup$ – zeros Jun 6 '16 at 0:58
  • $\begingroup$ By saying "no repeat"... Do you want no exact duplicates or what? $\endgroup$ – Lukas Jun 6 '16 at 4:14
  • $\begingroup$ yes, example x/y and 2x/2y not $\endgroup$ – zeros Jun 6 '16 at 4:27
1
$\begingroup$

I'm sure there are a lot of ways to generate random functions. Here's one:

a := RandomChoice[{Times, Plus}] @@ (RandomChoice[{Sqrt, Identity, Power}] /@ 
  (RandomSample[{x, y, z}, 3] RandomInteger[{1, 5}, 3])^RandomInteger[{-3, 3}, 3]);

To make a matrix of such functions:

Table[a, 3, 3] // MatrixForm

enter image description here

Of course the output is different each time. Thanks to Bill (not me -- the true bill s) for pointing out that Table[a, {i, 3}, {j, 3}] is required for versions before 10.2.

$\endgroup$
  • $\begingroup$ error: Argument 3 at position 2 does not have the correct form for an iterator. >> ?????? $\endgroup$ – zeros Jun 6 '16 at 0:56
  • $\begingroup$ @zeros If you click on reference.wolfram.com/language/ref/Table.html and you click on "Updated Show Changes" in the upper right corner then it will show that they changed the syntax in 10.2 to accept Table[expr,n] in addition to the older Table[expr,{n}] form. Snews to me. $\endgroup$ – Bill Jun 6 '16 at 1:23
  • $\begingroup$ Thanks, I can explain this part of the code @@ and / @ . Other operations can mix ?? $\endgroup$ – zeros Jun 6 '16 at 2:40
  • $\begingroup$ ok con explain,...Other operations can mix ?? $\endgroup$ – zeros Jun 6 '16 at 4:25

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.