Give the following problem:
Design a Turing Machine such that given string from the alphabet $\{a, b, c, d\}$, produces on the tape a combination of the string "abcd" in which each symbol occupies the position coresponding to the relative order of it's absolute frequency in the entered/given string. The combination is to be displayed in descending order. In the case of coinciding frequencies, the symbols are to be located in inversed order of appearance en the entry string. For example, the string $\underline{\triangle} a b a d c d a b c a a \triangle \triangle ...$ must produce the output $\underline{\triangle} a c d b \triangle \triangle ...$
Note:
The $\triangle$ represents an "empty" character and _ the position of the reading head.
I have not encountered any problems related to this so I am not sure to proceed.
But if I am correct, I would need to use the counting Turing Machine and possibly a programming technique such as multiple tapes. Would that be necessary?
How do I go about designing such a machine?