Find the missing permutation: Difference between revisions
Content deleted Content added
→{{header|Lua}}: shortened |
m rearranged the placement of the permutation list, added bullet points for the three methods, added whitespace and highlighting to the task's preamble, added a ;Related task: (bold) header, changed verb tense. |
||
Line 1:
{{task}}
Find that missing permutation.▼
(cf. [[Permutations]])▼
There is an alternate method. ▼
ABCD
Hint : if all permutations were here, ▼
how many times would A appear in each position ? ▼
What is the parity of this number ?▼
There is another alternate method.▼
Hint: if you add up the letter values of each column, does a missing letter A, B, C, D ▼
from each column cause the total value for each column to be unique?▼
▲<pre>ABCD
CABD
ACDB
Line 40 ⟶ 24:
CBDA
DBCA
DCAB
</pre>
Listed above are all of the permutations of the symbols '''A''', '''B''', '''C''', and '''D''', ''except'' for one permutation that's ''not'' listed.
;Task:
▲Find that missing permutation.
;Methods:
* Obvious method:
enumerate all permutations of '''A''', '''B''', '''C''', and '''D''',
and then look for the missing permutation.
does a missing letter '''A''', '''B''', '''C''', and '''D''' from each
;Related task:
<br><br>
=={{header|360 Assembly}}==
|