Guides

If Two Four-Digit Records Sort to the Same Digits, Are They the Same?

The reading question: does a shared sorted list mean the records match?

Illustration for the guide

No. In the hypothetical example used here, [0,7,2,1] and [1,0,7,2] contain the same four digits, but those digits occupy different positions. Sorting both records produces the same ascending list, [0,1,2,7]. That result shows a shared collection of digits; it does not show that the original records had the same order.

The distinction matters when reading a four-digit record. A record can be treated as four displayed positions, not merely as a bag of digits. If the question is whether two records match in exact order, compare each position as displayed. If the question is whether they contain the same digits regardless of order, compare their sorted collections. These are different comparisons, and one result should not be substituted for the other.

Keep the displayed positions before sorting

Read the record from left to right and retain each digit’s position. For [0,7,2,1], the first position is 0, the second is 7, the third is 2, and the fourth is 1. In [1,0,7,2], the positions instead contain 1, 0, 7, and 2.

Sorting changes the view: it rearranges the digits into ascending order. It can be useful for checking which digits a record contains, but it no longer preserves where each digit originally appeared. Once the positions have been discarded, the sorted list alone cannot reconstruct which of the original orders was shown.

This is why a four-digit record should be read as four displayed digits when order is relevant. The first digit is not interchangeable with the second merely because both remain part of the same set after sorting. Keep the original tuple available whenever the comparison concerns position.

Worked hypothetical comparison

The following is an explicitly hypothetical comparison of the two toy records. It illustrates how the reading changes depending on the question; it does not state a general game rule.

Reading step Record A Record B
Original displayed tuple [0,7,2,1] [1,0,7,2]
First through fourth positions 0, 7, 2, 1 1, 0, 7, 2
Sorted collection [0,1,2,7] [0,1,2,7]
Exact-order comparison Different Different
Unordered digit comparison Same collection Same collection

For an exact-order comparison, compare corresponding positions: first with first, second with second, and so on. Here, the first positions differ (0 and 1), so the tuples are not identical in order. For an unordered comparison in this named example, sorting shows that both records contain one 0, one 1, one 2, and one 7. That supports the limited conclusion that their digit collections match.

Which fields matter, and what can be inferred?

For exact order, the relevant fields are the four displayed digits and their positions. The full ordered tuple preserves both. For an unordered comparison, the relevant information is the collection of digits and their counts; a sorted list is one way to display that information. If only the sorted list remains, the original positions are no longer available from that list.

The leading zero also matters as a displayed digit. In [0,7,2,1], the first position contains 0; it should not be dropped simply because it appears at the beginning. Treating the record as a four-digit display preserves its length and keeps the comparison aligned with the original record. Do not turn it into a shorter number when the task is to compare displayed digits.

From this example, you can infer that the two original tuples have different orders and that their sorted collections are the same. You cannot infer that the original records were identical, that sorting records preserves position, or that these toy tuples establish a rule beyond this comparison. The example says nothing about future results or what might occur next.

A practical reading sequence

First, copy the four displayed digits without changing their order, including any leading zero. Next, identify the comparison being asked for: exact order or unordered digit collection. For exact order, compare the four positions in sequence. For an unordered reading, sort or otherwise compare the digit counts, while clearly noting that positions have been set aside.

When reporting the result, name the type of match. In this hypothetical case, the precise description is: “The tuples differ in exact order, but their sorted digit collections match.” That wording preserves the distinction and avoids treating a shared sorted list as proof that the original records were the same.