How many functions f : { 1 , 2 , 3 , … , 1 0 } → { 1 , 2 , 3 , … , 1 0 } are there, such that the greatest common factor of all the numbers in r a n g e ( f ) is 1?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let F be the set of all functions f : { 1 , 2 , 3 , ⋯ , 1 0 } → { 1 , 2 , 3 , ⋯ , 1 0 } . The number of elements in F , by the Rule of Product , is 1 0 1 0 . Let us define A as the set of functions f in F for which the greatest common factor of the numbers in r a n g e ( f ) is 1. For any natural number n , we can define B n as the set of all functions f in F such that all the numbers in r a n g e ( f ) are divisible by n . It is clear that if n > 1 0 , then B n = ∅ . In what follows, we are going to denote the cardinality of an arbitrary set C by ∣ C ∣ . Then using the Rule of Product, it is not difficult to get the following: ∣ B 2 ∣ = 5 1 0 , ∣ B 3 ∣ = 3 1 0 , ∣ B 5 ∣ = 2 1 0 , ∣ B 6 ∣ = ∣ B 7 ∣ = ∣ B 1 0 ∣ = 1 ( 1 ) Additionally, it can be proved that if m and n are two prime numbers less than 10 then B n ∩ B m = B m × n . ( 2 ) A similar property applies for more than two primes. For example, B 2 ∩ B 3 ∩ B 5 = B 3 0 = ∅ .
It is easy to see that
A
=
F
∖
(
B
2
∪
B
3
∪
B
5
∪
B
7
)
.
Then we get the following:
∣
A
∣
=
∣
F
∣
−
∣
B
2
∪
B
3
∪
B
5
∪
B
7
∣
=
1
0
1
0
−
∣
B
2
∪
B
3
∪
B
5
∪
B
7
∣
.
(
3
)
Now using the
Principle of Inclusion-Exclusion
we obtain that
∣
B
2
∪
B
3
∪
B
5
∪
B
7
∣
=
∣
B
2
∣
+
∣
B
3
∣
+
∣
B
5
∣
+
∣
B
7
∣
−
∣
B
2
∩
B
3
∣
−
∣
B
2
∩
B
5
∣
−
∣
B
2
∩
B
7
∣
−
−
∣
B
3
∩
B
5
∣
−
∣
B
3
∩
B
7
∣
−
∣
B
5
∩
B
7
∣
+
∣
B
2
∩
B
3
∩
B
5
∣
+
∣
B
2
∩
B
3
∩
B
7
∣
+
∣
B
2
∩
B
5
∩
B
7
∣
+
∣
B
3
∩
B
5
∩
B
7
∣
−
∣
B
2
∩
B
3
∩
B
5
∩
B
7
∣
Then using (1) and (2) and the fact that the last 9 terms in the right side of the previous equation are zero, we get that
∣
B
2
∪
B
3
∪
B
5
∪
B
7
∣
=
5
1
0
+
3
1
0
+
2
1
0
+
1
−
1
−
1
=
9
8
2
5
6
9
7
Using (3),
∣
A
∣
=
1
0
1
0
−
9
8
2
5
6
9
7
=
9
9
9
0
1
7
4
3
0
3
.
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Principle of Inclusion and Exclusion Problem Solving
Each possible function may be viewed as a 10-tuple of values between 1 and 10. So we count all 10-tuples of this kind where the numbers are not all a multiple of a value greater than 1.
Start with all possible 10-tuples: 1 0 1 0
Subtract the following :
all multiples of two: 5 1 0 (anything with 2, 4, 6, 8, 10)
all multiples of three: 3 1 0 (anything with 3, 6, 9)
all multiples of five: 2 1 0 (anything 5, 10)
all multiples of seven: 1 1 0 (anything 7)
Now we have subtracted out some tuples twice, so we add them back in once. Add the following :
all multiples of six: 1 1 0
all multiples of ten: 1 1 0
Thus the number of possibilities is 1 0 1 0 − 5 1 0 − 3 1 0 − 2 1 0 − 1 1 0 + 1 1 0 + 1 1 0 = 9 9 9 0 1 7 4 3 0 3