2

Let $A = \{1, 2, 3, 4\}$ and $B = \{a, b, c, d, e\}$. what is the number of functions from $A$ to $B$ are either one-to-one or map the element $1$ to $c$? My answer is $166$, but I'm not really sure of my approach .

To calculate $A \cup B = 5! + 4^3 - 4$!

janmarqz
  • 10,538

2 Answers2

6

number of functions from $A$ to $B$ that are one-to-one: $5\times4\times3\times2=120$

number of functions from $A$ to $B$ that map $1$ to $c$: $5^{3}=125$

number of functions from $A$ to $B$ that are one-to-one AND map $1$ to $c$: $4\times3\times2=24$

number of functions from $A$ to $B$ that are one-to-one OR map $1$ to $c$: $120+125-24=221$ (inclusion/exclusion)

drhab
  • 151,093
2

$5\cdot 4\cdot 3\cdot 2 = 120$ one-to-one maps,

$5^3 = 125$ functions that each maps $1 \to c$,

$4\cdot 3\cdot 2 = 24$ maps that are one-to-one and map $1\to c$. Thus:

$|A\cup B| = |A|+|B| -|A\cap B| =120+125-24 = 221$ maps by the Inclusion-Exclusion Principle.

DeepSea
  • 77,651
  • You might want to mention the principle of inclusion-exclusion to show how you got your answer. – robjohn Jan 14 '15 at 13:49