88.2k views
3 votes
Suppose you want to make a password using exactly 4 out of the 6 letters: e, t, a, b, p, k. You do not want to repeat any letter. Only lower-case letters are used. Provide the code that you would use in R to answer how many different passwords can be created.

1 Answer

6 votes

Answer:

15 different passwords.

Explanation:

Since I need to make a password of 4 letters from 6 given letters without repeating any letters, this can be done using combination.

Combination has to do with selection of some object from a pool of many objects.

Generally, if r objects are to be selected from a pool of n objects, this can be done in nCr number of ways where:

nCr = n!/(n-r)!r!

Applying the formula, if 4 letters are to be selected from 6 letters, this can be done in 6C4 ways

6C4 = 6!/(6-4)!4!

= 6!/2!4!

= 6×5×4!/2×4!

= 6×5/2

= 15ways

This shows that I can use 15 different passwords without repeating any letter

User Jonathan Wright
by
7.9k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories