Skip to content

6. And That’s The Way It Is

In this problem, you’re asked to enter an APL expression (some APL code), including arguments (data given to APL symbols). Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.

Remember from problem 3 that APL uses 1 and 0 for yes and no. The And function (looks a bit like the letter A for And) allows you to combine such values; it gives 1 if both left and right arguments are 1, but 0 if either is 0. For example, 1 1 0 0 ∧ 0 1 0 1 gives 0 1 0 0, because:

  1. 0 (no): left list has 1 (yes) but right list has 0 (no)
  2. 1 (yes): left list has 1 (yes) and right list also has 1 (yes)
  3. 0 (no): left list has 0 (no) and right list also has 0 (no)
  4. 0 (no): left list has 0 (no) even though right list has 1 (yes)

Write an expression that with / (from problem 4), = (from problem 3), and (from problem 5) to find out whether the matrix [1 2 1 ⋄ 3 4 3 ⋄ 5 5 5] stays the same when it is mirrored. The answer should be 1 (yes).