Question

In: Advanced Math

5. Ternary strings. A ternary string is a word from the alphabet {0,1,2}{0,1,2}. For example, 022101022101...

5. Ternary strings. A ternary string is a word from the alphabet {0,1,2}{0,1,2}. For example, 022101022101 is a ternary string of length 6.

(a) Enumerate all ternary strings of length 2.
(b) Generalize: how many ternary strings have length r?
(c) A ternary string of length 6 is to be made. How many ways can we choose how many 0's, 1's, and 2's to include in the string?
(d) A ternary string of length 6 is to have two 0's, a 1, and three 2's. How many strings have this property?
(e) What is the probability that a ternary string of length 6 has two 0's, a 1, and three 2's?

Solutions

Expert Solution


Related Solutions

Recall that a 5-bit string is a bit strings of length 5, and a bit string...
Recall that a 5-bit string is a bit strings of length 5, and a bit string of weight 3, say, is one with exactly three 1’s. a. How many 5-bit strings are there? b. How many 5-bit strings have weight 0? c. How many 5-bit strings have weight 1? d. How many 5-bit strings have weight 2? e. How many 5-bit strings have weight 4? f. How many 5-bit strings have weight 5? g. How many 5-bit strings have weight...
For simplicity, you can consider DNA sequences as strings in the alphabet of {A, C, G,...
For simplicity, you can consider DNA sequences as strings in the alphabet of {A, C, G, T}. Implement a special hash table to store all short DNA segments of certain length (e.g., 20) found in a long DNA sequence. Every DNA segment is stored as a (key, value) pair, where the key is the sequence of the segment, and the value is the position of the segment in the DNA. For example given a DNA sequence of ACGTACGTTT, there are...
If we create a 5 digit bit string that is randomly generated, all strings equally likely......
If we create a 5 digit bit string that is randomly generated, all strings equally likely... 1. possibility of string containing three consecutive zeroes? 2. conditional probability of it containing three consecutive zeroes where first number is a one?
Suppose that you pick a bit string from the set of all bit strings of length...
Suppose that you pick a bit string from the set of all bit strings of length ten. Find the probability that the bit string has exactly two 1s; the bit string begins and ends with 0; the bit string has the sum of its digits equal to seven; the bit string has more 0s than 1s; the bit string has exactly two 1s, given that the string begins with a 1.
Suppose that you pick a bit string from the set of all bit strings of length...
Suppose that you pick a bit string from the set of all bit strings of length ten. Find the probability that the bit string has exactly two 1s; the bit string begins and ends with 0; the bit string has the sum of its digits equal to seven; the bit string has more 0s than 1s; the bit string has exactly two 1s, given that the string begins with a 1.
Java programming problem: For simplicity, you can consider DNA sequences as strings in the alphabet of...
Java programming problem: For simplicity, you can consider DNA sequences as strings in the alphabet of {A, C, G, T}. Implement a special hash table to store all short DNA segments of certain length (e.g., 20) found in a long DNA sequence. Every DNA segment is stored as a (key, value) pair, where the key is the sequence of the segment, and the value is the position of the segment in the DNA. For example given a DNA sequence of...
Draw PDA transition diagram for the following language: The set of strings over the alphabet {x,...
Draw PDA transition diagram for the following language: The set of strings over the alphabet {x, y} where 2 * (# of x's) = 3 * (#y's) That is, if we let nx be the number of x's and ny be the number of y's, then the strings in these language are those where 2nx = 3ny Try to find a PDA that is as simple and elegant as possible (do not convert from CFG). ------------------------------------------------------------------------------------------------------------------ USE Notation between transition:...
6.6 Parsing strings (Java) (1) Prompt the user for a string that contains two strings separated...
6.6 Parsing strings (Java) (1) Prompt the user for a string that contains two strings separated by a comma. (1 pt) Examples of strings that can be accepted: Jill, Allen Jill , Allen Jill,Allen Ex: Enter input string: Jill, Allen (2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts)...
14.6. Say that a string x overlaps a string y if there exist strings p, q,...
14.6. Say that a string x overlaps a string y if there exist strings p, q, r such that x = pq and y = qr, with q ̸= λ. For example, abcde overlaps cdefg, but does not overlap bcd or cdab. (a) Draw the overlap relation for the four strings of length 2 over the alphabet {a, b}. (b) Is overlap reflexive? Why or why not? (c) Is overlap symmetric? Why or why not? (d) Is overlap transitive? Why...
Java RECURSIVE methods: => intersection(String s1, String s2): takes two strings and returns the string consisting...
Java RECURSIVE methods: => intersection(String s1, String s2): takes two strings and returns the string consisting of all letters that appear in both s1 and s2. => union(String s1, String s2): takes two strings and returns the string consisting of all letters that appear in either s1 or s2. =>difference(String s1, String s2): takes two strings and returns the string consisting of all letters that appear only in s1.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT