CS70学习笔记(二)N0

Note 0

Review of Sets and Mathematical Notation

Set(集合)

A set s a well defined collection of objects. These objects are called elements or members of the set

Two sets A and B are said to be equal, written as A = B, if they have the same elements.

Cardinality

Size of a set is called cardinality. It is possible for the cardinality of a set to be 0. This set is called the empty set.

Subsets and Proper Subsets

If every element of a set A is also in set B, then we say that A is a subset of B, written A ⊆ \subseteq B
A proper subset is a set A that is strictly contained in B, written as A ⊂ \subset B, meaning that A excludes at least one element of B

以下是一些markdown语法

符号代码
∈ \in \in
∋ \ni \ni
∉ \notin /\notin
⊂ \subset \subset
⊃ \supset \supset
⊆ \subseteq \subseteq
⊇ \supseteq \supseteq
⊊ \subsetneq \subsetneq
⊋ \supsetneq \supsetneq
⊄ \not\subset \not\subset
⊅ \not\supset \not\sepset

Intersections and Unions

The intersection of a set A with a set B, written as A∩B, is a set containing all elements which are in both A and B. Two sets are said to be disjoint if A∩B = /0. The union of a set A with a set B, written as A∪B, is a set of all elements which are in either A or B or both.

# python中intersection()和union()函数可以求集合的交集与并集
m = "abcde"
n = "def"
m = set(m)
n = set(n)
u = m.intersection(n)
print(u)
# de
v = m.union(n)
print(v)
# abcdef

Complements

If A and B are two sets, then the relative complement of A in B, written as B − A or B\A, is the set of elements in B, but not in A: B

A \A = 0
A \0 = A
0 \A = 0

Significant Sets

  1. N \mathbb{N} N 自然数
  2. Z \mathbb{Z} Z 整数
  3. Q \mathbb{Q} Q 实数
  4. R \mathbb{R} R 有理数
  5. C \mathbb{C} C 复数

$\mathbb{i}$ i=N,Z,Q,R,C

Cartesian product (笛卡尔乘积)

A × B, is the set of all pairs whose first component is an element of A and whose second component is an element of B. In set notation, A × B = {(a,b) | a ∈ A,b ∈ B}.

Mathematical notation

Sums and Products

∑ \sum : \sum

p = ∑ n = 1 N a n \sum_{n=1}^Na_n n=1Nan : p = \sum_{n=1}^Na_n

∏ \prod : \prod

∏ i = 1 n \prod_{i=1}^{n} i=1n : \prod_{i=1}^{n}

这一章note都是一些前置的基础概念,主要来复习一下markdown语法(随机看到一段python的用法顺带记录一下)

2023-08-11 11:46

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值