Read a preference expressed as a range

Read each comparison through to its condition. · 217 words

A range can act as a filter when every value inside it is acceptable. Here are four apartment listings: A costs $1,700, is a 30-minute walk from work, and has 2 bedrooms; B costs $1,550, is a 50-minute walk, and has 3 bedrooms; C costs $1,900, is a 25-minute walk, and has 3 bedrooms; D costs $1,750, is a 35-minute walk, and has 2 bedrooms. The stated preferences are: no more than $1,800, a walk between 20 and 40 minutes inclusive, and at least 2 bedrooms. Ask the AI to mark each listing pass or fail for every condition and list all full matches.

The prompt is stronger when it gives the source details, defines the range endpoints, and asks for visible checks instead of a bare choice. The expected result is A and D. A passes all three tests, and D passes all three tests. B fails because 50 minutes is above 40, while C fails because $1,900 is above $1,800. This table-like result can be checked by testing each value against each rule: four listings times three rules gives 12 checks. If asked to choose one, the source does not provide a tie-breaker, so the AI should explain that A and D both fit rather than invent a preference for lower rent or more bedrooms.

Check your recall

Which listings satisfy all three apartment preferences, and what should the AI do if asked to choose between them?

Check your answer

Listings A and D satisfy all three preferences. If asked to choose one, the AI should note that the source gives no tie-breaker and should not invent a reason to select A over D or D over A.

Sources and credits

Original KeyTouch lesson. Background reading · DAIR.AI · General Tips for Designing Prompts.