The word math has four different letters m, a, t and h. Starting with the first position there are 4 letters that can be placed here, 3 letters can be placed in the 2nd position, 2 letters in the 3rd position and the final letter is placed in the 4th position. This gives the number of ways in which the letters can be re-arranged as 4*3*2*1 = 4! = 24 ways.
According to the question, the position in which the consonants appear should remain the same. The consonants are m, t and h and they should occupy one of the positions 1, 3 and 4. Starting with the 1st position there are 3 consonants that can be placed here, one of the 2 consonants left can be placed in the 3rd position and the final consonant can be placed in the 4th position. The total number of ways in which the consonants can be placed is 3*2*1 = 3! = 6
The required probability is 6/24 = 1/4.