I need help to confirm my answer for the following question
"There is an alphabet of size 40 and this alphabet is used for forming messages in a communication system. If 10 of these alphabets can be used only as the first or last symbols in the message and the rest 30 can be used anywhere, how many messages can be formed if repetition is allowed, The length of the messages is 25 symbols?"
I came up with the following solution for this question = 30^(23) * 1600
If the remaining 30 letters can be used anywhere then you are correct. In this case you have 40 letters available for the first and last symbols and only 30 available for the 23 symbols in between. So, the count is $40^2 \cdot 30^{23}$.
What johannesvalks is answering is if the first and last symbols must come from these 10 special characters. In this case you have 10 letters available for the first and last symbols and still only 30 30 available for the 23 symbols in between. So, the count is $10^2 \cdot 30^{23}$.