Question

I know how to do a) and b) but unsure about c)

Question 3. (5 marks) A language L is defined over a set of three letters {a, b, c}. A string ordering matters (i.e. abc is

c) Number of strings that (do not not contain "cab" or "bac" BUT may contain repeated consecutive letters), OR (strings that do not contain repeated consecutive letters but may contain "cab" or "bac").

0 0
Add a comment Improve this question Transcribed image text
Answer #1

three eter ifa,b,cf Set fo,besfa,te, e b 9epea lid one of tho e Her cam For each et, no. ngs thal can be ereali 4 24 rng tha!

23! Smee, a a aam geaoralo ts am b prealif can Limitanty for etaheandfasb,e, each set h lain 12 ktrngstha have Consecutive s

Only the solution of (c) is provided.

For any doubt comment below.

Add a comment
Know the answer?
Add Answer to:
I know how to do a) and b) but unsure about c) c) Number of strings...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Extra Credit Function Name: anagram Inputs: 1. 2. (char) String representing the anagram (char) Name of...

    Extra Credit Function Name: anagram Inputs: 1. 2. (char) String representing the anagram (char) Name of text file to write to Outputs: none File Outputs: 1. A text file containing all the permutations of the anagram Banned Functions: perms(), permute(), ipermute(), nchoosek (), combnk() Background: You guys know what do. You are professional MATLAB now, you got this! Function Description: Given a string, recursively determine all the unique ways to rearrange the letters. (i.e al the unique permutations). For example,...

  • 2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings Let s be a str...

    2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings Let s be a string. The length or size of a string, denoted Is, is the number of characters in s Let s be a string, and i e N such that 0 < ί < sl. We write s[i] to represent the character of s at index i, where indexing starts at 0 (so s 0] is the first character, and...

  • I need the answer a, b, c. you have to annwer part C must a) A...

    I need the answer a, b, c. you have to annwer part C must a) A password must be 8 characters long and contain only digits and lowercase English letters. How many different passwords contain at least one digit and at least one letter? b) How many different strings of length 10 containing only the letters a, b, and c start or end with a c? c) How many people must be selected to make sure 20 of them were...

  • 4. [6 marks] (Basic Counting) How many bit strings of length 10 contain either five consecutive...

    4. [6 marks] (Basic Counting) How many bit strings of length 10 contain either five consecutive 0s or five consecutive 1s?

  • 2. This question is about processing strings 2.1 [4 marks] Given a string str, we can...

    2. This question is about processing strings 2.1 [4 marks] Given a string str, we can calculate a checksum of the string by summing up the ASCII codes of the characters in the string. For example, the checksum of a string "apple" is 530, which equals to 'a' + 'p' + 'p' + 'l' + 'e' = 97 + 112 + 112 + 108 + 101. Write a function int calculate_checksum(char str[] that calculates and returns the checksum of the...

  • animali 32. How many strings of six lowercase letters from the En- glish alphabet contain IS...

    animali 32. How many strings of six lowercase letters from the En- glish alphabet contain IS a) the letter a? b) the letters a and b? Osadno-o lls i d c) the letters a and b in consecutive positions with a preceding b, with all the letters distinct?) d) the letters a and b, where a is somewhere to the left of b in the string, with all the letters distinct? into

  • a) How many different strings can be made from the word PEPPERCORN when (SHOW WORK &...

    a) How many different strings can be made from the word PEPPERCORN when (SHOW WORK & Explaination) i) all the letters are used? ii) at least 6 of the letters are used? b) How many different strings can be made from the letters in AARDVARK, using all of the letters, if all three As must be consecutive? (SHOW WORK & Explaination) c) How many permuations of the 26 letters of the English alphabet do not contain any of the strings...

  • 2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings. Let s be a stri...

    2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings. Let s be a string. The length or size of a string, denoted Is, is the number of characters in s Let s be a string, and ie N such that 0 Si< Is. We write si] to represent the character of s at index i, where indexing starts at 0 (so s(0 is the first character, and s|s -1 is the...

  • I really need help with the code for this, in C++ please, I know there's a...

    I really need help with the code for this, in C++ please, I know there's a similar question but the answer isn't correct :[ A palindrome is a string that reads the same forwards and backwards (ignoring spaces, punctuation, and capitalization). Examples are the familiar ``If I had a hi-fi,'' the grander ``A man, a plan, a canal, Panama,'' and ``Some men interpret nine memos.'' So the goal: Design, implement, document, and test a program that reads a line of...

  • Discrete math 4. Popeye and Olive Oyl frequently send each other text messages that are just contiguous strings of the three emojis , , and . For instance, one particular length-5 emoji string might b...

    Discrete math 4. Popeye and Olive Oyl frequently send each other text messages that are just contiguous strings of the three emojis , , and . For instance, one particular length-5 emoji string might be e (a) Find a recurrence relation for the number of possible length-n emoji strings that do not contain two consecutive winkey emojis, (b) What are the initial conditions for the recurrence relation? (c) Find a closed-form solution to the recurrence relation you found in part...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT