coding the matrix week1 the func
A set is an unordered collection of objects.
And, a convenient way to prove that two sets are equal, is to prove that each is a subset of the other.
Call it a set expression.
image.png
So I use the colon(:) to mean such that. So there are two parts to this expression.
The part before the colon, which tells us where these elements come from and introduces a variable to refer to them so that I can impose conditions in the, in the second part.Second part gives a rule or, constraints or condition that say which of these elements belong to the whole set as an analogous Python expression.
S = {-4, 4, -3, 3, -2, 2, -1, 1, 0}
{x for x in S if x >= 0}
{0, 1, 2, 3, 4}
If a set S is not infinite, we use these vertical bars to denote the number of elements in a set.
image.png
domain and co-domain
Formally, in math, a function is often defined as a set of pairs (a,b), No two of which have the same first element A.
Definition:The output of a given input is called the image of that input. The image of q under a function f is denoted f (q).
However, the image of the cosine function is just those real numbers that lie between -1 and 1.
image.png image.png image.pngwhy propose this concept?
概念:复合函数、反函数(通过复合函数和identity function 定义出了反函数)
The parentheses are not needed because function composition satisfies associativity.
image.pngone-to-one(一一映射)
propostion:反函数是一一映射,也是onto。(都可通过反证法即可证明)
A procedure is a description of a computation that ,given an input, produces an output.
You might be used to calling these procedures functions, but we're going to reserve the term function to refer only to the mathematical object.
最下面的是D image.png