                    ABCD
                    CABD
                    ACDB
                    DACB
                    BCDA
                    ACBD
                    ADCB
                    CDAB
                    DABC
                    BCAD
                    CADB
                    CDBA
                    CBAD
                    ABDC
                    ADBC
                    BDCA
                    DCBA
                    BACD
                    BADC
                    BDAC
                    CBDA
                    DBCA
                    DCAB

Listed above are   all-but-one   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. 

 alternate method:
        Hint:  if all permutations were shown above,  how many 
        times would  A  appear in each position?     
        What is the  parity  of this number?

 another alternate method:
        Hint:  if you add up the letter values of each column, 
        does a missing letter   A,  B,  C,  and  D   from each
        column cause the total value for each column to be unique?



Related task

   Permutations)


' version 30-03-2017
' compile with: fbc -s console
 
Data "ABCD", "CABD", "ACDB", "DACB", "BCDA", "ACBD"
Data "ADCB", "CDAB", "DABC", "BCAD", "CADB", "CDBA"
Data "CBAD", "ABDC", "ADBC", "BDCA", "DCBA", "BACD"
Data "BADC", "BDAC", "CBDA", "DBCA", "DCAB"
 
' ------=< MAIN >=------
 
Dim As ulong total(3, Asc("A") To Asc("D"))  ' total(0 to 3, 65 to 68)
Dim As ULong i, j, n = 24 \ 4   ' n! \ n
Dim As String tmp
 
For i = 1 To 23
    Read tmp
    For j = 0 To 3
        total(j, tmp[j]) += 1
    Next
Next
 
tmp = Space(4)
For i = 0 To 3
    For j = Asc("A") To Asc("D")
        If total(i, j) <> n Then
         tmp[i] = j
        End If
    Next
Next
 
Print "The missing permutation is : "; tmp
 
' empty keyboard buffer
While InKey <> "" : Wend
Print : Print "hit any key to end program"
Sleep
End