Question

In: Computer Science

A password is a string of ten characters, where each character is a lowercase letter, a...

A password is a string of ten characters, where each character is a lowercase letter, a digit, or one of the eight special characters !, @, #, $, %, &, (, and ). A password is called awesome, if it contains at least one digit or at least one special character. Determine the number of awesome passwords.

Solutions

Expert Solution

Given,

1. password has 10 characters.
2. Number of lowercase letters = 26
3. Number of Digits = 10
4. Number of special characters = 8

This problem is as example of Inclusion - Exclusion principle.

We have 10 positions. Each of those positions can be occupied by any of
the 44(26 + 10 + 8) choices available.

Totally we 44 * 44 * 44 * 44 * 44 *44 * 44 * 44 * 44 * 44 = 44^10.

There are 44^10 different passwords possible with given input.
-------------------------------------------------------------------
Among them is we remove the passwords with NO digit, we get passwords with
atleast one digit.

If we ignore digits, then total possible choices are 26 + 8 = 34.
We have 10 positions available.
So the passwords with NO digits are = 34^10.

Total passwords with atleast a digit = 44^10 - 34^10 = x (for easiness)
---------------------------------------------------------------------
Similarly, if we remove the passwords with NO characters, we get passwords with
atleast one character.

If we ignore characters, then total possible choices are 26 + 10 = 36.
We have 10 positions available.
So the passwords with NO character are = 36^10.

Total passwords with atleast a character = 44^10 - 36^10 = y (for easiness)
----------------------------------------------------------------------

Total number of passwords possible with atleast one character OR atleast
one digit = x + y.


Related Solutions

Password consists of five characters: one lowercase letter and four digits 0 – 9. How many...
Password consists of five characters: one lowercase letter and four digits 0 – 9. How many possible combinations for the password are there if digits can be repeated? How many possible combinations for the password are there if digits can not be repeated? What is a percentage of passwords with repeated digits?
A password is a sequence of five characters. Each character is one of twenty-six uppercase letters...
A password is a sequence of five characters. Each character is one of twenty-six uppercase letters (“A” through “Z”), one of ten digits (“0” through “9”), or one of five symbols (“+”, “-”, “!”, “<”, “>”). Count the number of possible passwords that can be created in each of the following scenarios. Consider each part of this questions separately. (a) There are no restrictions on how the characters are chosen. (b) A password must begin with a letter and end...
Write a method that computes the number of lowercase letters (a-z) characters in a String: The...
Write a method that computes the number of lowercase letters (a-z) characters in a String: The method signature is as follows:  public int count(String s)
The input will be a String with multiple not-always-lowercase directions separated by underscores. The last character...
The input will be a String with multiple not-always-lowercase directions separated by underscores. The last character of the input is always an underscore. You must output the final (x, y) coordinates of a robot, starting at (0, 0), after it has followed all of the directions. Print the result in the format “Result: (x, y)” USE THE SKELETON PROGRAM PROVIDED. Example #1: INPUT: up_down_left_down_down_ Result: (-1, -2) up --move→ y + 1 = 1 down --move→ y - 1 =...
For this question, a block is a sequence of 20 characters, where each character is one...
For this question, a block is a sequence of 20 characters, where each character is one of the 26 lowercase letters a-z. For example, these are blocks: iwpiybhunrplsovrowyt rpulxfsqrixjhrtjmcrr fxfpwdhwgxtdaqtmxmlf How many different blocks are there? A block is squarefree if no character appears two times consecutively. The first and third example above are squarefree, but the second example is not because of the two consecutive occurrences of r. How many squarefree blocks are there? A block is non-local if...
An online account password for a certain website consists of eight characters, where at least one...
An online account password for a certain website consists of eight characters, where at least one must be a digit (i.e. a number from 0-9). a. How many different passwords are possible if only lowercase letters and digits can be used? b. How many different passwords are possible if a user wants to include single capital letter somewhere in their password? c. If a computer program randomly generates eight characters (such that each could be either a digit or any...
Think of a password 8 character long which uses at last one lower-case letter, one capital...
Think of a password 8 character long which uses at last one lower-case letter, one capital letter, and one number, but uses none more than once. What's your password? How many possible permutations are there for an 8 character password which meets those criteria? How many fewer combinations without regard to order are there for an 8 character password which meets those requirements. How would you calculate how many permutations there are for an 8 to 12 character password which...
In an exactly 8 character long password where capital letters, small letters, and digits (0 to...
In an exactly 8 character long password where capital letters, small letters, and digits (0 to 9) must be used. Regardless of the order, how many passwords will use exactly 5 ones, 4 twos, and one Z?
1). The set of all string consisting of an uppercase letter followed by zero or more additional characters, each of which is either an uppercase letter or one of the digits 0 through 9.
For this problem, Give a BNF grammar for each of the descriptions below. show that you can get a number of positive examples of the language in the constructed grammar and also show that you are not able to get a set of negative examples in the grammar. Create a parse tree for the grammar after. 1). The set of all string consisting of an uppercase letter followed by zero or more additional characters, each of which is either an...
A hacker has programmed their computer to generate, uniformly at random, an eight-character password, with each...
A hacker has programmed their computer to generate, uniformly at random, an eight-character password, with each character being either one of 26 lower-case letters (a-z), one of 26 upper-case letters (A-Z) or one of 10 integers (0-9). The hacker wants to infiltrate a website that has 2 million users. Assume, for simplicity, that each user is required to use a unique password. What is the expected number of attempts before the hacker successfully generates a user password? What is the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT