2
$\begingroup$

Assume that we have $52$ characters; $26+26$ lowercase and uppercase letters.

We want to create passwords of eight characters long.

There are two conditions

  • The letter I (uppercase i) has to be included.
  • Characters may appear only once.

So, for instance "aaaaaaIaa" is illegal, however "aIbcdefgh" is OK.

My solution:

Since no character may be duplicated and the string must contain at least one I , we have the following basic forms:

I********

*I*******

**I******

***I*****

****I****

*****I***

******I**

********I

Then the possible combination would be $ 8*Perm_{7}(51) = 8* \frac{51!}{(51-7)!} $

Is that correct ?

$\endgroup$
3
  • $\begingroup$ Your question is not clear. $\endgroup$ Commented Jan 21, 2017 at 14:29
  • $\begingroup$ How many passwords consisting of eight characters contain only upper- And lowercase letters, at least once the uppercase letter I and none Char multiple times? $\endgroup$
    – Mohbenay
    Commented Jan 21, 2017 at 14:36
  • $\begingroup$ it need to be multiplied with 8! i think $\endgroup$
    – Kiran
    Commented Jan 21, 2017 at 14:59

3 Answers 3

1
$\begingroup$

Include 'I', select $7$ characters and them permute the $8$ letters. So,

Number of possible passwords
$=\dbinom{51}{7}\times 8!$


Proof: Take a small example. Suppose we have the letters (a,b,c,d) to select from and we are counting the possible arrangements of $3$ letters where c must be come in each arrangement.

According to the same principle used, $\dbinom{3}{2} \times 3!=18$ arrangements are possible. These are

abc,acb,bac,bca,cab,cba
acd,adc,cad,cda,dac,dca
bcd,bdc,cbd,cdb,dbc,dcb

Accoding to some other answers, it must be $\dbinom{3}{2} \times 3=9$ which is clearly not the right way of approaching this problem.

$\endgroup$
5
  • $\begingroup$ It should be not 8! as we have to place I in any place and we have 8 ways. Not 8! $\endgroup$ Commented Jan 21, 2017 at 16:27
  • $\begingroup$ @KanwaljitSingh, see my edit. I tried with a small example and I think my answer is right. $\endgroup$
    – Kiran
    Commented Jan 21, 2017 at 17:24
  • 1
    $\begingroup$ @Kiran Yes, it's right. $\endgroup$
    – egreg
    Commented Jan 21, 2017 at 21:57
  • $\begingroup$ The difference is that you are using combination and I am using permutation. So both are right. $\endgroup$ Commented Jan 22, 2017 at 4:09
  • $\begingroup$ To make it absolutely clear: $8! = 8\cdot7!$ and $8!\cdot\binom{51}{51-7} = 8!\cdot\frac{51!}{7!(51-7)!} = 8\cdot\frac{51!}{(51-7)!}$ $\endgroup$
    – Dario
    Commented Jan 22, 2017 at 21:03
0
$\begingroup$

Yes you are correct.

Number of ways = $8 \times \frac{51!}{(51-7)!}$

$\endgroup$
0
$\begingroup$

Your solution is correct.

Multiplying with $8$ is OK, and the "basic forms" are OK. The question remains: How many possibilities are there to place the $51$ remaining characters in to the $7$ remaining places.

The first place can filled with $51$ characters, the second can be filled with only $50$ characters, ..., and finally the seventh place can be filled with the remaining $45$ characters.

So, the total number is

$$8\times 51\times 50\times \cdots \times 45\approx 4.7\times 10^{12}.$$


EDIT

There have been tow approaches to the same problem.

Problem

There are $n$ different symbols and $k$ slots to place them ($k<n$).

One of the symbols (the obligatory symbol) has a special role: it has to be part of all the arrangements. The other condition is that one symbol may appears only once.

Approach 1

One can place the obligatory symbol first. It may appear in $k$ different slots. As a result the the remaining $n-1$ symbols will have to be placed in the remaining $k-1$ slots. So the solution is

$$k\times(n-1)(n-2)\cdots (n-k+1).$$

If $n=52$ and $k=8$ then the result is

$$8\times 51\times 50\times 49 \times \cdots 45\approx 4.7\times 10^{12}$$

Approach 2

First we select $k-1$ symbols out of the $n-1$ ones and then multiply the resulting number with the possible orderings of the $k$ symbols (the obligatory one + the $k-1$ ones chosen.) The total is

$$\binom {n-1}{k-1}k!.$$

In our case the result is again $\binom{51}7\times 8!\approx 4.7\times 10^{12}$.

$\endgroup$
7
  • $\begingroup$ sorry am i not correct ? $\endgroup$
    – Mohbenay
    Commented Jan 21, 2017 at 14:58
  • $\begingroup$ My Result is the same is yours , $\endgroup$
    – Mohbenay
    Commented Jan 21, 2017 at 14:58
  • $\begingroup$ $ \frac{51!}{(51-7)!} = \frac{51!}{44!} = 51 50...45 $ $\endgroup$
    – Mohbenay
    Commented Jan 21, 2017 at 15:00
  • $\begingroup$ it is 8! and not 8 in my opinion $\endgroup$
    – Kiran
    Commented Jan 21, 2017 at 15:00
  • $\begingroup$ why should it be 8! ? $\endgroup$
    – Mohbenay
    Commented Jan 21, 2017 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .