A nice mathematical sentence! Here's the translation to English:
"Two lists are equal, up to the ordering of their elements, if and only if they have the same sorting."
Or, in a slightly more idiomatic and natural-sounding English:
"Two lists are identical except for the order of their elements if and only if they have the same sorted sequence."
Let's break down the original German sentence to understand the nuances:
- "Zwei Listen sind genau dann ... gleich" means "Two lists are equal, precisely/ exactly then..." (The "genau dann" is a strong indication of an "if and only if" condition, often abbreviated as "iff" in mathematical contexts.)
- "... bis auf die Anordnung ihrer Elemente" is an idiomatic expression meaning "up to the arrangement/ordering of their elements". In English, we often say "up to" to indicate that we're ignoring a certain aspect (in this case, the order). It's equivalent to saying "except for the order of their elements" or "disregarding the order of their elements".
- "... wenn sie die gleiche Sortierung haben" means "if they have the same sorting" (where "Sortierung" is the nominalized form of "sortieren", to sort).
The sentence essentially says that two lists are considered equivalent (in terms of the elements they contain, not their order) if and only if sorting both lists results in the same sequence. This captures the idea that the order of elements doesn't matter; what matters is whether both lists contain exactly the same elements.
Formally, if you have two lists A = [a1, a2, ..., an] and B = [b1, b2, ..., bm], they are equal "bis auf die Anordnung ihrer Elemente" (or in English, "equal up to permutation") if:
- They have the same number of elements (
n = m), and
sorted(A) == sorted(B), where sorted() denotes the operation of sorting the list in a defined order (e.g., ascending).
Example:
- List 1:
[3, 2, 1]
- List 2:
[1, 3, 2]
Both lists are equal up to the ordering of their elements because sorted(List1) = [1, 2, 3] and sorted(List2) = [1, 2, 3] are identical.
Hope this helps clarify the translation and the underlying mathematical concept!