a) password cannot have a number character.
b) password must have exactly 1-pound (#) character that is not at the beginning or end of a variable name.
c) password must have at least one number.
2. Alison has 10 bananas and 15 pineapples. He realized that he only can eat 6 fruits today. If she does not care about the order each fruit has to be eaten, how many ways are there to eat the fruits if:
In the solution I am going to be using permutation and combinations, the formula for
nPr is = (n!)/(n-r)!
The formula for nCr is (n!)/(r!)(n-r)!
1)
Number of upper case letters = 26
Number of lower case letters = 26
Number of number characters = 10
Plus one pound sign can be used.
a) We cannot use number characters -
Total characters we can use = 26 (Upper case) + 26 (lower case) + 1 (pound sign) = 53
So we need to place 53 characters in 8 places, where order matters -
This comes out to be 53P8 = 53*52*51*50*49*48*47*46 = 35736531667200
b)
We need to place pound sign but not at first or last position.
Total ways to place pound sign - 6
In remaining 7 positions, we need to place letters (52) + numbers (10) = 62.
Total ways to arrange in remaining positions = 62P7 = 62*61*....*56 = 2478652606080
Total ways to arrange all 8 characters = 6 * 62P7 = 14871915636480
c) Atleast one number needs to be present =
Number of ways to create using all characters - Number of ways to create using no number
= 63P8 - 35736531667200 (Answer from part a)
= 120418582515840
2)
a) To have total of 6 fruits while having atleast as many pineapples as bananas, Alison can have -
3 pineapples, 3 bananas
4 pineapples, 2 bananas
5 pineapples, 1 bananas
6 pineapples, 0 bananas
Total pineapples = 15
Total bananas = 10
Total ways to select x pineapples = 10Cx
Total ways to select x bananas = 15Cx
total ways to do this , we multiply total ways to find x bananas and y pineapples (multiplication rule)
10C3*15C3 + 10C4*15C2 + 10C5*15C1 + 10C6*15C0
= 80640 after calculating.
b)
She needs to eat 3 bananas and 3 pineapples, but it is given that she needs to eat the pineapple first-
So we need to eat 3 more bananas and 2 more pineapples after the first pineapple-
Number of ways to select the first pineapple - 15 (as there are 15 pineapples we have 15 choices)
Remaining 14 pineapples we select 2 more = 14C2 ways.
From 10 bananas we select 3 = 10C3 ways
Total ways = 15*14C2*10C3 = 163800
Get Answers For Free
Most questions answered within 1 hours.