I am a beginner in Mathematica. I have this in Mathematica v12:
A = {1, 1, 1, 1}
B = {2, 2, 2, 2}
A+B
(* 3,3,3,3 *)
I'd like to experiment with evaluating arbitrary expressions on arrays, like this:
C = {4, 2, 4, 2}
(A+B)<C
(* I want this output: *)
(* True, False, True, False *)
In the example, above:
{1,1,1,1} + {2,2,2,2}
evaluates to{3,3,3,3}
which is an element-wise operation.{3,3,3,3} < {4,2,4,2}
should evaluate to{ True, False, True, False }
, but it does not do an element-wise operation (which seems logically inconsistent!).
What I have tried
Tried about 30 combinations and permutations of existing functions, none of them appeared to work. Tried the top 6 answers that were vaguely relevant on SO. Browsed through Mathematica documentation to try and find anything relevant.
[x+y<z for x,y,z in zip([1,1,1,1],[2,2,2,2],[4,2,4,2])]
$\endgroup$