UCB EECS 70 Discrete Mathematics and Probability Theory
寒假找点事干 。
没答案只能瞎做,不保证正确性()
Discussion 0A 1 Truth Tables(a)
P P P Q Q Q Q ∨ P Q\lor P Q ∨ P P ∧ ( Q ∨ P ) P\land(Q\lor P) P ∧ ( Q ∨ P ) P ∧ Q P\land Q P ∧ Q T T T T T T F T T F F T T F F F F F F F
When P = T , Q = F P=\mathtt{T},Q=\mathtt{F} P = T , Q = F , L H S = T \mathrm{LHS}=\mathtt{T} L H S = T but R H S = F \mathrm{RHS}=\mathtt{F} R H S = F .
So L H S ≢ R H S \mathrm{LHS}\not\equiv \mathrm{RHS} L H S ≡ R H S .
(b)
P P P Q Q Q R R R P ∨ Q P\lor Q P ∨ Q ( P ∨ Q ) ∧ R (P\lor Q)\land R ( P ∨ Q ) ∧ R P ∧ R P\land R P ∧ R Q ∧ R Q\land R Q ∧ R ( P ∧ R ) ∨ ( Q ∧ R ) (P\land R)\lor(Q\land R) ( P ∧ R ) ∨ ( Q ∧ R ) False False False False False False False False False False True False False False False False False True False True False False False False False True True True True False True True True False False True False False False False True False True True True True False True True True False True False False False False True True True True True True True True
So L H S ≡ R H S \mathrm{LHS}\equiv \mathrm{RHS} L H S ≡ R H S .
1 2 3 4 5 6 7 8 from itertools import productif __name__ == "__main__" : tb = (False , True ) for P, Q, R in product(tb, tb, tb): print ('' , P, Q, R, P or Q, (P or Q) and R, P and R, Q and R, (P and R) or (Q and R), '' , sep='|' )
(c)
P P P Q Q Q R R R P ∧ Q P\land Q P ∧ Q ( P ∧ Q ) ∨ R (P\land Q)\lor R ( P ∧ Q ) ∨ R P ∨ R P\lor R P ∨ R Q ∨ R Q\lor R Q ∨ R ( P ∨ R ) ∧ ( Q ∨ R ) (P\lor R)\land(Q\lor R) ( P ∨ R ) ∧ ( Q ∨ R ) False False False False False False False False False False True False True True True True False True False False False False True False False True True False True True True True True False False False False True False False True False True False True True True True True True False True True True True True True True True True True True True True
So L H S ≡ R H S \mathrm{LHS}\equiv \mathrm{RHS} L H S ≡ R H S .
1 2 3 4 5 6 7 8 from itertools import productif __name__ == "__main__" : tb = (False , True ) for P, Q, R in product(tb, tb, tb): print ('' , P, Q, R, P and Q, (P and Q) or R, P or R, Q or R, (P or R) and (Q or R), '' , sep='|' )
2 Propositional Practice(a)
∃ x ∈ R , x ∉ Q . \exist x\in\R, x\not\in\mathbb{Q}. ∃ x ∈ R , x ∈ Q .
(b)
∀ n ∈ Z , ( ( n ∈ N ) ∨ ( n < 0 ) ) ∧ ¬ ( ( n ∈ N ) ∧ ( n < 0 ) ) . \forall n\in \mathbb{Z},\left((n\in\mathbb{N})\lor(n<0)\right)\land\lnot\left((n\in\mathbb{N})\land(n<0)\right). ∀ n ∈ Z , ( ( n ∈ N ) ∨ ( n < 0 ) ) ∧ ¬ ( ( n ∈ N ) ∧ ( n < 0 ) ) .
(c)
∀ n ∈ N , ( 6 ∣ n ⟹ ( 2 ∣ n ) ∨ ( 3 ∣ n ) ) . \forall n\in \N,\left(6\mid n\implies(2\mid n)\lor (3\mid n)\right). ∀ n ∈ N , ( 6 ∣ n ⟹ ( 2 ∣ n ) ∨ ( 3 ∣ n ) ) .
(d) All integers are rational numbers.
(e) All integers divisible by 2 2 2 or 3 3 3 are divisible by 6 6 6 .
(f) Any natural number greater than 7 can be decomposed into the sum of two natural numbers.
3 Converse and Contrapositive(a)
∀ n ∈ N , ( 4 ∣ n ⟹ 2 ∣ n ) . \forall n\in\N, (4\mid n\implies 2\mid n). ∀ n ∈ N , ( 4 ∣ n ⟹ 2 ∣ n ) .
It is true.
We let n = 4 k , k ∈ N n=4k, k\in \N n = 4 k , k ∈ N .
We have n = 2 ⋅ ( 2 k ) n=2\cdot (2k) n = 2 ⋅ ( 2 k ) , so 2 ∣ n 2\mid n 2 ∣ n .
(b) If a natural number is not divisible by 4 4 4 , it is not divisible by 2 2 2 .
∀ n ∈ N , ( 4 ∤ n ⟹ 2 ∤ n ) . \forall n\in\N, (4\nmid n\implies 2\nmid n). ∀ n ∈ N , ( 4 ∤ n ⟹ 2 ∤ n ) .
It is false.
A possible counterexample is when n = 2 n=2 n = 2 , 4 ∤ 2 4\nmid 2 4 ∤ 2 , but 2 ∣ 2 2\mid 2 2 ∣ 2 .
(c) If a natural number is divisible by 2 2 2 , it is divisible by 4 4 4 .
∀ n ∈ N , ( 2 ∣ n ⟹ 4 ∣ n ) . \forall n\in\N, (2\mid n\implies 4\mid n). ∀ n ∈ N , ( 2 ∣ n ⟹ 4 ∣ n ) .
It is false.
A possible counterexample is when n = 2 n=2 n = 2 , 2 ∣ 2 2\mid 2 2 ∣ 2 , but 4 ∤ 2 4\nmid 2 4 ∤ 2 .
(d) If a natural number is divisible by 2 2 2 , it is divisible by 4 4 4 .
4 Equivalences with Quantifiers(a)
L H S ≡ ∀ x ( ( ∃ y Q ( x , y ) ) ⟹ P ( x ) ) ≡ ∀ x ( ¬ ( ∃ y Q ( x , y ) ) ∨ P ( x ) ) ≡ ∀ x ( ( ∀ y ¬ Q ( x , y ) ) ∨ P ( x ) ) ≡ ∀ x ∀ y ( ¬ Q ( x , y ) ∨ P ( x ) ) ≡ ∀ x ∀ y ( Q ( x , y ) ⟹ P ( x ) ) ≢ ∀ x ∃ y ( Q ( x , y ) ⟹ P ( x ) ) ≡ R H S \begin{aligned} \mathrm{LHS}&\equiv\forall x\ ((\exist y\ Q(x, y))\implies P(x))\\ &\equiv \forall x\ (\lnot(\exist y\ Q(x, y))\lor P(x))\\ &\equiv \forall x\ ((\forall y\ \lnot Q(x, y))\lor P(x))\\ &\equiv \forall x\forall y\ (\lnot Q(x, y)\lor P(x))\\ &\equiv \forall x\forall y\ (Q(x, y)\implies P(x))\\ &\not \equiv \forall x\exist y\ (Q(x, y)\implies P(x))\\ &\equiv \mathrm{RHS} \end{aligned} L H S ≡ ∀ x ( ( ∃ y Q ( x , y ) ) ⟹ P ( x ) ) ≡ ∀ x ( ¬ ( ∃ y Q ( x , y ) ) ∨ P ( x ) ) ≡ ∀ x ( ( ∀ y ¬ Q ( x , y ) ) ∨ P ( x ) ) ≡ ∀ x ∀ y ( ¬ Q ( x , y ) ∨ P ( x ) ) ≡ ∀ x ∀ y ( Q ( x , y ) ⟹ P ( x ) ) ≡ ∀ x ∃ y ( Q ( x , y ) ⟹ P ( x ) ) ≡ R H S
To find one counterexample, we could let P ( x ) P(x) P ( x ) to be contradictions, like “x x x is an elephant”, and Q ( x , y ) Q(x, y) Q ( x , y ) be “x = y x=y x = y ”. On the one hand, for all x x x , ∃ y Q ( x , y ) \exist y\ Q(x, y) ∃ y Q ( x , y ) is true because we could just let y = x y=x y = x , and P ( x ) P(x) P ( x ) is false, so L H S \mathrm{LHS} L H S is false. However, for all x x x , we just let y = x + 1 y=x+1 y = x + 1 , then since Q ( x , y ) Q(x, y) Q ( x , y ) is false, Q ( x , y ) ⟹ P ( x ) Q(x, y)\implies P(x) Q ( x , y ) ⟹ P ( x ) is true, so R H S \mathrm{RHS} R H S is true.
(b)
L H S ≡ ∀ x ∃ y ( ¬ ( P ( x , y ) ⟹ ¬ Q ( x , y ) ) ) ≡ ∀ x ∃ y ( ¬ ( ¬ P ( x , y ) ∨ ¬ Q ( x , y ) ) ) ≡ ∀ x ∃ y ( P ( x , y ) ∧ Q ( x , y ) ) ≢ ∀ x ( ( ∃ y P ( x , y ) ) ∧ ( ∃ y Q ( x , y ) ) ) ≡ R H S \begin{aligned} \mathrm{LHS}&\equiv\forall x\exist y\ \left(\lnot\left(P(x, y)\implies \lnot Q(x, y)\right)\right)\\ &\equiv\forall x\exist y\ \left(\lnot\left(\lnot P(x, y)\lor \lnot Q(x, y)\right)\right)\\ &\equiv\forall x\exist y\ \left(P(x, y)\land Q(x, y)\right)\\ &\not\equiv\forall x\left((\exist y\ P(x, y))\land (\exist y\ Q(x, y))\right)\\ &\equiv \mathrm{RHS} \end{aligned} L H S ≡ ∀ x ∃ y ( ¬ ( P ( x , y ) ⟹ ¬ Q ( x , y ) ) ) ≡ ∀ x ∃ y ( ¬ ( ¬ P ( x , y ) ∨ ¬ Q ( x , y ) ) ) ≡ ∀ x ∃ y ( P ( x , y ) ∧ Q ( x , y ) ) ≡ ∀ x ( ( ∃ y P ( x , y ) ) ∧ ( ∃ y Q ( x , y ) ) ) ≡ R H S
To find one counterexample, we could let P ( x , y ) P(x, y) P ( x , y ) to be x = y x=y x = y , and Q ( x , y ) Q(x, y) Q ( x , y ) be “x = y + 1 x=y+1 x = y + 1 ”. On the one hand, when x = y x=y x = y , x ≠ y + 1 x\neq y+1 x = y + 1 , so P ( x , y ) ⟹ ¬ Q ( x , y ) P(x, y)\implies \lnot Q(x, y) P ( x , y ) ⟹ ¬ Q ( x , y ) is true. So L H S \mathrm{LHS} L H S is false. But for all x x x . For ∃ y P ( x , y ) \exist y\ P(x, y) ∃ y P ( x , y ) , we just let y = x y=x y = x , so it is true. And for ∃ y Q ( x , y ) \exist y\ Q(x, y) ∃ y Q ( x , y ) , we just let y = x − 1 y = x - 1 y = x − 1 , so it is also true. In all R H S \mathrm{RHS} R H S is true. So L H S ≢ R H S \mathrm{LHS}\not\equiv\mathrm{RHS} L H S ≡ R H S .
(c)
L H S ≡ ∀ x ∃ y ( ¬ P ( x ) ∨ Q ( x , y ) ) R H S ≡ ∀ x ( ¬ P ( x ) ∨ ( ∃ y Q ( x , y ) ) ) \begin{aligned} \mathrm{LHS}&\equiv \forall x\exist y\ (\lnot P(x)\lor Q(x,y))\\ \mathrm{RHS}&\equiv\forall x\ (\lnot P(x)\lor(\exist y\ Q(x, y))) \end{aligned} L H S R H S ≡ ∀ x ∃ y ( ¬ P ( x ) ∨ Q ( x , y ) ) ≡ ∀ x ( ¬ P ( x ) ∨ ( ∃ y Q ( x , y ) ) )
If P ( x ) P(x) P ( x ) is true, L H S ≡ ∀ x ∃ y ( F ∨ Q ( x , y ) ) ≡ ∀ x ∃ y Q ( x , y ) \mathrm{LHS}\equiv \forall x\exist y\ (\mathtt{F}\lor Q(x, y))\equiv \forall x\exist y\ Q(x, y) L H S ≡ ∀ x ∃ y ( F ∨ Q ( x , y ) ) ≡ ∀ x ∃ y Q ( x , y ) , R H S ≡ ∀ x ( F ∨ ( ∃ y Q ( x , y ) ) ) ≡ ∀ x ∃ y Q ( x , y ) \mathrm{RHS}\equiv\forall x\ (\mathtt{F}\lor (\exist y\ Q(x, y)))\equiv \forall x\exist y\ Q(x, y) R H S ≡ ∀ x ( F ∨ ( ∃ y Q ( x , y ) ) ) ≡ ∀ x ∃ y Q ( x , y ) . So L H S ≡ R H S \mathrm{LHS}\equiv \mathrm{RHS} L H S ≡ R H S .
If P ( x ) P(x) P ( x ) is true, then L H S ≡ R H S ≡ T \mathrm{LHS}\equiv \mathrm{RHS}\equiv \mathtt{T} L H S ≡ R H S ≡ T .
In all L H S ≡ R H S \mathrm{LHS}\equiv\mathrm{RHS} L H S ≡ R H S .
Homework 0 5 Propositional Practice(a)
∃ x ∈ R ( ( x 2 = 0 ) ∧ ( ∀ y ∈ R ( ( y 2 = 0 ) ⟹ ( x = y ) ) ) ) . \exist x\in\R\ ((x^2=0)\land(\forall y\in\R\ ((y^2=0)\implies (x=y)))). ∃ x ∈ R ( ( x 2 = 0 ) ∧ ( ∀ y ∈ R ( ( y 2 = 0 ) ⟹ ( x = y ) ) ) ) .
(b)
∀ x ∈ Q ∀ y ∈ Q ∃ z ∈ Q ( ( x = y ) ∨ ( x < y < z ) ∨ ( x > y > z ) ) . \forall x\in\mathbb{Q}\ \forall y\in\mathbb{Q}\ \exist z\in \mathbb{Q}\ ((x=y)\lor (x<y<z)\lor(x>y>z)). ∀ x ∈ Q ∀ y ∈ Q ∃ z ∈ Q ( ( x = y ) ∨ ( x < y < z ) ∨ ( x > y > z ) ) .
(c)
∀ x ∈ Z ( ( x 2 > 4 ) ⟹ ( ( x < − 2 ) ∨ ( x > 2 ) ) ) . \forall x\in\Z\ ((x^2>4)\implies((x<-2)\lor(x>2))). ∀ x ∈ Z ( ( x 2 > 4 ) ⟹ ( ( x < − 2 ) ∨ ( x > 2 ) ) ) .
(d) All real numbers are complex numbers.
(e) There is no integer solution of x 2 − y 2 = 10 x^2-y^2=10 x 2 − y 2 = 1 0 .
(f) All greater than 2 2 2 natural numbers can be decomposed into the sum of two prime numbers.
Note 2 9 Exercises1.
n ≡ ∑ i = 0 k − 1 ( a i ⋅ 1 0 i ) ( m o d 9 ) ≡ ∑ i = 0 k − 1 ( a i ⋅ 1 0 i m o d 9 ) ( m o d 9 ) ≡ ∑ i = 0 k − 1 ( a i ⋅ ( 1 0 i m o d 9 ) ) ( m o d 9 ) ≡ ∑ i = 0 k − 1 ( a i ⋅ ( 10 m o d 9 ) i ) ( m o d 9 ) ≡ ∑ i = 0 k − 1 a i ( m o d 9 ) \begin{aligned} n&\equiv\sum_{i=0}^{k-1}\left(a_i\cdot 10^i\right)\pmod 9\\ &\equiv \sum_{i=0}^{k-1}\left(a_i\cdot 10^i\mod 9\right)\pmod 9\\ &\equiv \sum_{i=0}^{k-1}\left(a_i\cdot\left(10^i\mod 9\right)\right)\pmod 9\\ &\equiv \sum_{i=0}^{k-1}\left(a_i\cdot\left(10\mod 9\right)^i\right)\pmod 9\\ &\equiv \sum_{i=0}^{k-1}a_i\pmod 9 \end{aligned} n ≡ i = 0 ∑ k − 1 ( a i ⋅ 1 0 i ) ( m o d 9 ) ≡ i = 0 ∑ k − 1 ( a i ⋅ 1 0 i m o d 9 ) ( m o d 9 ) ≡ i = 0 ∑ k − 1 ( a i ⋅ ( 1 0 i m o d 9 ) ) ( m o d 9 ) ≡ i = 0 ∑ k − 1 ( a i ⋅ ( 1 0 m o d 9 ) i ) ( m o d 9 ) ≡ i = 0 ∑ k − 1 a i ( m o d 9 )
2.
a 2 is even ⟹ a is even ≡ ¬ ( a is even ) ⟹ ¬ ( a 2 is even ) ≡ a is odd ⟹ a 2 is odd \begin{aligned} &\text{$a^2$ is even}\implies \text{$a$ is even}\\ \equiv&\lnot(\text{$a$ is even})\implies \lnot(\text{$a^2$ is even})\\ \equiv& \text{$a$ is odd}\implies \text{$a^2$ is odd} \end{aligned} ≡ ≡ a 2 is even ⟹ a is even ¬ ( a is even ) ⟹ ¬ ( a 2 is even ) a is odd ⟹ a 2 is odd
Let a = 2 k + 1 , k ∈ Z a=2k+1, k\in \Z a = 2 k + 1 , k ∈ Z , we have a 2 = 4 k 2 + 4 k + 1 = 2 ( 2 k 2 + 1 ) + 1 a^2=4k^2+4k+1=2(2k^2+1)+1 a 2 = 4 k 2 + 4 k + 1 = 2 ( 2 k 2 + 1 ) + 1 , so a 2 a^2 a 2 is odd.
So a is odd ⟹ a 2 is odd a\text{is odd}\implies a^2\text{is odd} a is odd ⟹ a 2 is odd holds, so Lemma 2.2 holds.
Note 31. We proceed by induction on n n n .
Base Case: When n = 1 n=1 n = 1 , L H S = R H S = 1 \mathrm{LHS}=\mathrm{RHS}=1 L H S = R H S = 1 . So base case Holds.
Induction Hypothesis: Assume that ∑ i = 1 k i = 1 6 k ( k + 1 ) ( 2 k + 1 ) \sum_{i=1}^{k} i = \frac{1}{6}k(k+1)(2k+1) ∑ i = 1 k i = 6 1 k ( k + 1 ) ( 2 k + 1 ) .
Induction Step: When n = k + 1 n=k+1 n = k + 1 ,
∑ i = 1 k + 1 i = ( k + 1 ) + ∑ i = 1 k i = 1 6 k ( k + 1 ) ( 2 k + 1 ) + k + 1 = 1 6 ( k + 1 ) ( 2 k 2 + k + 6 k + 6 ) = 1 6 ( k + 1 ) ( 2 k 2 + 7 k + 6 ) = 1 6 ( k + 1 ) ( k + 2 ) ( 2 k + 3 ) \begin{aligned} \sum_{i=1}^{k+1}i&=(k+1)+\sum_{i=1}^{k} i\\ &=\frac{1}{6}k(k+1)(2k+1)+k+1\\ &=\frac{1}{6}(k+1)(2k^2+k+6k+6)\\ &=\frac{1}{6}(k+1)(2k^2+7k+6)\\ &=\frac{1}{6}(k+1)(k+2)(2k+3) \end{aligned} i = 1 ∑ k + 1 i = ( k + 1 ) + i = 1 ∑ k i = 6 1 k ( k + 1 ) ( 2 k + 1 ) + k + 1 = 6 1 ( k + 1 ) ( 2 k 2 + k + 6 k + 6 ) = 6 1 ( k + 1 ) ( 2 k 2 + 7 k + 6 ) = 6 1 ( k + 1 ) ( k + 2 ) ( 2 k + 3 )
Thus, ∀ n ∈ N \forall n\in\N ∀ n ∈ N , ∑ i = 1 n i = 1 6 n ( n + 1 ) ( 2 n + 1 ) \sum_{i=1}^{n} i = \frac{1}{6}n(n+1)(2n+1) ∑ i = 1 n i = 6 1 n ( n + 1 ) ( 2 n + 1 ) holds.
2. We proceed by induction on n n n .
Base Case: When n = 1 n=1 n = 1 , L H S = R H S = 1 + x \mathrm{LHS}=\mathrm{RHS}=1+x L H S = R H S = 1 + x . So base case Holds.
Induction Hypothesis: Assume that ( 1 + x ) k ≥ 1 + k x (1+x)^k\ge 1+kx ( 1 + x ) k ≥ 1 + k x , for k ∈ N k\in \N k ∈ N .
Induction Step: When n = k + 1 n=k+1 n = k + 1 ,
( 1 + x ) k + 1 = ( 1 + x ) ⋅ ( 1 + x ) k ≥ ( 1 + x ) ⋅ ( 1 + k x ) = 1 + ( k + 1 ) ⋅ x + k x 2 ≥ 1 + ( k + 1 ) ⋅ x \begin{aligned} (1+x)^{k+1}&=(1+x)\cdot(1+x)^k\\ &\ge(1+x)\cdot(1+kx)\\ &=1+(k+1)\cdot x+kx^2\\ &\ge 1+(k+1)\cdot x \end{aligned} ( 1 + x ) k + 1 = ( 1 + x ) ⋅ ( 1 + x ) k ≥ ( 1 + x ) ⋅ ( 1 + k x ) = 1 + ( k + 1 ) ⋅ x + k x 2 ≥ 1 + ( k + 1 ) ⋅ x
Thus, ∀ n ∈ N , x > − 1 , ( 1 + x ) n ≥ 1 + n x \forall n\in\N, x>-1, \ (1+x)^n\ge 1+nx ∀ n ∈ N , x > − 1 , ( 1 + x ) n ≥ 1 + n x holds.
3. We proceed by induction on n n n .
Base Case: When n = 2 n=2 n = 2 , L H S = 2 < 4 = R H S \mathrm{LHS}=2<4=\mathrm{RHS} L H S = 2 < 4 = R H S . So base case Holds.
Induction Hypothesis: Assume that k ! < k k k!<k^k k ! < k k , for k ∈ N , k > 1 k\in \N, k>1 k ∈ N , k > 1 .
Induction Step: When n = k + 1 n=k+1 n = k + 1 ,
( k + 1 ) ! = ( k + 1 ) ⋅ k ! < ( k + 1 ) ⋅ k k < ( k + 1 ) ⋅ ( k + 1 ) k = ( k + 1 ) k + 1 \begin{aligned} (k+1)!&=(k+1)\cdot k!\\ &<(k+1)\cdot k^k\\ &<(k+1)\cdot (k+1)^k\\ &=(k+1)^{k+1} \end{aligned} ( k + 1 ) ! = ( k + 1 ) ⋅ k ! < ( k + 1 ) ⋅ k k < ( k + 1 ) ⋅ ( k + 1 ) k = ( k + 1 ) k + 1
Thus, ∀ n ∈ N , n > 1 , n ! < n n \forall n\in\N, n>1, \ n!<n^n ∀ n ∈ N , n > 1 , n ! < n n holds.
4. We define an ask A → B A\to B A → B means asking A if he know B. And we define f ( n ) f(n) f ( n ) be the times of asking.
Base Case: When n = 2 n=2 n = 2 , there are just two people A and B. We could ask A → B A\to B A → B and B → A B\to A B → A . And now we know everything and it is easy for us to find the answer. We asked 3 n − 4 = 2 3n-4=2 3 n − 4 = 2 times. So f ( n ) ≤ 3 n − 4 f(n)\le 3n-4 f ( n ) ≤ 3 n − 4 holds for n = 1 n=1 n = 1 .
Induction Hypothesis: Assume that if there are k k k people, we could use 3 k − 4 3k-4 3 k − 4 asks to find the answer.
Induction Step: When n = k + 1 n=k+1 n = k + 1 , we could randomly choose two people A and B, asking A → B A\to B A → B .
Now there are two cases:
If A don’t know B. Then we could know that B is not celebrity. So we could just firstly remove B and solve the remaining k k k people to find the “celebrity” for these k k k people, which is C. (If now found, just return “not found”.) And after that, we should check if B knows C and C doesn’t know B. It cost f ( k + 1 ) = 3 + f ( k ) ≤ 3 + ( 3 k − 4 ) = 3 ( k + 1 ) − 4 f(k + 1)=3+f(k)\le 3+(3k-4)=3(k+1)-4 f ( k + 1 ) = 3 + f ( k ) ≤ 3 + ( 3 k − 4 ) = 3 ( k + 1 ) − 4 . If A knows B. Then we could know that A is not celebrity. Then we can prove as in the first case, changing B to A. So f ( k + 1 ) ≤ 3 ( k + 1 ) − 4 f(k+1)\le 3(k+1)-4 f ( k + 1 ) ≤ 3 ( k + 1 ) − 4 . And as a conclusion, f ( n ) ≤ 3 n − 4 f(n)\le 3n-4 f ( n ) ≤ 3 n − 4 holds for all n ∈ N , n ≥ 2 n\in\N, n\ge 2 n ∈ N , n ≥ 2 .
5. The python code shows below:
1 2 3 def solve (n ): base_case = [(3 , 0 ), (2 , 1 ), (1 , 2 ), (0 , 3 )] return base_case[n % 4 ][0 ] + (n - 12 ) // 4 , base_case[n % 4 ][1 ]
The largest number of 5c stamps my algorithm will ever use is 3 3 3 .
Discussion 1A 1 Contraposition( a + b < c + d ) ⟹ ( a < c ) ∨ ( b < d ) ≡ ¬ ( ( a < c ) ∨ ( b < d ) ) ⟹ ¬ ( a + b < c + d ) ≡ ( a ≥ c ) ∧ ( b ≥ d ) ⟹ ( a + b ≥ c + d ) \begin{aligned} &(a+b<c+d)\implies (a<c)\lor(b<d)\\ \equiv& \lnot((a<c)\lor(b<d))\implies \lnot(a+b<c+d)\\ \equiv & (a\ge c)\land(b\ge d) \implies (a+b\ge c+d) \end{aligned} ≡ ≡ ( a + b < c + d ) ⟹ ( a < c ) ∨ ( b < d ) ¬ ( ( a < c ) ∨ ( b < d ) ) ⟹ ¬ ( a + b < c + d ) ( a ≥ c ) ∧ ( b ≥ d ) ⟹ ( a + b ≥ c + d )
2 Numbers of FriendsWe let the i i i -th person have a i a_i a i friends. We have a i ∈ [ 0 , n − 1 ] ∩ Z a_i\in[0, n-1]\cap \Z a i ∈ [ 0 , n − 1 ] ∩ Z .
Then we check if there exist k ∈ [ 0 , n − 1 ] ∩ Z k\in [0, n-1]\cap\Z k ∈ [ 0 , n − 1 ] ∩ Z , ∀ i , a i ≠ k \forall i, a_i\neq k ∀ i , a i = k .
∃ k ∈ [ 0 , n − 1 ] ∩ Z , ∀ i , a i ≠ k \exist k\in [0, n-1]\cap\Z, \forall i, a_i\neq k ∃ k ∈ [ 0 , n − 1 ] ∩ Z , ∀ i , a i = k . Which means, ∀ i , a i ∈ [ 0 , n − 1 ] ∩ Z \ { k } \forall i, a_i\in [0, n-1]\cap\Z\backslash\{k\} ∀ i , a i ∈ [ 0 , n − 1 ] ∩ Z \ { k } . And since ∣ [ 0 , n − 1 ] ∩ Z \ { k } ∣ = n − 1 \left|[0, n-1]\cap\Z\backslash\{k\}\right|=n-1 ∣ [ 0 , n − 1 ] ∩ Z \ { k } ∣ = n − 1 , and there are n n n numbers. Due to the Pigeonhole Principle, there must be 2 2 2 of them have the same number.If ∀ k ∈ [ 0 , n − 1 ] ∩ Z , ∃ i , a i = k \forall k\in [0, n-1]\cap\Z, \exist i, a_i=k ∀ k ∈ [ 0 , n − 1 ] ∩ Z , ∃ i , a i = k , there must be some one with 0 0 0 friends (name A) and some one with n − 1 n-1 n − 1 friends (name B). A have 0 0 0 friends shows that A and B are not friends, but B have n − 1 n-1 n − 1 friends shows that A and B are friends. This forms a contradiction, so this case is impossible. In all, there must be at least 2 2 2 of them have the same number of friends at the party.
3 PebblesIf there is no all-red column exist, which means all column has a blue pebble, for every column, we could just choose that blue pebble, then there exist a way choosing makes no red pebble. So there must exist all-red column.
4 Preserving Set Operations(a) We want to prove f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) and f − 1 ( A ∪ B ) ⊇ f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)\supseteq f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) ⊇ f − 1 ( A ) ∪ f − 1 ( B ) .
We first show f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) .
Let x ∈ f − 1 ( A ∪ B ) x\in f^{-1}(A\cup B) x ∈ f − 1 ( A ∪ B ) , which means f ( x ) ∈ A ∪ B f(x)\in A\cup B f ( x ) ∈ A ∪ B . So ( f ( x ) ∈ A ) ∨ ( f ( x ) ∈ B ) (f(x)\in A)\lor (f(x)\in B) ( f ( x ) ∈ A ) ∨ ( f ( x ) ∈ B ) . So ( x ∈ f − 1 ( A ) ) ∨ ( x ∈ f − 1 ( B ) ) \left(x\in f^{-1}(A)\right)\lor \left(x\in f^{-1}(B)\right) ( x ∈ f − 1 ( A ) ) ∨ ( x ∈ f − 1 ( B ) ) , which means x ∈ f − 1 ( A ) ∪ f − 1 ( B ) x\in f^{-1}(A)\cup f^{-1}(B) x ∈ f − 1 ( A ) ∪ f − 1 ( B ) . So f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) ⊆ f − 1 ( A ) ∪ f − 1 ( B ) .
Then let’s prove f − 1 ( A ∪ B ) ⊇ f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)\supseteq f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) ⊇ f − 1 ( A ) ∪ f − 1 ( B ) .
We let x ∈ f − 1 ( A ) ∪ f − 1 ( B ) x\in f^{-1}(A)\cup f^{-1}(B) x ∈ f − 1 ( A ) ∪ f − 1 ( B ) , which means x ∈ f − 1 ( A ) x\in f^{-1}(A) x ∈ f − 1 ( A ) or x ∈ f − 1 ( B ) x\in f^{-1}(B) x ∈ f − 1 ( B ) . So f ( x ) ∈ A f(x)\in A f ( x ) ∈ A or f ( x ) ∈ B f(x)\in B f ( x ) ∈ B , which is f ( x ) ∈ A ∪ B f(x)\in A\cup B f ( x ) ∈ A ∪ B . So x ∈ f − 1 ( A ∪ B ) x\in f^{-1}(A\cup B) x ∈ f − 1 ( A ∪ B ) . So f − 1 ( A ) ∪ f − 1 ( B ) ⊆ f − 1 ( A ∪ B ) f^{-1}(A)\cup f^{-1}(B)\subseteq f^{-1}(A\cup B) f − 1 ( A ) ∪ f − 1 ( B ) ⊆ f − 1 ( A ∪ B ) .
In all, f − 1 ( A ∪ B ) = f − 1 ( A ) ∪ f − 1 ( B ) f^{-1}(A\cup B)=f^{-1}(A)\cup f^{-1}(B) f − 1 ( A ∪ B ) = f − 1 ( A ) ∪ f − 1 ( B ) .
(b) We want to prove f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) f(A\cup B)\subseteq f(A)\cup f(B) f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) and f ( A ∪ B ) ⊇ f ( A ) ∪ f ( B ) f(A\cup B)\supseteq f(A)\cup f(B) f ( A ∪ B ) ⊇ f ( A ) ∪ f ( B ) .
We firstly prove f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) f(A\cup B)\subseteq f(A)\cup f(B) f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) . Let x ∈ f ( A ∪ B ) x\in f(A\cup B) x ∈ f ( A ∪ B ) , which is ∃ y ∈ A ∪ B , f ( y ) = x \exist y\in A\cup B, f(y)=x ∃ y ∈ A ∪ B , f ( y ) = x . So ∃ y ∈ A , f ( y ) = x \exist y\in A, f(y)=x ∃ y ∈ A , f ( y ) = x or ∃ y ∈ B , f ( y ) = x \exist y\in B, f(y)=x ∃ y ∈ B , f ( y ) = x . So x ∈ f ( A ) x\in f(A) x ∈ f ( A ) or x ∈ f ( B ) x\in f(B) x ∈ f ( B ) . So x ∈ f ( A ) ∪ f ( B ) x\in f(A)\cup f(B) x ∈ f ( A ) ∪ f ( B ) . So f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) f(A\cup B)\subseteq f(A)\cup f(B) f ( A ∪ B ) ⊆ f ( A ) ∪ f ( B ) .
Then we want to prove f ( A ∪ B ) ⊇ f ( A ) ∪ f ( B ) f(A\cup B)\supseteq f(A)\cup f(B) f ( A ∪ B ) ⊇ f ( A ) ∪ f ( B ) . Let x ∈ f ( A ) ∪ f ( B ) x\in f(A)\cup f(B) x ∈ f ( A ) ∪ f ( B ) , which is x ∈ f ( A ) x\in f(A) x ∈ f ( A ) or x ∈ f ( B ) x\in f(B) x ∈ f ( B ) . So ∃ y ∈ A , x = f ( y ) \exist y\in A, x=f(y) ∃ y ∈ A , x = f ( y ) or ∃ y ∈ B , x = f ( y ) \exist y\in B, x = f(y) ∃ y ∈ B , x = f ( y ) . So ∃ y ∈ A ∪ B , x = f ( y ) \exist y\in A\cup B, x = f(y) ∃ y ∈ A ∪ B , x = f ( y ) . So x ∈ f ( A ∪ B ) x\in f(A\cup B) x ∈ f ( A ∪ B ) . So f ( A ) ∪ f ( B ) ⊆ f ( A ∪ B ) f(A)\cup f(B)\subseteq f(A\cup B) f ( A ) ∪ f ( B ) ⊆ f ( A ∪ B ) .
In all f ( A ∪ B ) = f ( A ) ∪ f ( B ) f(A\cup B)=f(A)\cup f(B) f ( A ∪ B ) = f ( A ) ∪ f ( B ) .
Discussion 1B 1 Natural Induction on InequalityThe same as Note 3 Question 2.
We proceed by induction on n n n .
Base Case: When n = 1 n=1 n = 1 , L H S = R H S = 1 + x \mathrm{LHS}=\mathrm{RHS}=1+x L H S = R H S = 1 + x . So base case Holds.
Induction Hypothesis: Assume that ( 1 + x ) k ≥ 1 + k x (1+x)^k\ge 1+kx ( 1 + x ) k ≥ 1 + k x , for k ∈ N k\in \N k ∈ N .
Induction Step: When n = k + 1 n=k+1 n = k + 1 ,
( 1 + x ) k + 1 = ( 1 + x ) ⋅ ( 1 + x ) k ≥ ( 1 + x ) ⋅ ( 1 + k x ) = 1 + ( k + 1 ) ⋅ x + k x 2 ≥ 1 + ( k + 1 ) ⋅ x \begin{aligned} (1+x)^{k+1}&=(1+x)\cdot(1+x)^k\\ &\ge(1+x)\cdot(1+kx)\\ &=1+(k+1)\cdot x+kx^2\\ &\ge 1+(k+1)\cdot x \end{aligned} ( 1 + x ) k + 1 = ( 1 + x ) ⋅ ( 1 + x ) k ≥ ( 1 + x ) ⋅ ( 1 + k x ) = 1 + ( k + 1 ) ⋅ x + k x 2 ≥ 1 + ( k + 1 ) ⋅ x
Thus, ∀ n ∈ N , x > 0 , ( 1 + x ) n ≥ 1 + n x \forall n\in\N, x>0, \ (1+x)^n\ge 1+nx ∀ n ∈ N , x > 0 , ( 1 + x ) n ≥ 1 + n x holds.
2 Make It Stronger(a) No. If we let a n ≤ 3 2 n a_n\le 3^{2^n} a n ≤ 3 2 n , a n + 1 = 3 a n 2 ≤ 3 ⋅ ( 3 2 n ) 2 = 3 2 n + 1 + 1 a_{n+1}=3a_n^2\le 3\cdot\left(3^{2^n}\right)^2=3^{2^{n+1}+1} a n + 1 = 3 a n 2 ≤ 3 ⋅ ( 3 2 n ) 2 = 3 2 n + 1 + 1 . But 3 2 n + 1 + 1 ≥ 3 2 n + 1 3^{2^{n+1}+1}\ge 3^{2^{n+1}} 3 2 n + 1 + 1 ≥ 3 2 n + 1 , so it doesn’t work.
(b) Let’s prove by induction.
Base Case: When n = 1 n=1 n = 1 , a 1 = 1 a_1=1 a 1 = 1 , 3 2 n − 1 = 3 3^{2^n-1}=3 3 2 n − 1 = 3 . So a n ≤ 3 2 n − 1 a_n\le 3^{2^n-1} a n ≤ 3 2 n − 1 holds for n = 1 n=1 n = 1 .
Induction Hypothesis: Assume that a k ≤ 3 2 k − 1 a_k\le 3^{2^k-1} a k ≤ 3 2 k − 1 , for k ∈ N k\in \N k ∈ N .
Induction Step: When n = k + 1 n=k+1 n = k + 1 :
a k + 1 = 3 a k 2 ≤ 3 ⋅ ( 3 2 k − 1 ) 2 = 3 2 k + 1 − 1 . a_{k+1}=3a_{k}^2\le 3\cdot \left(3^{2^k-1}\right)^2=3^{2^{k+1}-1}. a k + 1 = 3 a k 2 ≤ 3 ⋅ ( 3 2 k − 1 ) 2 = 3 2 k + 1 − 1 .
So for all n ∈ N + n\in\N^+ n ∈ N + , a n ≤ 3 2 n − 1 a_n\le 3^{2^n-1} a n ≤ 3 2 n − 1 .
(c) For n ∈ N n\in\N n ∈ N , a n ≤ 3 2 n − 1 = 1 3 ⋅ 3 2 n ≤ 3 2 n a_n\le 3^{2^n-1}=\frac{1}{3}\cdot 3^{2^n}\le 3^{2^n} a n ≤ 3 2 n − 1 = 3 1 ⋅ 3 2 n ≤ 3 2 n .
3 Binary NumbersWe proceed by induction on n n n .
Base Case: When n = 1 n=1 n = 1 , let c 0 = 1 c_0=1 c 0 = 1 , n = 1 ⋅ 2 0 n=1\cdot 2^0 n = 1 ⋅ 2 0 . So the assumption holds when n = 1 n=1 n = 1 .
Induction Hypothesis: We assume that the proposition holds for n ≤ t n\le t n ≤ t .
Induction Step: We use the parity of t+1 for discussion.
If t + 1 t + 1 t + 1 is an odd number. Let t 2 = ∑ i = 0 k c k ⋅ 2 k \frac{t}{2}=\sum_{i=0}^k c_k\cdot 2^k 2 t = ∑ i = 0 k c k ⋅ 2 k , then t + 1 = 2 ⋅ t 2 + 1 = 2 ∑ i = 0 k c i ⋅ 2 i + 1 = ∑ i = 1 k + 1 c i − 1 ⋅ 2 i + 1 ⋅ 2 0 t + 1=2\cdot \frac{t}{2}+1=2\sum_{i=0}^k c_i\cdot 2^i+1=\sum_{i=1}^{k+1}c_{i-1}\cdot 2^i+1\cdot 2^0 t + 1 = 2 ⋅ 2 t + 1 = 2 ∑ i = 0 k c i ⋅ 2 i + 1 = ∑ i = 1 k + 1 c i − 1 ⋅ 2 i + 1 ⋅ 2 0 .
If t + 1 t+1 t + 1 is an even number. Let t + 1 2 = ∑ i = 0 k c i ⋅ 2 i \frac{t + 1}{2}=\sum_{i=0}^k c_i\cdot 2^i 2 t + 1 = ∑ i = 0 k c i ⋅ 2 i , then t + 1 = 2 ⋅ t + 1 2 = 2 ∑ i = 0 k c i ⋅ 2 i = ∑ i = 1 k + 1 c i ⋅ 2 i + 0 ⋅ 2 0 t+1=2\cdot\frac{t+1}{2}=2\sum_{i=0}^k c_i\cdot 2^i=\sum_{i=1}^{k+1} c_i\cdot 2^i+0\cdot 2^0 t + 1 = 2 ⋅ 2 t + 1 = 2 ∑ i = 0 k c i ⋅ 2 i = ∑ i = 1 k + 1 c i ⋅ 2 i + 0 ⋅ 2 0 .
In all, the proposition holds.
4 Fibonacci for HomeLet P ( n ) P(n) P ( n ) be the proposition that 2 ∣ F 3 n 2\mid F_{3n} 2 ∣ F 3 n . Let’s prove it by induction.
Base Case: When n = 1 n=1 n = 1 , F 3 n = 2 F_{3n}=2 F 3 n = 2 so 2 ∣ F 3 n 2\mid F_{3n} 2 ∣ F 3 n .
Induction Hypothesis: We assume that 2 ∣ F 3 k 2\mid F_{3k} 2 ∣ F 3 k when k ∈ N k\in\N k ∈ N .
Induction Step:
F 3 ( k + 1 ) ≡ F 3 k + 3 ( m o d 2 ) ≡ F 3 k + 2 + F 3 k + 1 ( m o d 2 ) ≡ F 3 k + 1 + F 3 k + F 3 k + 1 ( m o d 2 ) ≡ 2 F 3 k + 1 + F 3 k ( m o d 2 ) ≡ 0 ( m o d 2 ) \begin{aligned} F_{3(k+1)}&\equiv F_{3k+3}\pmod 2\\ &\equiv F_{3k+2}+F_{3k+1}\pmod 2\\ &\equiv F_{3k+1}+F_{3k}+F_{3k+1}\pmod 2\\ &\equiv 2F_{3k+1}+F_{3k}\pmod 2\\ &\equiv 0\pmod 2 \end{aligned} F 3 ( k + 1 ) ≡ F 3 k + 3 ( m o d 2 ) ≡ F 3 k + 2 + F 3 k + 1 ( m o d 2 ) ≡ F 3 k + 1 + F 3 k + F 3 k + 1 ( m o d 2 ) ≡ 2 F 3 k + 1 + F 3 k ( m o d 2 ) ≡ 0 ( m o d 2 )
So 2 ∣ F 3 ( k + 1 ) 2\mid F_{3(k+1)} 2 ∣ F 3 ( k + 1 ) .
In all, ∀ n ∈ N , 2 ∣ F 3 n \forall n\in \N, 2\mid F_{3n} ∀ n ∈ N , 2 ∣ F 3 n .
Homework 1 1 Solving a System of EquationsLet the prices for an apple, for a beet, and for a carrot be a , b , c a, b, c a , b , c separately. Then we have:
[ 1 1 1 2 3 0 1 2 3 ] ⋅ [ a b c ] = [ 16 23 35 ] \begin{bmatrix} 1 & 1 & 1 \\ 2 & 3 & 0 \\ 1 & 2 & 3 \end{bmatrix} \cdot \begin{bmatrix} a\\ b\\ c \end{bmatrix} = \begin{bmatrix} 16\\ 23\\ 35 \end{bmatrix} ⎣ ⎢ ⎡ 1 2 1 1 3 2 1 0 3 ⎦ ⎥ ⎤ ⋅ ⎣ ⎢ ⎡ a b c ⎦ ⎥ ⎤ = ⎣ ⎢ ⎡ 1 6 2 3 3 5 ⎦ ⎥ ⎤
1 2 3 4 A = [1 1 1 ; 2 3 0 ; 1 2 3 ]; b = [16 ; 23 ; 35 ]; x = inv(A) * b; disp (x);
Solving this equation, we get x = [ 4 5 7 ] T x=\begin{bmatrix}4&5&7\end{bmatrix}^{\mathrm{T}} x = [ 4 5 7 ] T . So a = 4 , b = 5 , c = 7 a=4, b=5, c=7 a = 4 , b = 5 , c = 7 .
2 Calculus Review(a)
∫ 0 ∞ e − t sin t d t = − ∫ 0 ∞ sin t d ( e − t ) = − ( ( sin ( t ) ⋅ e − t ) 0 ∞ − ∫ 0 ∞ e − t d ( sin t ) ) = ∫ 0 ∞ e − t cos t d t = − ∫ 0 ∞ cos t d ( e − t ) = − ( ( e − t cos t ) 0 ∞ − ∫ 0 ∞ e − t d ( cos t ) ) = ∫ 0 ∞ e − t d ( cos t ) − ( e − t cos t ) 0 ∞ = − ∫ 0 ∞ e − t sin t d t + 1 \begin{aligned} \int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t&=-\int_{0}^{\infty}\sin t\ \mathrm{d}\left(e^{-t}\right)\\ &=-\left(\left(\sin(t)\cdot e^{-t}\right)_0^{\infty}-\int_{0}^\infty e^{-t}\ \mathrm{d}(\sin t)\right)\\ &=\int_{0}^{\infty}e^{-t}\cos t\ \mathrm{d}t\\ &=-\int_{0}^{\infty}\cos t\ \mathrm{d}\left(e^{-t}\right)\\ &=-\left(\left(e^{-t}\cos t\right)_{0}^{\infty}-\int_{0}^{\infty}e^{-t}\ \mathrm{d}(\cos t)\right)\\ &=\int_{0}^{\infty}e^{-t}\ \mathrm{d}(\cos t)-\left(e^{-t}\cos t\right)_{0}^{\infty}\\ &=-\int^\infty_0e^{-t}\sin t\ \mathrm{d}t+1 \end{aligned} ∫ 0 ∞ e − t sin t d t = − ∫ 0 ∞ sin t d ( e − t ) = − ( ( sin ( t ) ⋅ e − t ) 0 ∞ − ∫ 0 ∞ e − t d ( sin t ) ) = ∫ 0 ∞ e − t cos t d t = − ∫ 0 ∞ cos t d ( e − t ) = − ( ( e − t cos t ) 0 ∞ − ∫ 0 ∞ e − t d ( cos t ) ) = ∫ 0 ∞ e − t d ( cos t ) − ( e − t cos t ) 0 ∞ = − ∫ 0 ∞ e − t sin t d t + 1
So,
∫ 0 ∞ e − t sin t d t = − ∫ 0 ∞ e − t sin t d t + 1. \int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t=-\int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t+1. ∫ 0 ∞ e − t sin t d t = − ∫ 0 ∞ e − t sin t d t + 1 .
Which is
∫ 0 ∞ e − t sin t d t = 1 2 . \int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t=\frac{1}{2}. ∫ 0 ∞ e − t sin t d t = 2 1 .
1 2 syms x; disp (int(sin (x) * exp (-x), 0 , inf ));
(b)
f ′ ( x ) = 2 x ⋅ e − x 4 f'(x)=2x\cdot e^{-x^4} f ′ ( x ) = 2 x ⋅ e − x 4
Since e − x 4 > 0 e^{-x^4}>0 e − x 4 > 0 , f ′ ( x ) < 0 f'(x)<0 f ′ ( x ) < 0 when x < 0 x<0 x < 0 and f ′ ( x ) > 0 f'(x)>0 f ′ ( x ) > 0 when x > 0 x>0 x > 0 .
So when x = 0 x=0 x = 0 , the minimum value of f ( x ) f(x) f ( x ) is 0 0 0 .
(c)
∬ R 2 x + y d A = ∫ 0 1 d x ∫ 0 x 2 x + y d y = ∫ 0 1 ( 2 x y + 1 2 y 2 ) y = 0 y = x d x = ∫ 0 1 5 2 x 2 d x = 5 6 \begin{aligned} \iint_R 2x+y\ \mathrm{d}A&=\int_0^1\mathrm{d}x\int_{0}^{x}2x+y\ \mathrm{d}y\\ &=\int_{0}^{1}\left(2xy+\frac{1}{2}y^2\right)_{y=0}^{y=x}\mathrm{d}x\\ &=\int_{0}^{1}\frac{5}{2}x^2\ \mathrm{d}x\\ &=\frac{5}{6} \end{aligned} ∬ R 2 x + y d A = ∫ 0 1 d x ∫ 0 x 2 x + y d y = ∫ 0 1 ( 2 x y + 2 1 y 2 ) y = 0 y = x d x = ∫ 0 1 2 5 x 2 d x = 6 5
3 Implication(a) True.
(b) False. Let Q ( x , y ) Q(x, y) Q ( x , y ) be x = y x=y x = y .
(c) True. For all y y y , we just choose the x x x previously selected.
(d) True.
4 Logical Equivalence?(a) True.
∀ x ( P ( x ) ∧ Q ( x ) ) ≡ ⋀ x ( P ( x ) ∧ Q ( x ) ) ≡ ( ⋀ x P ( x ) ) ∧ ( ⋀ x Q ( x ) ) ≡ ( ∀ x P ( x ) ) ∧ ( ∀ x Q ( x ) ) \begin{aligned} \forall x\ (P(x)\land Q(x))&\equiv\bigwedge_{x}(P(x)\land Q(x))\\&\equiv\left(\bigwedge_x P(x)\right)\land\left(\bigwedge_x Q(x)\right)\\ &\equiv \left(\forall x\ P(x)\right)\land\left(\forall x\ Q(x)\right) \end{aligned} ∀ x ( P ( x ) ∧ Q ( x ) ) ≡ x ⋀ ( P ( x ) ∧ Q ( x ) ) ≡ ( x ⋀ P ( x ) ) ∧ ( x ⋀ Q ( x ) ) ≡ ( ∀ x P ( x ) ) ∧ ( ∀ x Q ( x ) )
(b) False.
Let P ( x ) = ( x > 0 ) , Q ( x ) = ( x ≤ 0 ) P(x)=(x>0), Q(x)=(x\le 0) P ( x ) = ( x > 0 ) , Q ( x ) = ( x ≤ 0 ) . ∀ x ( P ( x ) ∧ Q ( x ) ) \forall x\ (P(x)\land Q(x)) ∀ x ( P ( x ) ∧ Q ( x ) ) is true but ( ∀ x P ( x ) ) ∨ ( ∀ x Q ( x ) ) \left(\forall x\ P(x)\right)\lor\left(\forall x\ Q(x)\right) ( ∀ x P ( x ) ) ∨ ( ∀ x Q ( x ) ) is false.
(c) True.
∃ x ( P ( x ) ∨ Q ( x ) ) ≡ ⋁ x ( P ( x ) ∨ Q ( x ) ) ≡ ( ⋁ x P ( x ) ) ∨ ( ⋁ x Q ( x ) ) ≡ ( ∃ x P ( x ) ) ∨ ( ∃ x Q ( x ) ) \begin{aligned} \exist x\ (P(x)\lor Q(x))&\equiv\bigvee_{x}(P(x)\lor Q(x))\\&\equiv\left(\bigvee_x P(x)\right)\lor\left(\bigvee_x Q(x)\right)\\ &\equiv \left(\exist x\ P(x)\right)\lor\left(\exist x\ Q(x)\right) \end{aligned} ∃ x ( P ( x ) ∨ Q ( x ) ) ≡ x ⋁ ( P ( x ) ∨ Q ( x ) ) ≡ ( x ⋁ P ( x ) ) ∨ ( x ⋁ Q ( x ) ) ≡ ( ∃ x P ( x ) ) ∨ ( ∃ x Q ( x ) )
(d) False.
Let P ( x ) = ( x = 2 ) P(x)=(x=2) P ( x ) = ( x = 2 ) and Q ( x ) = ( x = 3 ) Q(x)=(x=3) Q ( x ) = ( x = 3 ) . L H S \mathrm{LHS} L H S is false but R H S \mathrm{RHS} R H S is true.
5 Preserving Set Operations(a)
x ∈ f − 1 ( A ∩ B ) ⟺ f ( x ) ∈ A ∩ B ⟺ ( f ( x ) ∈ A ) ∧ ( f ( x ) ∈ B ) ⟺ ( x ∈ f − 1 ( A ) ) ∧ ( x ∈ f − 1 ( B ) ) ⟺ x ∈ f − 1 ( A ) ∩ f − 1 ( B ) \begin{aligned} &x\in f^{-1}(A\cap B)\\ \Longleftrightarrow\ &f(x)\in A\cap B\\ \Longleftrightarrow\ &\left(f(x)\in A\right)\land \left(f(x)\in B\right)\\ \Longleftrightarrow\ &\left(x\in f^{-1}(A)\right)\land \left(x\in f^{-1}(B)\right)\\ \Longleftrightarrow\ &x\in f^{-1}(A)\cap f^{-1}(B) \end{aligned} ⟺ ⟺ ⟺ ⟺ x ∈ f − 1 ( A ∩ B ) f ( x ) ∈ A ∩ B ( f ( x ) ∈ A ) ∧ ( f ( x ) ∈ B ) ( x ∈ f − 1 ( A ) ) ∧ ( x ∈ f − 1 ( B ) ) x ∈ f − 1 ( A ) ∩ f − 1 ( B )
So f − 1 ( A ∩ B ) = f − 1 ( A ) ∩ f − 1 ( B ) f^{-1}(A\cap B)=f^{-1}(A)\cap f^{-1}(B) f − 1 ( A ∩ B ) = f − 1 ( A ) ∩ f − 1 ( B ) .
(b)
x ∈ f − 1 ( A ∖ B ) ⟺ f ( x ) ∈ A ∖ B ⟺ ( f ( x ) ∈ A ) ∧ ( f ( x ) ∉ B ) ⟺ ( x ∈ f − 1 ( A ) ) ∧ ( x ∉ f − 1 ( B ) ) ⟺ x ∈ f − 1 ( A ) ∖ f − 1 ( B ) \begin{aligned} &x\in f^{-1}(A\setminus B)\\ \Longleftrightarrow\ &f(x)\in A\setminus B\\ \Longleftrightarrow\ &(f(x)\in A)\land (f(x)\not\in B)\\ \Longleftrightarrow\ &(x\in f^{-1}(A))\land (x\not\in f^{-1}(B))\\ \Longleftrightarrow\ &x\in f^{-1}(A)\setminus f^{-1}(B) \end{aligned} ⟺ ⟺ ⟺ ⟺ x ∈ f − 1 ( A ∖ B ) f ( x ) ∈ A ∖ B ( f ( x ) ∈ A ) ∧ ( f ( x ) ∈ B ) ( x ∈ f − 1 ( A ) ) ∧ ( x ∈ f − 1 ( B ) ) x ∈ f − 1 ( A ) ∖ f − 1 ( B )
So f − 1 ( A ∖ B ) = f − 1 ( A ) ∖ f − 1 ( B ) f^{-1}(A\setminus B)=f^{-1}(A)\setminus f^{-1}(B) f − 1 ( A ∖ B ) = f − 1 ( A ) ∖ f − 1 ( B ) .
(c)
y ∈ f ( A ∩ B ) ⟺ ∃ x ∈ A ∩ B , f ( x ) = y ⟹ ( ∃ x ∈ A , f ( x ) = y ) ∧ ( ∃ x ∈ B , f ( x ) = y ) ⟺ ( y ∈ f ( A ) ) ∧ ( y ∈ f ( B ) ) ⟺ y ∈ f ( A ) ∩ f ( B ) \begin{aligned} &y\in f(A\cap B)\\ \Longleftrightarrow\ &\exist x\in A\cap B, f(x)=y\\ \implies&(\exist x \in A, f(x)=y)\land (\exist x\in B, f(x)=y)\\ \Longleftrightarrow\ &(y\in f(A))\land (y\in f(B))\\ \Longleftrightarrow\ &y\in f(A)\cap f(B) \end{aligned} ⟺ ⟹ ⟺ ⟺ y ∈ f ( A ∩ B ) ∃ x ∈ A ∩ B , f ( x ) = y ( ∃ x ∈ A , f ( x ) = y ) ∧ ( ∃ x ∈ B , f ( x ) = y ) ( y ∈ f ( A ) ) ∧ ( y ∈ f ( B ) ) y ∈ f ( A ) ∩ f ( B )
So f ( A ∩ B ) ⊆ f ( A ) ∩ f ( B ) f(A\cap B)\subseteq f(A)\cap f(B) f ( A ∩ B ) ⊆ f ( A ) ∩ f ( B ) .
The counterexample for f ( A ∩ B ) = f ( A ) ∩ f ( B ) f(A\cap B)= f(A)\cap f(B) f ( A ∩ B ) = f ( A ) ∩ f ( B ) is when A = { 2 } A=\{2\} A = { 2 } and B = { − 2 } B = \{-2\} B = { − 2 } , and we let f ( x ) = x 2 f(x)=x^2 f ( x ) = x 2 . f ( A ∩ B ) = ∅ f(A\cap B)=\emptyset f ( A ∩ B ) = ∅ but f ( A ) ∩ f ( B ) = { 4 } f(A)\cap f(B)=\{4\} f ( A ) ∩ f ( B ) = { 4 } .
(d)
y ∈ f ( A ∖ B ) ⟺ ∃ x ∈ A ∖ B , f ( x ) = y ⟸ ( ∃ x ∈ A , f ( x ) = y ) ∧ ( ∀ x ∈ B , f ( x ) ≠ y ) ⟺ ( y ∈ f ( A ) ) ∧ ( y ∉ f ( B ) ) ⟺ y ∈ f ( A ) ∖ f ( B ) \begin{aligned} &y\in f(A\setminus B)\\ \Longleftrightarrow\ &\exist x\in A\setminus B, f(x)=y\\ \impliedby\ &(\exist x \in A, f(x)=y)\land (\forall x\in B, f(x)\neq y)\\ \Longleftrightarrow\ &(y\in f(A))\land (y\not\in f(B))\\ \Longleftrightarrow\ &y\in f(A)\setminus f(B) \end{aligned} ⟺ ⟸ ⟺ ⟺ y ∈ f ( A ∖ B ) ∃ x ∈ A ∖ B , f ( x ) = y ( ∃ x ∈ A , f ( x ) = y ) ∧ ( ∀ x ∈ B , f ( x ) = y ) ( y ∈ f ( A ) ) ∧ ( y ∈ f ( B ) ) y ∈ f ( A ) ∖ f ( B )
So f ( A ∖ B ) ⊇ f ( A ) ∖ f ( B ) f(A\setminus B)\supseteq f(A)\setminus f(B) f ( A ∖ B ) ⊇ f ( A ) ∖ f ( B ) .
The counterexample for f ( A ∖ B ) = f ( A ) ∖ f ( B ) f(A\setminus B)= f(A)\setminus f(B) f ( A ∖ B ) = f ( A ) ∖ f ( B ) is when A = { − 2 , 2 } A=\{-2, 2\} A = { − 2 , 2 } and B = { − 2 } B = \{-2\} B = { − 2 } , and we let f ( x ) = x 2 f(x)=x^2 f ( x ) = x 2 . f ( A ∖ B ) = { 4 } f(A\setminus B)=\{4\} f ( A ∖ B ) = { 4 } but f ( A ) ∩ f ( B ) = ∅ f(A)\cap f(B)=\emptyset f ( A ) ∩ f ( B ) = ∅ .
6 Prove or Disprove(a) True. Let n = 2 k + 1 n=2k+1 n = 2 k + 1 , k ∈ Z k\in \Z k ∈ Z . n 2 + 4 n = 4 k 2 + 12 k + 5 n^2+4n=4k^2+12k+5 n 2 + 4 n = 4 k 2 + 1 2 k + 5 is an odd number.
(b) True.
a + b ≤ 15 ⟹ ( a ≤ 11 ) ∨ ( b ≤ 4 ) ≡ ¬ ( ( a ≤ 11 ) ∨ ( b ≤ 4 ) ) ⟹ ¬ ( a + b ≤ 15 ) ≡ ( a > 15 ) ∧ ( b > 4 ) ⟹ a + b > 15 \begin{aligned} &a + b\le 15\implies (a\le 11) \lor (b\le 4)\\ \equiv\ &\lnot((a\le 11) \lor (b\le 4))\implies \lnot(a + b\le 15)\\ \equiv\ &(a > 15)\land (b>4)\implies a + b > 15 \end{aligned} ≡ ≡ a + b ≤ 1 5 ⟹ ( a ≤ 1 1 ) ∨ ( b ≤ 4 ) ¬ ( ( a ≤ 1 1 ) ∨ ( b ≤ 4 ) ) ⟹ ¬ ( a + b ≤ 1 5 ) ( a > 1 5 ) ∧ ( b > 4 ) ⟹ a + b > 1 5
(c) True.
r 2 ∉ Q ⟹ r ∉ Q ≡ ¬ ( r ∉ Q ) ⟹ ¬ ( r 2 ∉ Q ) ≡ r ∈ Q ⟹ r 2 ∈ Q \begin{aligned} &r^2\not\in \mathbb{Q}\implies r \not\in \mathbb{Q}\\ \equiv\ &\lnot(r \not\in \mathbb{Q})\implies \lnot(r^2\not\in \mathbb{Q})\\ \equiv\ &r \in \mathbb{Q}\implies r^2\in \mathbb{Q} \end{aligned} ≡ ≡ r 2 ∈ Q ⟹ r ∈ Q ¬ ( r ∈ Q ) ⟹ ¬ ( r 2 ∈ Q ) r ∈ Q ⟹ r 2 ∈ Q
Let r = p q r=\frac{p}{q} r = q p , where p , q ∈ Z p, q\in \Z p , q ∈ Z and gcd ( p , q ) = 1 \gcd(p, q) = 1 g cd( p , q ) = 1 . r 2 = p 2 q 2 ∈ Q r^2=\frac{p^2}{q^2}\in\mathbb{Q} r 2 = q 2 p 2 ∈ Q .
(d) False.
1 2 3 4 from math import factorialn = 10 print (5 * n ** 3 > factorial(n))
7 Rationals and IrrationalsWe use proof by contradiction. Let x ∈ Q , y ∈ R ∖ Q , z ∈ Q x\in \mathbb{Q}, y\in\mathbb{R}\setminus\mathbb{Q}, z\in\mathbb{Q} x ∈ Q , y ∈ R ∖ Q , z ∈ Q and z = x y z=xy z = x y .
But y = z x ∈ Q y = \frac{z}{x}\in \mathbb{Q} y = x z ∈ Q , which conflicts with y ∈ R ∖ Q y\in \R\setminus\mathbb{Q} y ∈ R ∖ Q , so z z z must be irrational.
8 Twin Primes(a) If 3 ∣ p 3\mid p 3 ∣ p , p p p is not a prime number. So 3 ∤ p 3\nmid p 3 ∤ p . So p ≡ 1 ( m o d 3 ) p\equiv 1\pmod 3 p ≡ 1 ( m o d 3 ) or p ≡ 2 ≡ − 1 ( m o d 3 ) p\equiv 2\equiv -1\pmod 3 p ≡ 2 ≡ − 1 ( m o d 3 ) .
So p p p is of the form 3 k + 1 3k + 1 3 k + 1 or 3 k − 1 3k - 1 3 k − 1 for some integer k k k .
(b) If the three prime numbers are p , p + 2 , p + 4 ( p > 3 ) p, p + 2, p + 4\ (p>3) p , p + 2 , p + 4 ( p > 3 ) , we could let p = 3 k ± 1 p=3k\pm 1 p = 3 k ± 1 .
If p = 3 k + 1 p=3k + 1 p = 3 k + 1 , we have p + 2 = 3 k + 3 = 3 ( k + 1 ) p + 2=3k + 3 = 3(k + 1) p + 2 = 3 k + 3 = 3 ( k + 1 ) is not a prime number.
If p = 3 k − 1 p=3k - 1 p = 3 k − 1 , we have p + 4 = 3 k + 3 = 3 ( k + 1 ) p + 4 = 3k + 3 = 3(k + 1) p + 4 = 3 k + 3 = 3 ( k + 1 ) .
So 5 5 5 is the only prime number that takes part in two different twin prime pairs.