0
$\begingroup$

If $f:\{1,2,3,4\} \to \{a, b, c, \dots z\}$, how do I determine the amount of functions if $f(1) = f(2)$, or $f(3) = f(4)$ or $f(1)\neq f(3)$?

From what I know I believe:
$A$: $\ $ $f(1) = f(2)$
$B$: $\ $ $f(3) = f(4)$
$C$: $\ $ $f(1) \neq f(3)$

Therefore we use the product rule?:
$A$ = $26 \times 26 \times 26$ (Since we really only have 3 variables)
$B$ = $26 \times 26 \times 26$ (Same as before)
$C$ = $26 \times 26 \times 25 \times 26$ (Because $f(3)$ has one less choice)

It's here that I'm not sure which direction to go, I suspect that I need to make an intersection of $A$, $B$ and $C$. If I am trying to create an intersection of $A$, $B$ and $C$ would

$A \cap B \cap C = 26 \times 25$?

Since $f(1)$ has 26 choices and $f(2) = f(1)$, $f(3)$ has 25 choices because it can't equal $f(1)$ and $f(4) = f(3)$?

  • 0
    LaTeX/MathJaX formatting would really help here. Just a friendly FYI.2017-02-01
  • 0
    You use the word "or" but your work is for "and." Use inclusion-exclusion principle.2017-02-01
  • 0
    Sorry @TheCount , I will learn it. I wasn't able to get exponents to work on stack exchange even just copy and pasting an example here for some reason...2017-02-01
  • 0
    No trouble at all, Brian. Just letting you know. People usually read and respond more often and more quickly with it. Welcome, by the way.2017-02-01
  • 0
    @JMoravitz Thank you! Just to ask, are my values correct here despite it being the wrong way to go? I just want to make sure so that I don't mess up further.2017-02-01
  • 0
    Yes, ignoring poor notation, $|A\cap B\cap C|=26\cdot 25$ is correct (*where $A$ is the set of functions from $\{1,2,3,4\}$ to $\{a,b,c,\dots,z\}$ such that $f(1)=f(2)$, $B$ is the set of functions...*)2017-02-01
  • 0
    @JMoravitz I apologize again for the notation, I will learn latex before my next question. Thank you for the help!2017-02-01
  • 0
    It wasn't a question of using $\LaTeX$, it was the use of equals signs for things which aren't equalities. Equals signs should only be used for equality.2017-02-01

1 Answers 1

2

By inclusion-exclusion principle, we have:

$|A\cup B\cup C|= |A|+|B|+|C|-|A\cap B|-|B\cap C|-|A\cap C|+|A\cap B\cap C|$.

So $|A\cup B\cup C|= 26^3+26^3+25\times 26^3-26^2-25\times 26^2-25\times 26^2+25\times 26=440726$.

  • 0
    Sorry for not marking it earlier, this is what I ended up going with using the comments by JMoravitz, thank you both!2017-02-01