# How many messages in the Morse code?

A message in the Morse code is a finite sequence(a word) with dots, dashes and gaps. How many different messages can be made with $7$ dots,$3$ dashes and $2$ gaps? And how many if it is not allowed that the message begins and ends with a gap?

I think that there are $7! \cdot 3! \cdot 2!$ different messages, that can be made with $7$ dots,$3$ dashes and $2$ gaps. Is this correct?

• $7! \cdot 3! \cdot 2!$ is number of messages of length $12$. – hjpotter92 Apr 25 '14 at 12:35
• @hjpotter92 So, is it wrong? I got stuck now. – Mary Star Apr 25 '14 at 12:39
• @hjpotter92, $3^{12}$ is the number of messages of length 12 (including with gaps at the start and at the end). Your suggestion is something else. – werediver Apr 25 '14 at 12:39
• @werediver Could you give me a hint? – Mary Star Apr 25 '14 at 12:40
• @hjpotter92 Do we not want a message of length $12$? Could we for example use only one dot? – Mary Star Apr 25 '14 at 12:41

The number of ways of arranging 12 different objects is $12!$. However, in this case you have $7$ dots amonth those 12 objects which are all considered the same, $3$ dashes which are all considered the same, and $2$ gaps which are both considered the same.

For any given order of dots, dashes, and gaps, there are $7!$ ways you could put on order on the dots, $3!$ ways you could put an order on the dashes, and $2!$ ways you could put an order on the gaps. That means $$\text{[Number of possible messages]} \cdot 7! \cdot 3! \cdot 2! = 12!$$ because after you've put an ordering on the dashes, dots, and gaps, you get an ordering of $12$ distinct objects, and there are $12!$ such orderings.

I don't think I've explained this too well...

• I haven't understood why it is $[\text{ Number of possible messages}] \cdot 7! \cdot 3! \cdot 2!=12!$.Could you explain it further to me? – Mary Star Apr 25 '14 at 13:05
• @MaryStar Consider any message of 7 dots (.), 3 dashes (-), and 2 gaps (_). It might look something like ..-.-_..-._.. There are $12!$ total ways of arranging 12 symbols, but since the order of the individual dots doesn't matter, you have to divide by $7!$ for $7$ dots. Similarly you have to divide by $3!$ and $2!$ because the order of the dashes and the order of the gaps doesn't matter. – 6005 Apr 25 '14 at 13:16
• I understand. And what can I do to find how many different messages can be made, if it is not allowed that the message begins and ends with a gap? – Mary Star Apr 25 '14 at 13:22
• Count the ways a message can begin and end with a gap. Since the two gaps have to be at the start and end, you just have to rearrange the 10 symbols in the middle. Then since you have the number of ways of making a message which does begin and end with a gap, and you have the number of ways of making any message, you just have to subtract the two to find the number of ways of making a message which does not begin and end with a gap. – 6005 Apr 25 '14 at 13:25
• So, is the answer: $$\frac{12!}{7! \cdot 3! \cdot 2!}-\frac{10!}{7! \cdot 3!}$$? – Mary Star Apr 25 '14 at 13:29

Hint: Can the gaps go at the ends? Probably not, so choose where the two gaps go among the twelve slots. Then choose where the dashes go among the rest.