                    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)


/*REXX pgm finds one or more missing permutations from an internal list & displays them.*/
list= 'ABCD CABD ACDB DACB BCDA ACBD ADCB CDAB DABC BCAD CADB CDBA CBAD ABDC ADBC BDCA',
      "DCBA BACD BADC BDAC CBDA DBCA DCAB"       /*list that is missing one permutation.*/
@.=                                              /* [↓]  needs to be as long as  THINGS.*/
@abcU = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'             /*an uppercase (Latin/Roman) alphabet. */
things= 4                                        /*number of unique letters to be used. */
bunch = 4                                        /*number letters to be used at a time. */
                 do j=1  for things              /* [↓]  only get a portion of alphabet.*/
                 $.j= substr(@abcU, j, 1)        /*extract just one letter from alphabet*/
                 end   /*j*/                     /* [↑]  build a letter array for speed.*/
call permSet 1                                   /*invoke PERMSET subroutine recursively*/
exit                                             /*stick a fork in it,  we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
permSet: procedure expose $. @. bunch list things; parse arg ? /*calls self recursively.*/
         if ?>bunch  then do;  _=
                                   do m=1  for bunch           /*build a permutation.   */
                                   _= _  ||  @.m               /*add permutation──►list.*/
                                   end   /*m*/
                                                               /* [↓]  is in the list?  */
                          if wordpos(_,list)==0  then say _  ' is missing from the list.'
                          end
                     else do x=1  for things                   /*build a permutation.   */
                                   do k=1  for ?-1
                                   if @.k==$.x  then iterate x /*was permutation built? */
                                   end  /*k*/
                          @.?= $.x                             /*define as being built. */
                          call permSet  ?+1                    /*call self recursively. */
                          end   /*x*/
         return