
discrete mathematics
yzcwansui
这个作者很懒,什么都没留下…
展开
-
Let X be a finite set f : X → X a function. Prove that f is injective if and only if f is surjective
Proof:Suppose f is injective. Then we assume that f is not surjective and find a contradiction. Let x ∈ X be such that f(y) 6= x for any y ∈ X. However, since each x ∈ X must go to an element of X...转载 2018-08-12 20:26:58 · 1105 阅读 · 0 评论 -
9024复习
Binary SearchBinarySearch(v, a, lo, hi) input value v array a[lo...hi] of values output true if v in a[lo...hi] false otherwise mid = (lo + hi)/2 if lo > hi return false if a[mid] = v r...原创 2019-05-10 20:18:52 · 524 阅读 · 0 评论 -
9801
In 9801, the algorithms sre sequentialdeterministicIf the actin of each step gives the same result whenever this step is executed for the same inputrandomizedthe execution involves some random pr...原创 2019-05-26 08:41:03 · 196 阅读 · 0 评论 -
Stable Matching Problem
ProblemAssume that you are running a dating agency and haven men and nwomen as customers;They all attend a dinner party; after the partyevery man gives you a list with his ranking of all women per...原创 2019-05-28 11:14:53 · 352 阅读 · 0 评论