Aspects of Course
Tasks: weekly homework, online assignment, discussion
Discrete Math & Probability Theory(离散数学与概率论)
Definition
Discrete:sperate & distinct
Discrete vs continuous
eg. 整数,实数
离散与连续相对,如整数是离散的,实数是连续的
Why learning?
Discrete is behind Digital computer
proofs: T or F
programs: 0 or 1
为什么要学这门课?离散数学和电脑的诞生密不可分,有些结论是在电脑诞生之前产生,有些结论在之后,因此有必要将两者结合在一起。
Expand the definition of CS
Computer make math in concrete
(math in action)
证明有真或假,程序中有0和1。有说最初的程序就是对应证明的真假,电脑也可以理解为让数学“具象化”,让数学有实际作用
Techniques
properties of prime numbers–Discrete structures
(analyzing algorithms
codes
cryptograph
network)
这里介绍了一些离散数学在cs中的方向
Problem solving
一个有趣的问题(看了几个每次都是不同的问题)
12fall:
一个四分钟的沙漏和一个七分钟的沙漏如何计时9分钟
(注意考虑一个问题,沙漏的时间是否是均匀变化的)
15sp:
四个人要过河,过河需要手电筒(有且只有一个),四个人过河分别要1,2,5,10分钟。是否能在17分钟内完成。
Fast
课上专门提前预警这门课很难很花时间qwq
并给出了三个解决方案:)
- math 55 作为先修课
- create more time 花更多的时间
- Drop CS70 & try again (这是课上原话)
Learn
Learn from each other
这门课有一个部分就叫“homework party”还有常规的“lab”、“discussion”,教授非常鼓励同学相互学习,以及和ta多多交流,也引用了一句话
Playing with someone who are better than you can improve your gaming. Playing with someone less better than you can also improve your gaming.
(笔记有错也请多多指教orz)
I Don’t Know
一个概念有些人可能看一遍就懂了,有些人可能要两个小时。不必灰心,最重要的是要会了
(老师好贴心…写下以自勉)
Propositional Logic(命题逻辑)
Proposition
Proposition(命题): statement that is either T
or F
以下是课上的例子:
1)1+1=2
2)Angles of a triangle sum to 180
3) If n ia a non-neg integ then n^2+n+41 is a prime
4) For any n>2, n can be written as a sum of two primes
5) Washington DC is the capital of the us
6) Berkeley is an interesting city
其中最后一个显然不是
Connectives
AND
∧
\wedge
∧ ($\wedge$
)
OR
∨
\vee
∨ ($\vee$)
NOT
¬
\lnot
¬ ($\lnot$)
这里还是比较好理解的,简单列一个truth table
P | Q | P ∧ \wedge ∧ Q |
---|---|---|
T | T | T |
F | T | T |
T | F | T |
F | F | F |
Implications
P
⇒
\Rightarrow
⇒Q
($\Rightarrow$)
如果P是真,则Q是真,以下是Truth Table
P | Q | P ⇒ \Rightarrow ⇒ Q | ¬ \lnot ¬ Q ⇒ \Rightarrow ⇒ ¬ \lnot ¬ P |
---|---|---|---|
F | F | T | T |
F | T | T | T |
T | F | F | F |
T | T | T | T |
假命题推导真或假命题都为真
这里需要注意两点
- 命题只能为真或假
-
⇒
\Rightarrow
⇒ 是一个计算符号
假命题推导真或假命题都为真可以(?)理解为一种人为规定的运算结果
可以用反证法说明这种计算的合理性 - 真推假为假,假推假为真时。P推B为真和B假才能推出P假。故假推假为真。
- 若假推真为假。则P假时,要P推Q真,Q只能也为假。与并不能证明非Q矛盾。故假推真为真。
逆否命题和原命题等价
contrapositive
Quantifiers
Universal Quantifier 全称量词
The universal quantification of P(x) is the statement “P(x) for all value of x in the domain.”
∀ is called the universal quantifier.
($\forall$)
任取x对于P(x)
Existential Quantifier 存在量词
The existential quantification of P(x) is the statement “ There exists an element x in the domain such that P(x).”
∃ is called the existential quantifier.
($\exists$)
存在x对于P(x)
2023-08-11 01:51