Вы находитесь на странице: 1из 7

Generating Function to solve

Permutation’s Problems
(How it works?)

In this case, we will solve permutation


problem using FPE to modeling the
problem.
This’s the problem!
A code or password with k digit will be
formed by letter a, b , c, with the
requirement below:
1. A use maximal twice
2. B use maximal once
3. C use maximal once

2
We will get the possibility of password that consist :
1. One digit = 3. it is a, b, c
2. Two digits = 7. it is ab, ac, bc, ba, ca, cb, aa
3. Three digits = 12. it is abc, acb, aab, aac, aba, aca,
baa, bac, bca, caa, cab, cba
4. Four digits = 12. it is aabc, abca, abac, aacb, acab,
acba, baac, baca, bcaa, caab, caba, cbaa

3
The requirement of the using of the letters can be
modeled as :
The using of letter a maximal twice :
(𝑎𝑥)0 (𝑎𝑥)1 (𝑎𝑥)2
+ +
0! 1! 2!
The using of letter b maximal once :
(𝑏𝑥)0 (𝑏𝑥)1
+
0! 1!
The using of letter c maximal once :
(𝑐𝑥)0 (𝑐𝑥)1
+
0! 1!

4
The sum of those three models is :

(𝑎𝑥)0 (𝑎𝑥)1 (𝑎𝑥)2 (𝑏𝑥)0 (𝑏𝑥)1 (𝑐𝑥)0 (𝑐𝑥)1


𝑃 𝑥 = + + + +
0! 1! 2! 0! 1! 0! 1!
𝑎2 𝑥 2
= 1 + 𝑎𝑥 + 1 + 𝑏𝑥 1 + 𝑐𝑥
2!
𝑎2 2 𝑎2 𝑏 𝑎2 𝑐 3 𝑎2 𝑏𝑐 4
= 1 + 𝑎 + 𝑏 + 𝑐 𝑥 + 𝑎𝑏 + 𝑎𝑐 + 𝑏𝑐 + 𝑥 + 𝑎𝑏𝑐 + + 𝑥 + 𝑥
2! 2! 2! 3!

5
Suppose that a = b = c = 1 ( it’s mean that a, b, c used
to determine the code). So we get:
7 2 3
1 4
𝑃 𝑥 = 1 + 3𝑥 + 𝑥 + 2𝑥 + 𝑥
2 2
7 𝑥2 𝑥3 1 𝑥4
𝑃 𝑥 = 1 + 3𝑥 + ∙ 2! ∙ + 2 ∙ 3! ∙ + ∙ 4! ∙
2 2! 3! 2 4!
𝑥 𝑥2 𝑥3 𝑥4
𝑃 𝑥 =1 +3 +7 + 12 + 12
1! 2! 3! 4!

6
In the last expression, we get the same numbers as the results of the
previous enumeration, that is:
𝑥1
1. Coefficient 1!
= 3 , stated that there are 3 codes of length 1 digit
𝑥2
2. Coefficient 2!
= 7 , stated that there are 7 codes of length 2 digits
𝑥3
3. Coefficient 3!
= 12 , stated that there are 12 codes of length 3 digits
𝑥4
4. Coefficient 4!
= 12 , stated that there are 12 codes of length 4 digits
𝑥𝑘
So, it can be concluded that the coefficient declare that many codes
𝑘!
or passwords of k digits based on specified conditions.

Вам также может понравиться