                    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)


*        Find the missing permutation - 19/10/2015
PERMMISX CSECT
         USING  PERMMISX,R15       set base register
         LA     R4,0               i=0
         LA     R6,1               step
         LA     R7,23              to
LOOPI    BXH    R4,R6,ELOOPI       do i=1 to hbound(perms)
         LA     R5,0               j=0
         LA     R8,1               step
         LA     R9,4               to
LOOPJ    BXH    R5,R8,ELOOPJ       do j=1 to hbound(miss)
         LR     R1,R4              i
         SLA    R1,2               *4
         LA     R3,PERMS-5(R1)     @perms(i)
         AR     R3,R5              j
         LA     R2,MISS-1(R5)      @miss(j)
         XC     0(1,R2),0(R3)      miss(j)=miss(j) xor substr(perms(i),j,1)
         B      LOOPJ
ELOOPJ   B      LOOPI
ELOOPI   XPRNT  MISS,15            print buffer
         XR     R15,R15            set return code
         BR     R14                return to caller
PERMS    DC     C'ABCD',C'CABD',C'ACDB',C'DACB',C'BCDA',C'ACBD'
         DC     C'ADCB',C'CDAB',C'DABC',C'BCAD',C'CADB',C'CDBA'
         DC     C'CBAD',C'ABDC',C'ADBC',C'BDCA',C'DCBA',C'BACD'
         DC     C'BADC',C'BDAC',C'CBDA',C'DBCA',C'DCAB'
MISS     DC     4XL1'00',C' is missing'  buffer
         YREGS
         END    PERMMISX