2024-02-25
24T1
00

目录

1.1
1.2
1.3
1.4
1.5
2.1
2.2
2.3
2.4
2.5

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}AB={b,e,i,l,p}\because A=\{a,b,n\}, \ \ B=\{a,e,i,l,n,p\} \\ \therefore A \oplus 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
  • 选项1:
[0,1]=2, (1,6)=4[0,1]×(1,6)=24=8\because |[0,1]| = 2, \ |(1,6)| = 4 \\ \therefore |[0,1] \times (1,6)|=2*4=8
  • 选项2:
(0,1)=0, [1,6]=6(0,1)×[1,6]=06=0\because |(0,1)| = 0, \ |[1,6]| = 6 \\ \therefore |(0,1) \times [1,6]|=0*6=0
  • 选项3:
(0,2]=2, [1,4)=3(0,2]×[1,4)=23=6\because |(0,2]| = 2, \ |[1,4)| = 3 \\ \therefore |(0,2] \times [1,4)|=2*3=6
  • 选项4:
[0,2]=3, (1,4)=2[0,2]×(1,4)=32=6\because |[0,2]| = 3, \ |(1,4)| = 2 \\ \therefore |[0,2] \times (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=baabbbalength(vwv)=7\because vwv=baabbba \\ \therefore 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)
  • 选项1:
(AB)\C=(AB)CC=(ACC)(BCC)=(A\C)(B\C)(A \cup B) \backslash C = (A \cup B) \cap C^C \\ = (A \cap C^C) \cup (B \cap C^C) \\ = (A \backslash C) \cup (B \backslash C)
  • 选项2:
(AB)C=((A\B)(B\A))C=((ABC)(BAC))C=(ABC)C(BAC)C=(ACB)(BCA)(A \oplus B)^C \\ = ((A \backslash B) \cup (B \backslash A))^C \\ = ((A \cap B^C) \cup (B \cap A^C))^C \\ = (A \cap B^C)^C \cap (B \cap A^C)^C \\ = (A^C \cup B) \cap (B^C \cup A)
(AC)(BC)=(AC\BC)(BC\AC)=(ACB)(BCA)(A^C) \oplus (B^C) \\ = (A^C \backslash B^C) \cup (B^C \backslash A^C) \\ = (A^C \cap B) \cup (B^C \cap A)
  • 选项3:
(C\A)C=(CAC)C=CCA(C \backslash A)^C \\ = (C \cap A^C)^C \\ = C^C \cup A
(CC)\(AC)=CCA(C^C) \backslash (A^C) \\ = C^C \cap A
  • 选项4:
(AB)A=(AA)(BA)=A(BA)(A \cup B) \cap A \\ = (A \cap A) \cup (B \cap A) \\ = A \cup (B \cap A)
  • 选项5:
C\(AB)=C(AB)C=C(ACBC)C \backslash (A \cup B) \\ = C \cap (A \cup B)^C \\ = C \cap (A^C \cap B^C)
(C\A)(C\B)=(CAC)(CBC)=C(ACBC)(C \backslash A) \cup (C \backslash B) \\ = (C \cap A^C) \cup (C \cap B^C) \\ = C \cap (A^C \cup B^C)

因此,答案有:

- (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:
if A=B, then A∩B = A∪B.
A=B,AB=AB=A=B\because A=B, \\ \therefore A \cap B = A \cup B = A = B
  • only if:
if A∩B = A∪B, then A=B.
AB=ABfor every element k in A,kA, and kBABsame reason, BAAB, BA,A=B\because A \cup B = A \cap B \\ \therefore \text{for every element $k$ in } A, \\ k \in A,\ and\ k \in B \\ \therefore A \subseteq B \\ \therefore \text{same reason, }B \subseteq A \\ \because A \subseteq B, \ B \subseteq A, \\ \therefore A = B

因此,答案为:

- True

2.2

For all sets A,B,C: A×(B∩C) = (A×B) ∩ (A×C)

image.png

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∈ℤ}
  • 选项1:

在集合 {nZ:6n}\{n \in Z: 6 \mid n\} 中,nn 代表了整数集合中所有6的倍数,因此是该集是无穷的。

  • 选项2:
{6%nnN and n>0}={0,1,2,6}\{6 \% n: n \in N \ and \ n>0\} = \{0,1,2,6\}
  • 选项3:
{nZ:n6}={6,3,2,1,1,2,3,6}\{n \in Z: n \mid 6\} = \{-6,-3,-2,-1,1,2,3,6\}
  • 选项4:
{n%6:nZ}={0,1,2,3,4,5}\{n \% 6: n \in 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}\{b_1,b_2,b_3,...b_n\},那么:

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 \times B = \{(0, b_1), (0, b_2), ... (1, b_m), (1, b_{m+1}), ... (2, b_n), (2,b_{n+1}),...\} \\ B \times A = \{(b_1, 0), (b_2, 0), ... (b_m, 1), (b_{m+1},1), ... (b_n, 2), (b_{n+1}, 2),...\}

若要保证 A×B=B×AA \times B = B \times A ,需要有:

b1=0,  b1=b2=...bm=1,  bm=bm+1=...bn=2,  bn=bn+1=...b_1 = 0, \ \ b_1 = b_2 = ... \\ b_m = 1, \ \ b_m = b_{m+1} = ... \\ b_n=2, \ \ b_n=b_{n+1} = ...

因此,当 B={0,1,2}=AB=\{0,1,2\}=A 时,有 A×B=B×AA \times B = B \times A

假设B为空集,显然:

A×B=B×A=A \times B = B \times A = \empty

因此,答案有:

- 2

2.5

Let Σ = {0,1}. True or false: For all languages X ⊆ Σ*: (XX)* = (X*)(X*)

反例:

(X)(X)=(X1)(X0)=X(XX)X(X^*)(X^*) = (X^1)(X^0) = X \\ (XX)^* \ne X

单字符的字符串无法被(XX)(XX)^*表示。

因此,答案为:

- False

本文作者:Jeff Wu

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!