COMP9020 Quiz 2, Test started Feb 21, 2024 6:00 PMtoFeb 28, 2024 6:00 PM
1.1
Let A be the set {b,a,n,a,n,a} and B be the set {p,i,n,e,a,p,p,l,e}.
Which of the following are subsets of A⊕B?
Select all that apply
- {b,p,i,e,p,p,l,e}
- {a,b,e,i,l,n,p}
- {b,p}
- {p,p,p,a,a,n,n,e,e}
- {}
- {a,n}
∵A={a,b,n}, B={a,e,i,l,n,p}∴A⊕B={b,e,i,l,p}
重复的元素视为同一元素即可。
因此,答案有:
- {b,p,i,e,p,p,l,e}
- {b,p}
- {}
1.2
Which of the following sets have exactly 6 elements? (Intervals are over ℕ)
Select all that apply
- [0,1] × (1,6)
- (0,1) × [1,6]
- (0,2] × [1,4)
- [0,2] × (1,4)
- None of the above
∵∣[0,1]∣=2, ∣(1,6)∣=4∴∣[0,1]×(1,6)∣=2∗4=8
∵∣(0,1)∣=0, ∣[1,6]∣=6∴∣(0,1)×[1,6]∣=0∗6=0
∵∣(0,2]∣=2, ∣[1,4)∣=3∴∣(0,2]×[1,4)∣=2∗3=6
∵∣[0,2]∣=3, ∣(1,4)∣=2∴∣[0,2]×(1,4)∣=3∗2=6
因此,答案有:
- (0,2] × [1,4)
- [0,2] × (1,4)
1.3
Let Σ={a,b}.
Let w ∈ Σ* be the word "abb",
let v ∈ Σ* be the word "ba".
What is length(vwv)?
∵vwv=baabbba∴length(vwv)=7
1.4
Let Σ={c,u,p} and Ψ={s,a,u,c,e,r}
Which of the following words are in Σ* \ Ψ*?
Select all that apply
- ccc
- eee
- saucer
- λ
- cup
- ppp
要点:寻找能在集合Σ中组出来的词,并且这个词在集合Ψ中无法组出来。
因此,答案有:
- cup
- ppp
1.5
Which of the following statements are true for all sets A, B, C?
Select all that apply
- (A ∪ B)\C = (A\C) ∪ (B\C)
- (A⊕B)ᶜ = (Aᶜ) ⊕ (Bᶜ)
- (C\A)ᶜ = (Cᶜ) \ (Aᶜ)
- (A∪B)∩A = A∪(B∩A)
- C\(A ∪ B) = (C\A) ∪ (C\B)
(A∪B)\C=(A∪B)∩CC=(A∩CC)∪(B∩CC)=(A\C)∪(B\C)
(A⊕B)C=((A\B)∪(B\A))C=((A∩BC)∪(B∩AC))C=(A∩BC)C∩(B∩AC)C=(AC∪B)∩(BC∪A)
(AC)⊕(BC)=(AC\BC)∪(BC\AC)=(AC∩B)∪(BC∩A)
(C\A)C=(C∩AC)C=CC∪A
(CC)\(AC)=CC∩A
(A∪B)∩A=(A∩A)∪(B∩A)=A∪(B∩A)
C\(A∪B)=C∩(A∪B)C=C∩(AC∩BC)
(C\A)∪(C\B)=(C∩AC)∪(C∩BC)=C∩(AC∪BC)
因此,答案有:
- (A ∪ B)\C = (A\C) ∪ (B\C)
- (A∪B)∩A = A∪(B∩A)
2.1
For all sets A and B, A∩B = A∪B if and only if A=B.
if A=B, then A∩B = A∪B.
∵A=B,∴A∩B=A∪B=A=B
if A∩B = A∪B, then A=B.
∵A∪B=A∩B∴for every element k in A,k∈A, and k∈B∴A⊆B∴same reason, B⊆A∵A⊆B, B⊆A,∴A=B
因此,答案为:
- True
2.2
For all sets A,B,C:
A×(B∩C) = (A×B) ∩ (A×C)
2.3
Which of the following sets has cardinality less than or equal to 6?
Select all that appy:
- {n∈ℤ : 6|n}
- {6%n : n∈ℕ and n>0}
- {n∈ℤ : n|6}
- {n%6 : n∈ℤ}
在集合 {n∈Z:6∣n} 中,n 代表了整数集合中所有6的倍数,因此是该集是无穷的。
{6%n:n∈N and n>0}={0,1,2,6}
{n∈Z:n∣6}={−6,−3,−2,−1,1,2,3,6}
{n%6:n∈Z}={0,1,2,3,4,5}
因此,答案有:
- {6%n : n∈ℕ and n>0}
- {n%6 : n∈ℤ}
2.4
Suppose A={0,1,2}
For how many sets B⊆ℕ is it the case that A×B = B×A?
Select one alternative:
- 0
- 1
- 2
- 3
- Infinitely many
- None of the above
假设集合B不为空集,且元素为:{b1,b2,b3,...bn},那么:
A×B={(0,b1),(0,b2),...(1,bm),(1,bm+1),...(2,bn),(2,bn+1),...}B×A={(b1,0),(b2,0),...(bm,1),(bm+1,1),...(bn,2),(bn+1,2),...}
若要保证 A×B=B×A ,需要有:
b1=0, b1=b2=...bm=1, bm=bm+1=...bn=2, bn=bn+1=...
因此,当 B={0,1,2}=A 时,有 A×B=B×A。
假设B为空集,显然:
A×B=B×A=∅
因此,答案有:
- 2
2.5
Let Σ = {0,1}.
True or false:
For all languages X ⊆ Σ*: (XX)* = (X*)(X*)
反例:
(X∗)(X∗)=(X1)(X0)=X(XX)∗=X
单字符的字符串无法被(XX)∗表示。
因此,答案为:
- False