Question

Consider passwords of length 8 using symbols from the set of lower case letters: {a, b,...

Consider passwords of length 8 using symbols from the set of lower case letters: {a, b, c, ..., z}.

(a) How many such passwords use the letter p exactly two times and the letter q exactly two times? To illustrate, both akpqbqop and quaqpoop satisfy this condition. Include a brief indication of your strategy.

(b) How many such passwords use the letter p exactly once and the letter q exactly once and also have letters arranged so the p is not next to the q? To illustrate, we want to count passwords like amkquoop but not moopguzz or whaqpodo since these have the symbol p next to the q. Include a brief indication of your strategy.

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

SOLUTION

a) For a password that contains 'p' exactly 2 times and q exactly 2 times, this means that the other 4 letters of the password are made of the 24 other letters (i.e the alphabet not including p and q).

How many 4 letter passwords can we make with 24 letters?

This is given by (24)4 because there are 24 choices for each of the four places in the password.

Now, how can we add the p's and q's into each of these choices

Now, let us place the two letter 'p's into the password. There are 5 locations we can place the first 'p' in- before the first letter of our earlier 4 letter password, between the first and second, between second and third, b/w third and fourth and after the fourth letter. Now that we have a five-letter password, the second 'p' has 6 locations where it can be placed in. Does this mean that that for each of our earlier 4 letter passwords, there are 5*6=30 ways we can add the two p's? Remember that while doing so, we would be counting each password twice because the two p's are indistinguishable. Therefore, there are 30/2=15 unique six letter passwords that we can make from each 4 letter password.

Similarly, we can now add the q's.  There are 7 places to add the first q into the six letter password and 8 places to add the second after adding the first.So. there are 7*8/2=28 unique 8 letter passwords we can make from the six letter password.

This means that the total number of 8 letter passwords containing 2 p's and 2 q's is:

(24)4 × 15 × 28-139345920

b) We want a password with exactly one p and one q. So, there are six letters in the password that is not p or q.

The number of ways to get such a six letter password are 24)6 because there are 24 choices for each of the six places in the password.

Now, there are seven locations in this six letter password where we can add additional letters - before the first letter, b/w the first and second and so on.

We are stipulated that the p and q must not be adjacent. So, if we choose one of these seven locations to place the p, we must place the q in one of the other six locations.

Hence, the number of ways we can add exactly one p and exactly one q to the six letter password to make an eight letter password where the p and q are not adjacent is given by 7*6=42.

Therefore, the total number of passwords satisfying the conditions is:

(24) × 42= 8026324992

Add a comment
Know the answer?
Add Answer to:
Consider passwords of length 8 using symbols from the set of lower case letters: {a, b,...
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
  • Use python! Average length to an ATG Please put all of your code for this problem...

    Use python! Average length to an ATG Please put all of your code for this problem in a file called lengthTOATG.py Let's assume that we have a long DNA sequence in which each symbol is random and equally likely to be an A, C, T, or G. We'd like to determine the average number of symbols until we see the first occurrence of a start codon "ATG" Once you've written a function to compute this, you'll do the same thing...

  • Two words or phrases in English are anagrams if their letters (and only their letters), rearranged,...

    Two words or phrases in English are anagrams if their letters (and only their letters), rearranged, are the same. We assume that upper and lower case are indistinguishable, and punctuation and spaces don't count. Two phrases are anagrams if they contain exactly the same number of exactly the same letters, e.g., 3 A's, 0 B's, 2 C's, and so forth. Some examples and non-examples of regular anagrams: * The eyes / they see (yes) * moo / mo (no) *...

  • (b.) Huffman code is a way to encode information using variable-length binary strings to represent symbols depending on the frequency of each individual letter. Specifically, letters that appear more...

    (b.) Huffman code is a way to encode information using variable-length binary strings to represent symbols depending on the frequency of each individual letter. Specifically, letters that appear more frequently can be encoded into strings of shorter lengths, while rarer letters can be turned into longer binary strings. On average, Huffman code is a more efficient way to encode a message as the number of bits in the output string will be shorter than if a fixed-length code was used....

  • Alice told Bob that, in any English text it is equally likely to have letters from the set V and ...

    Alice told Bob that, in any English text it is equally likely to have letters from the set V and from the set C that are defined below: V = {A, a,E, e,I, i, O, o, U, u}, C = {B, b, C, c, . . . , Y, y, Z, z}. Note that the entries of C are all the letters of the English alphabet (upper-case and lower-case) which are not included in V. Bob was not convinced that...

  • Consider the two strings "doggie dish" and "Drip coffee". What letters do they have in common?...

    Consider the two strings "doggie dish" and "Drip coffee". What letters do they have in common? That is, what is the letter intersection count for the pair of strings? Let's look at 'd' first. The first string has 2 d's (d's occurrence count is 2), while the second has just 1 d (capitalization doesn't count) - so the intersection for the strings for d is 1. What about g? There the occurrence counts are 2 and 0, so the intersection...

  • 6.15 Program 6: Using Arrays to Count Letters in Text 1. Introduction In this program, you...

    6.15 Program 6: Using Arrays to Count Letters in Text 1. Introduction In this program, you will practice working with arrays. Your program will read lines of text from the keyboard and use an array to track the number of times each letter occurs in the input text. You will use the contents of this array to generate a histogram (bar graph) indicating the relative frequencies of each letter entered. Test cases are available in this document. Remember, in addition...

  • drug mainions and medical error many of which are the percase letters your ability to provide...

    drug mainions and medical error many of which are the percase letters your ability to provide high-quality patienter Throughout this book the pronunciation and m isspelled out phonetically in modern as to show you exactly how the tem p o The word part to be emphasized how For example. pulmonary phonetically written PUL-moh-narees and pulmonology is written Pulmo NOL-ohjee. This states that wonds derived from the came root can have their emphasis placed on different parts of the word, and...

  • **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the...

    **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the creatures from the classic science-fiction film "The Day of the Triffids") is an algorithm that enciphers a plaintext message by encoding each letter as a three-digit number and then breaking up and rearranging the digits from each letter's encoded form. For this assignment, you will create a set of Python functions that can encode messages using this cipher (these functions...

  • ****************************************************************************************************************8 I want it same as the output and with details please and comments "For two...

    ****************************************************************************************************************8 I want it same as the output and with details please and comments "For two thousand years, codemakers have fought to preserve secrets while codebreakers have tried their best to reveal them." - taken from Code Book, The Evolution of Secrecy from Mary, Queen of Scots to Quantum Cryptography by Simon Singh. The idea for this machine problem came from this book.You will encrypt and decrypt some messages using a simplified version of a code in the book. The...

  • I need help with this code, I'm stuck on it, please remember step 4, I'm very...

    I need help with this code, I'm stuck on it, please remember step 4, I'm very much stuck on that part. It says something about putting how many times it appears Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...

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
ADVERTISEMENT