计算机科学的数学 Maths for Comp Scientists COMP1043

0

这是一份nottingham诺丁汉大学COMP1043作业代写的成功案例

计算机科学的数学 Maths for Comp Scientists COMP1043



Let $U$ be any set fixed as a local universe. For each subset $A \subseteq U$ we can define a function $f_{A}: U \rightarrow{1,0}$ by putting $f_{A}(u)=1$ when $u \in A$ and $f_{A}(u)=0$ when $u \notin A$. This is known as the characteristic function of $A$ (modulo the universe $U$ ). Thus the characteristic function $f_{A}$ specifies the truth-value of the statement that $u \in A$.

Conversely, when $f: U \rightarrow{1.0}$, we can define the associated subset of $U$ by putting $A_{f}={u \in U: f(a)=1}$.

Clearly, there is a bijection between the subsets of $U$ and the functions $f: U \rightarrow$ ${1.0}$, and in fact we can make either do the work of the other. In some contexts, it is notationally more convenient to work with characteristic functions rather than subsets.

英国论文代写Viking Essay为您提供作业代写代考服务

COMP1043 COURSE NOTES :

Other ways of writing recursive definitions are also current among computer scientists. In particular, one can think of the basis and induction step as being limiting and principle cases respectively, writing in our example:
If $n=1$ then $f(n)=1$
If $n>1$ then $f(n)=f(n-1)+n$.
This can also be expressed in the popular if-then-else form:
If $n=1$ then $f(n)=1$
Else $f(n)=f(n-1)+n$
And some computer scientists like to abbreviate this further to the ungrammatical declaration:
$$
f(n)=\text { if } n=1 \text { then } 1 \text { else } f(n-1)+n
$$
which can look like mumbo-jumbo to the uninitiated.