Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

ExTeX --- Functions

Score:0/0/0
Actions:

Functions

Math Refresher 3, Bernd Gärtner(30 September, 2023)

1Questions and Answers

Given two sets XX and YY, a function ff from XX to YY is a rule that selects for each element of XX exactly one element of YY. The mathematical notation f:XYf:X\rightarrow Y says that ff is a function from XX to YY. The element yYy\in Y that is selected for xXx\in X is called the value of the argument xx and is written as f(x)f(x). Note that X,Y,x,yX,Y,x,y are variables here that are placeholders for concrete sets and concrete elements of these sets.

For example, if XX is the set of countries in the world and YY is the set of cities in the world, then we can consider the function f:XYf:X\rightarrow Y that selects for each country its capital. The value of the argument Austria is Vienna,

f(Austria)=Vienna.\displaystyle f(\text {Austria})=\text {Vienna}.
Because sets are mathematical entities and do not correspond to bags in real life, they do not actually contain countries or cities, but just text symbols that identify the countries and cities.

We can also think of XX as questions in a quiz, and YY as answers. Then a function ff provides an answer y=f(x)Yy=f(x)\in Y for every question xXx\in X. Our example function above provides the answer to every question of the form What is the capital of country xx?

In this example, there are elements of YY (for example, Zurich) that are not selected for any xx, so there may be answers that will never be given. That’s ok. The only thing we require is that for every question, there is an answer. We also allow that several questions have the same answer. As an example, consider the function corresponding to the question What is the first letter of country xx’s name? This gives the same answer A for Austria, or Australia, or Albania, or....

Exercise 1.

A boolean function is a function f:{0,1}{0,1}f:\{ 0,1\} \rightarrow \{ 0,1\} . Such a function can be defined by a value table with just two rows, for example

xf(x)0110\displaystyle \begin {array}{c|c}x & f(x) \\ \hline 0 & 1 \\ 1 & 0\end {array}
If we interpret 00 as false and 11 as true, this is actually the truth table of the logical NOT from the first reading assignment. Now for the actual exercise: How many boolean functions are there?

Input (Number)

Enter a number in the box. You can enter

  • a natural number, such as 22,

  • an integer, such as ‐7,

  • a quotient, such as 22/7, or

  • a terminating decimal, such as 3.14285.

There may be more than one correct solution.

Exercise 2.

Let X={1,2,3}X=\{ 1,2,3\} and Y={1,2,...,10}Y=\{ 1,2,...,10\} . How many different functions f:XYf:X\rightarrow Y are there?

Input (Number)

Enter a number in the box. You can enter

  • a natural number, such as 22,

  • an integer, such as ‐7,

  • a quotient, such as 22/7, or

  • a terminating decimal, such as 3.14285.

There may be more than one correct solution.

The mathematician creates another theorem out of this.

Theorem 3.

Let n,kNn,k\in \N . Let XX be a set with kk elements and YY a set with nn elements. There are