107 views
Consider the following intervals on the real line: $A_1 = (13.3, 18.3) \: A_3 = (8.3, 23.3) − A_1 \cup A_2$ $A_2 = (10.8, 20.8) − A_1 \: A_4 = (5.8, 25.8) − A_1 \cup A_2 \cup A_3$ where $(a, b) = \{x : a < x < b\}$. Write pseudo-code that calculates (without using any comparison operation) which interval a given input $x \in (5.8, 25.8)$ belongs to, i.e., your pseudo-code should calculate $i \in \{1, 2, 3, 4\}$ such that $x \in A_i$.
| 107 views