Solution to Consider all strings of length 12, consisting of all uppercase letters. Letters may be repeated. … - Sikademy
Author Image

Archangel Macsika

Consider all strings of length 12, consisting of all uppercase letters. Letters may be repeated. Please do not simplify your answers. (a) How many such strings are there? (b) How many such strings contain the word ”SCOOBY”? (c) How many such strings contain neither the word ”SCOOBY” nor the word ”DAPHNE”?

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question

(a)There are 26 letters from which we choose, order of characters in strings is important and we can repeat same characters in one string, so we have 26 variants for all of 12 characters of string, so exist 2612 strings.

(b)At first consider number of strings, which begins with SCOOBY. Since remained length of string is 6 and we can place any combination of 6 letters after SCOOBY, there are 266 strings which begins with SCOOBY. We start substring SCOOBY from any position from 1 to 7, so there are 7*266 variants, but now we count string SCOOBYSCOOBY twice, first time we place substring in first position, second - in in seventh, so answer is 7*266-1.

(c)If we need to now how many strings don't contain specific word, we can count how many string contain specific word and substract this number from number of all strings.

As we already counted, 7*266-1 strings contain word SCOOBY. Since length word DAPHNE is same as length of world SCOOBY, number of strings, which contain word DAPHNE is also 7*26-1. But we cannot simply add this numbers, to obtain number of strings which contain word SCOOBY or DAPHNE, because some strings can contain both words and this strings will be counted twice. There are two strings which contain both words - SCOOBYDAPHNE and DAPHNESCOOBY, so number of strings which contains word SCOOBY or word DAPHNE is 14*266-4. Knowing number of strings which contains at least one of words SCOOBY and DAPHNE we obtain number of strings which contain neither of them substracting their number from number of all strings, which gives us 2612-14*266+4=266(266-14)+4


Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-5-stid-8-sqid-1126-qpid-864