65.4k views
2 votes
How many strings of length 5 are there over the alphabet { x , y , z } that either begin with z or end with z ?

1 Answer

6 votes

Answer: 135

Explanation:

Given : The total number of alphabets { x , y , z } = 3

The number of possible strings when the first place is occupied by z:_


1*3*3*3*3=3^4=81

The number of possible strings when the last place is occupied by z:_


3*3*3*3*1=3^4=81

The number of possible strings when the first and the last place is occupied by z:_


1*3*3*3*1=3^3=27

Now, the number of possible strings where either begin with z or end with z:-


81+81-27=135

Hence, the number of strings of length 5 are there over the alphabet { x , y , z } that either begin with z or end with z =135

User Shnatsel
by
7.1k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.