Skip to main contentSkip to solution

Consider two sets A={2,3,5,7,11,13}A = \{2, 3, 5, 7, 11, 13\} and B={1,8,27}B = \{1, 8, 27\}. Let ff be a function from AA to BB such that for every element bb in BB, there is at least one element aa in AA such that f(a)=bf(a) = b. Then, the total number of such functions ff is

Solution

✅ Correct Option: 2

We need to find functions where every element in BB gets mapped to by at least one element from AA. This is called an onto function.

A={2,3,5,7,11,13}A = \{2, 3, 5, 7, 11, 13\}, so ∣A∣=6|A| = 6

B={1,8,27}B = \{1, 8, 27\}, so ∣B∣=3|B| = 3


We'll use the Inclusion-Exclusion Principle: count all functions, then subtract the bad ones (those that miss elements).


Each of the 66 elements in AA can map to any of the 33 elements in BB.

Total functions =36=729= 3^6 = 729


Functions that miss element 11:

Elements in AA can only map to {8,27}\{8, 27\}

Count =26=64= 2^6 = 64

Functions that miss element 88:

Elements in AA can only map to {1,27}\{1, 27\}

Count =26=64= 2^6 = 64

Functions that miss element 2727:

Elements in AA can only map to {1,8}\{1, 8\}

Count =26=64= 2^6 = 64

Functions missing at least one element =3×64=192= 3 \times 64 = 192


We overcounted functions that miss two elements, so we add them back.

Functions that miss both 11 and 88:

Elements in AA can only map to {27}\{27\}

Count =16=1= 1^6 = 1

Functions that miss both 11 and 2727:

Elements in AA can only map to {8}\{8\}

Count =16=1= 1^6 = 1

Functions that miss both 88 and 2727:

Elements in AA can only map to {1}\{1\}

Count =16=1= 1^6 = 1

Functions missing exactly two elements =3×1=3= 3 \times 1 = 3


Functions missing all three elements =0= 0 (impossible)


Using Inclusion-Exclusion:

Onto functions =729−192+3−0=540= 729 - 192 + 3 - 0 = 540

Therefore, the total number of onto functions from AA to BB is 540540.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question