Skip to content

3. Comparatively Easy

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.

APL has several functions that compare the data on their left with the data on their on the right. If the comparison is true, they give 1 for “yes”, but if it is false, they give 0 for “no”. The basic comparison functions are Lower Than (<), Lower Than Or Equal To (), Equal To (=), Higher Than Or Equal To (), Higher Than (>), and Not Equal To ().

These can work with lists as well as single numbers. For example, 3 1 4 ≥ 2 1 7 gives 1 1 0 because:

  1. 1: yes, 3 is higher than (or equal to) 2
  2. 1: yes, 1 is (higher than or) equal to 1
  3. 0: no, 4 is not higher than or equal to 7

All other basic mathematical symbols of APL work the same way.


Write an expression that uses to compare the lists 2 7 1 8 2 8 2 and 1 6 1 8 0 3 4. It should give a list indicating which corresponding numbers differ (1) and which are the same (0). The result should be 1 1 0 0 1 1 1.