Forming Certain Functions

How many functions f : { 1 , 2 , 3 , , 10 } { 1 , 2 , 3 , , 10 } f:\{1,2,3,\ldots,10\}\rightarrow\{1,2,3,\ldots,10\} are there, such that the greatest common factor of all the numbers in r a n g e ( f ) \mathrm{range}(f) is 1?


The answer is 9990174303.

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.

2 solutions

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 10 10^{10}

Subtract the following :

  • all multiples of two: 5 10 5^{10} (anything with 2, 4, 6, 8, 10)

  • all multiples of three: 3 10 3^{10} (anything with 3, 6, 9)

  • all multiples of five: 2 10 2^{10} (anything 5, 10)

  • all multiples of seven: 1 10 1^{10} (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 10 1^{10}

  • all multiples of ten: 1 10 1^{10}

Thus the number of possibilities is 1 0 10 5 10 3 10 2 10 1 10 + 1 10 + 1 10 = 9 990 174 303 10^{10} - 5^{10} - 3^{10} - 2^{10} - 1^{10} + 1^{10} + 1^{10} = 9\:990\:174\:303

Arturo Presa
Feb 7, 2016

Let F \mathcal{F} be the set of all functions f : { 1 , 2 , 3 , , 10 } { 1 , 2 , 3 , , 10 } . f: \{1, 2, 3, \cdots, 10\}\rightarrow \{1, 2, 3, \cdots, 10\}. The number of elements in F , \mathcal{F}, by the Rule of Product , is 1 0 10 . 10^{10}. Let us define A \mathcal{A} as the set of functions f f in F \mathcal{F} for which the greatest common factor of the numbers in r a n g e ( f ) range(f) is 1. For any natural number n , n, we can define B n \mathcal{B}_n as the set of all functions f f in F \mathcal{F} such that all the numbers in r a n g e ( f ) range(f) are divisible by n . n. It is clear that if n > 10 , n> 10, then B n = . \mathcal{B}_n=\emptyset. In what follows, we are going to denote the cardinality of an arbitrary set C C by C . |C|. Then using the Rule of Product, it is not difficult to get the following: B 2 = 5 10 , B 3 = 3 10 , B 5 = 2 10 , B 6 = B 7 = B 10 = 1 ( 1 ) |\mathcal{B}_2|=5^{10}, |\mathcal{B}_3|=3^{10}, |\mathcal{B}_5|=2^{10}, |\mathcal{B}_6|=|\mathcal{B}_7|=|\mathcal{B}_{10}|=1\:\:\:\:\:\:(1) Additionally, it can be proved that if m m and n n are two prime numbers less than 10 then B n B m = B m × n . ( 2 ) \mathcal{B}_n\cap\mathcal{B}_m=\mathcal{B}_{m\times n}.\:\:\:\:\:\:\:(2) A similar property applies for more than two primes. For example, B 2 B 3 B 5 = B 30 = . \mathcal{B}_2\cap\mathcal{B}_3\cap\mathcal{B}_5=\mathcal{B}_{30}=\emptyset.

It is easy to see that A = F ( B 2 B 3 B 5 B 7 ) . \mathcal{A}=\mathcal{F}\setminus(\mathcal{B}_2\cup\mathcal{B}_3\cup\mathcal{B}_5\cup\mathcal{B}_7). Then we get the following:
A = F B 2 B 3 B 5 B 7 = 1 0 10 B 2 B 3 B 5 B 7 . ( 3 ) |\mathcal{A}|=|\mathcal{F}|-|\mathcal{B}_2\cup\mathcal{B}_3\cup\mathcal{B}_5\cup\mathcal{B}_7|=10^{10}-|\mathcal{B}_2\cup\mathcal{B}_3\cup\mathcal{B}_5\cup\mathcal{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 |\mathcal{B}_2\cup\mathcal{B}_3\cup\mathcal{B}_5\cup\mathcal{B}_7|=|\mathcal{B}_2|+|\mathcal{B}_3|+|\mathcal{B}_5|+|\mathcal{B}_7| - |\mathcal{B}_2\cap\mathcal{B}_3|- |\mathcal{B}_2\cap\mathcal{B}_5|- |\mathcal{B}_2\cap\mathcal{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 + - |\mathcal{B}_3\cap\mathcal{B}_5|- |\mathcal{B}_3\cap\mathcal{B}_7|- |\mathcal{B}_5\cap\mathcal{B}_7|+ |\mathcal{B}_2\cap\mathcal{B}_3\cap\mathcal{B}_5|+ |\mathcal{B}_2\cap\mathcal{B}_3\cap\mathcal{B}_7|+ |\mathcal{B}_2\cap\mathcal{B}_5\cap\mathcal{B}_7|+ B 3 B 5 B 7 B 2 B 3 B 5 B 7 |\mathcal{B}_3\cap\mathcal{B}_5\cap\mathcal{B}_7|-|\mathcal{B}_2\cap\mathcal{B}_3\cap\mathcal{B}_5\cap\mathcal{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 10 + 3 10 + 2 10 + 1 1 1 = 9825697 |\mathcal{B}_2\cup\mathcal{B}_3\cup\mathcal{B}_5\cup\mathcal{B}_7|=5^{10}+3^{10}+2^{10}+1 - 1-1=9825697 Using (3), A = 1 0 10 9825697 = 9990174303. |\mathcal{A}|= 10^{10}-9825697=9990174303.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...