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)
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...
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 =...
Implement the ADT character string as the class LinkedString by using a linked list of characters....
Implement the ADT character string as the class LinkedString by using a linked list of characters. Include the following LinkedString constructors and methods: LinkedString(char[] value) Allocates a new character linked list so that it represents the sequence of characters currently contained in the character array argument. LinkedString(String original) Initializes a new character linked list so that it represents the same sequence of characters as the argument. char charAt(int index) Returns the char value at the specified index. The first character...
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...
C++ Write a program that reads a line of text, changes each uppercase letter to lowercase,...
C++ Write a program that reads a line of text, changes each uppercase letter to lowercase, and places each letter both in a queue and onto a stack. The program should then verify whether the line of text is a palindrome (a set of letters or numbers that is the same whether read forward or backward). Please use a Queue Class and Stack class.
Given a string, write a method called removeRepthat returns another string where adjacent characters that are...
Given a string, write a method called removeRepthat returns another string where adjacent characters that are the same have been reduced to a single character. Test the program by calling the method from the main method. For example: removeRep(“yyzzza”) à “yza” removeRep(“aabbbccd”) à “abcd” removeRep(“122333”) à “123”
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT