Skip to content

1. Comparing This to That

Note: In this problem, you’re asked to enter some APL code, including an APL symbol and the data (text or numbers) given to it. 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, and 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 a comparison of 3 5 4 8 6 and 3 4 5 3 9 such that the code gives 0 1 0 1 0.