抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

寒假找点事干 。

没答案只能瞎做,不保证正确性()

Discussion 0A

1 Truth Tables

(a)

PPQQQ∨PQ\lor PP∧(Q∨P)P\land(Q\lor P)P∧QP\land Q
TTTTT
TFTTF
FTTFF
FFFFF

When P=T,Q=FP=\mathtt{T},Q=\mathtt{F}, LHS=T\mathrm{LHS}=\mathtt{T} but RHS=F\mathrm{RHS}=\mathtt{F}.

So LHS≢RHS\mathrm{LHS}\not\equiv \mathrm{RHS}.

(b)

PPQQRRP∨QP\lor Q(P∨Q)∧R(P\lor Q)\land RP∧RP\land RQ∧RQ\land R(P∧R)∨(Q∧R)(P\land R)\lor(Q\land R)
FalseFalseFalseFalseFalseFalseFalseFalse
FalseFalseTrueFalseFalseFalseFalseFalse
FalseTrueFalseTrueFalseFalseFalseFalse
FalseTrueTrueTrueTrueFalseTrueTrue
TrueFalseFalseTrueFalseFalseFalseFalse
TrueFalseTrueTrueTrueTrueFalseTrue
TrueTrueFalseTrueFalseFalseFalseFalse
TrueTrueTrueTrueTrueTrueTrueTrue

So LHS≡RHS\mathrm{LHS}\equiv \mathrm{RHS}.

1
2
3
4
5
6
7
8
from itertools import product

if __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)

PPQQRRP∧QP\land Q(P∧Q)∨R(P\land Q)\lor RP∨RP\lor RQ∨RQ\lor R(P∨R)∧(Q∨R)(P\lor R)\land(Q\lor R)
FalseFalseFalseFalseFalseFalseFalseFalse
FalseFalseTrueFalseTrueTrueTrueTrue
FalseTrueFalseFalseFalseFalseTrueFalse
FalseTrueTrueFalseTrueTrueTrueTrue
TrueFalseFalseFalseFalseTrueFalseFalse
TrueFalseTrueFalseTrueTrueTrueTrue
TrueTrueFalseTrueTrueTrueTrueTrue
TrueTrueTrueTrueTrueTrueTrueTrue

So LHS≡RHS\mathrm{LHS}\equiv \mathrm{RHS}.

1
2
3
4
5
6
7
8
from itertools import product

if __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}.

(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).

(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).

(d) All integers are rational numbers.

(e) All integers divisible by 22 or 33 are divisible by 66.

(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).

It is true.

We let n=4k,k∈Nn=4k, k\in \N.

We have n=2⋅(2k)n=2\cdot (2k), so 2∣n2\mid n.

(b) If a natural number is not divisible by 44, it is not divisible by 22.

∀n∈N,(4∤n  ⟹  2∤n).\forall n\in\N, (4\nmid n\implies 2\nmid n).

It is false.

A possible counterexample is when n=2n=2, 4∤24\nmid 2, but 2∣22\mid 2.

(c) If a natural number is divisible by 22, it is divisible by 44.

∀n∈N,(2∣n  ⟹  4∣n).\forall n\in\N, (2\mid n\implies 4\mid n).

It is false.

A possible counterexample is when n=2n=2, 2∣22\mid 2, but 4∤24\nmid 2.

(d) If a natural number is divisible by 22, it is divisible by 44.

4 Equivalences with Quantifiers

(a)

LHS≡∀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))≡RHS\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}

To find one counterexample, we could let P(x)P(x) to be contradictions, like “xx is an elephant”, and Q(x,y)Q(x, y) be “x=yx=y”. On the one hand, for all xx, ∃y Q(x,y)\exist y\ Q(x, y) is true because we could just let y=xy=x, and P(x)P(x) is false, so LHS\mathrm{LHS} is false. However, for all xx, we just let y=x+1y=x+1, then since Q(x,y)Q(x, y) is false, Q(x,y)  ⟹  P(x)Q(x, y)\implies P(x) is true, so RHS\mathrm{RHS} is true.

(b)

LHS≡∀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)))≡RHS\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}

To find one counterexample, we could let P(x,y)P(x, y) to be x=yx=y, and Q(x,y)Q(x, y) be “x=y+1x=y+1”. On the one hand, when x=yx=y, x≠y+1x\neq y+1, so P(x,y)  ⟹  ¬Q(x,y)P(x, y)\implies \lnot Q(x, y) is true. So LHS\mathrm{LHS} is false. But for all xx. For ∃y P(x,y)\exist y\ P(x, y), we just let y=xy=x, so it is true. And for ∃y Q(x,y)\exist y\ Q(x, y), we just let y=x−1y = x - 1, so it is also true. In all RHS\mathrm{RHS} is true. So LHS≢RHS\mathrm{LHS}\not\equiv\mathrm{RHS}.

(c)

LHS≡∀x∃y (¬P(x)∨Q(x,y))RHS≡∀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}

If P(x)P(x) is true, LHS≡∀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), RHS≡∀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). So LHS≡RHS\mathrm{LHS}\equiv \mathrm{RHS}.

If P(x)P(x) is true, then LHS≡RHS≡T\mathrm{LHS}\equiv \mathrm{RHS}\equiv \mathtt{T}.

In all LHS≡RHS\mathrm{LHS}\equiv\mathrm{RHS}.

Homework 0

5 Propositional Practice

(a)

∃x∈R ((x2=0)∧(∀y∈R ((y2=0)  ⟹  (x=y)))).\exist x\in\R\ ((x^2=0)\land(\forall y\in\R\ ((y^2=0)\implies (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)).

(c)

∀x∈Z ((x2>4)  ⟹  ((x<−2)∨(x>2))).\forall x\in\Z\ ((x^2>4)\implies((x<-2)\lor(x>2))).

(d) All real numbers are complex numbers.

(e) There is no integer solution of x2−y2=10x^2-y^2=10.

(f) All greater than 22 natural numbers can be decomposed into the sum of two prime numbers.

Note 2

9 Exercises

1.

n≡∑i=0k−1(ai⋅10i)(mod9)≡∑i=0k−1(ai⋅10imod  9)(mod9)≡∑i=0k−1(ai⋅(10imod  9))(mod9)≡∑i=0k−1(ai⋅(10mod  9)i)(mod9)≡∑i=0k−1ai(mod9)\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}

2.

a2 is even  ⟹  a is even≡¬(a is even)  ⟹  ¬(a2 is even)≡a is odd  ⟹  a2 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}

Let a=2k+1,k∈Za=2k+1, k\in \Z, we have a2=4k2+4k+1=2(2k2+1)+1a^2=4k^2+4k+1=2(2k^2+1)+1, so a2a^2 is odd.

So a is odd  ⟹  a2 is odda\text{is odd}\implies a^2\text{is odd} holds, so Lemma 2.2 holds.

Note 3

1. We proceed by induction on nn.

Base Case: When n=1n=1, LHS=RHS=1\mathrm{LHS}=\mathrm{RHS}=1. So base case Holds.

Induction Hypothesis: Assume that ∑i=1ki=16k(k+1)(2k+1)\sum_{i=1}^{k} i = \frac{1}{6}k(k+1)(2k+1).

Induction Step: When n=k+1n=k+1,

∑i=1k+1i=(k+1)+∑i=1ki=16k(k+1)(2k+1)+k+1=16(k+1)(2k2+k+6k+6)=16(k+1)(2k2+7k+6)=16(k+1)(k+2)(2k+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}

Thus, ∀n∈N\forall n\in\N, ∑i=1ni=16n(n+1)(2n+1)\sum_{i=1}^{n} i = \frac{1}{6}n(n+1)(2n+1) holds.

2. We proceed by induction on nn.

Base Case: When n=1n=1, LHS=RHS=1+x\mathrm{LHS}=\mathrm{RHS}=1+x. So base case Holds.

Induction Hypothesis: Assume that (1+x)k≥1+kx(1+x)^k\ge 1+kx, for k∈Nk\in \N.

Induction Step: When n=k+1n=k+1,

(1+x)k+1=(1+x)⋅(1+x)k≥(1+x)⋅(1+kx)=1+(k+1)⋅x+kx2≥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}

Thus, ∀n∈N,x>−1, (1+x)n≥1+nx\forall n\in\N, x>-1, \ (1+x)^n\ge 1+nx holds.

3. We proceed by induction on nn.

Base Case: When n=2n=2, LHS=2<4=RHS\mathrm{LHS}=2<4=\mathrm{RHS}. So base case Holds.

Induction Hypothesis: Assume that k!<kkk!<k^k, for k∈N,k>1k\in \N, k>1.

Induction Step: When n=k+1n=k+1,

(k+1)!=(k+1)⋅k!<(k+1)⋅kk<(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}

Thus, ∀n∈N,n>1, n!<nn\forall n\in\N, n>1, \ n!<n^n holds.

4. We define an ask A→BA\to B means asking A if he know B. And we define f(n)f(n) be the times of asking.

Base Case: When n=2n=2, there are just two people A and B. We could ask A→BA\to B and B→AB\to A. And now we know everything and it is easy for us to find the answer. We asked 3n−4=23n-4=2 times. So f(n)≤3n−4f(n)\le 3n-4 holds for n=1n=1.

Induction Hypothesis: Assume that if there are kk people, we could use 3k−43k-4 asks to find the answer.

Induction Step: When n=k+1n=k+1, we could randomly choose two people A and B, asking A→BA\to B.

Now there are two cases:

  1. 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 kk people to find the “celebrity” for these kk 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+(3k−4)=3(k+1)−4f(k + 1)=3+f(k)\le 3+(3k-4)=3(k+1)-4.
  2. 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)−4f(k+1)\le 3(k+1)-4. And as a conclusion, f(n)≤3n−4f(n)\le 3n-4 holds for all n∈N,n≥2n\in\N, n\ge 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 33.

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}

2 Numbers of Friends

We let the ii-th person have aia_i friends. We have ai∈[0,n−1]∩Za_i\in[0, n-1]\cap \Z.

Then we check if there exist k∈[0,n−1]∩Zk\in [0, n-1]\cap\Z, ∀i,ai≠k\forall i, a_i\neq k.

  1. ∃k∈[0,n−1]∩Z,∀i,ai≠k\exist k\in [0, n-1]\cap\Z, \forall i, a_i\neq k. Which means, ∀i,ai∈[0,n−1]∩Z\{k}\forall i, a_i\in [0, n-1]\cap\Z\backslash\{k\}. And since ∣[0,n−1]∩Z\{k}∣=n−1\left|[0, n-1]\cap\Z\backslash\{k\}\right|=n-1, and there are nn numbers. Due to the Pigeonhole Principle, there must be 22 of them have the same number.
  2. If ∀k∈[0,n−1]∩Z,∃i,ai=k\forall k\in [0, n-1]\cap\Z, \exist i, a_i=k, there must be some one with 00 friends (name A) and some one with n−1n-1 friends (name B). A have 00 friends shows that A and B are not friends, but B have n−1n-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 22 of them have the same number of friends at the party.

3 Pebbles

If 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) and f−1(A∪B)⊇f−1(A)∪f−1(B)f^{-1}(A\cup B)\supseteq f^{-1}(A)\cup 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).

Let x∈f−1(A∪B)x\in f^{-1}(A\cup B), which means f(x)∈A∪Bf(x)\in A\cup B. So (f(x)∈A)∨(f(x)∈B)(f(x)\in A)\lor (f(x)\in 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), which means x∈f−1(A)∪f−1(B)x\in f^{-1}(A)\cup 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).

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).

We let x∈f−1(A)∪f−1(B)x\in f^{-1}(A)\cup f^{-1}(B), which means x∈f−1(A)x\in f^{-1}(A) or x∈f−1(B)x\in f^{-1}(B). So f(x)∈Af(x)\in A or f(x)∈Bf(x)\in B, which is f(x)∈A∪Bf(x)\in A\cup B. So x∈f−1(A∪B)x\in f^{-1}(A\cup 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).

In all, f−1(A∪B)=f−1(A)∪f−1(B)f^{-1}(A\cup B)=f^{-1}(A)\cup 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) and f(A∪B)⊇f(A)∪f(B)f(A\cup B)\supseteq f(A)\cup f(B).

We firstly prove f(A∪B)⊆f(A)∪f(B)f(A\cup B)\subseteq f(A)\cup f(B). Let x∈f(A∪B)x\in f(A\cup B), which is ∃y∈A∪B,f(y)=x\exist y\in A\cup B, f(y)=x. So ∃y∈A,f(y)=x\exist y\in A, f(y)=x or ∃y∈B,f(y)=x\exist y\in B, f(y)=x. So x∈f(A)x\in f(A) or x∈f(B)x\in f(B). So x∈f(A)∪f(B)x\in f(A)\cup f(B). So f(A∪B)⊆f(A)∪f(B)f(A\cup B)\subseteq f(A)\cup f(B).

Then we want to prove f(A∪B)⊇f(A)∪f(B)f(A\cup B)\supseteq f(A)\cup f(B). Let x∈f(A)∪f(B)x\in f(A)\cup f(B), which is x∈f(A)x\in f(A) or x∈f(B)x\in f(B). So ∃y∈A,x=f(y)\exist y\in A, x=f(y) or ∃y∈B,x=f(y)\exist y\in B, x = f(y). So ∃y∈A∪B,x=f(y)\exist y\in A\cup B, x = f(y). So x∈f(A∪B)x\in f(A\cup B). So f(A)∪f(B)⊆f(A∪B)f(A)\cup f(B)\subseteq f(A\cup B).

In all f(A∪B)=f(A)∪f(B)f(A\cup B)=f(A)\cup f(B).

Discussion 1B

1 Natural Induction on Inequality

The same as Note 3 Question 2.

We proceed by induction on nn.

Base Case: When n=1n=1, LHS=RHS=1+x\mathrm{LHS}=\mathrm{RHS}=1+x. So base case Holds.

Induction Hypothesis: Assume that (1+x)k≥1+kx(1+x)^k\ge 1+kx, for k∈Nk\in \N.

Induction Step: When n=k+1n=k+1,

(1+x)k+1=(1+x)⋅(1+x)k≥(1+x)⋅(1+kx)=1+(k+1)⋅x+kx2≥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}

Thus, ∀n∈N,x>0, (1+x)n≥1+nx\forall n\in\N, x>0, \ (1+x)^n\ge 1+nx holds.

2 Make It Stronger

(a) No. If we let an≤32na_n\le 3^{2^n}, an+1=3an2≤3⋅(32n)2=32n+1+1a_{n+1}=3a_n^2\le 3\cdot\left(3^{2^n}\right)^2=3^{2^{n+1}+1}. But 32n+1+1≥32n+13^{2^{n+1}+1}\ge 3^{2^{n+1}}, so it doesn’t work.

(b) Let’s prove by induction.

Base Case: When n=1n=1, a1=1a_1=1, 32n−1=33^{2^n-1}=3. So an≤32n−1a_n\le 3^{2^n-1} holds for n=1n=1.

Induction Hypothesis: Assume that ak≤32k−1a_k\le 3^{2^k-1}, for k∈Nk\in \N.

Induction Step: When n=k+1n=k+1:

ak+1=3ak2≤3⋅(32k−1)2=32k+1−1.a_{k+1}=3a_{k}^2\le 3\cdot \left(3^{2^k-1}\right)^2=3^{2^{k+1}-1}.

So for all n∈N+n\in\N^+, an≤32n−1a_n\le 3^{2^n-1}.

(c) For n∈Nn\in\N, an≤32n−1=13⋅32n≤32na_n\le 3^{2^n-1}=\frac{1}{3}\cdot 3^{2^n}\le 3^{2^n}.

3 Binary Numbers

We proceed by induction on nn.

Base Case: When n=1n=1, let c0=1c_0=1, n=1⋅20n=1\cdot 2^0. So the assumption holds when n=1n=1.

Induction Hypothesis: We assume that the proposition holds for n≤tn\le t.

Induction Step: We use the parity of t+1 for discussion.

If t+1t + 1 is an odd number. Let t2=∑i=0kck⋅2k\frac{t}{2}=\sum_{i=0}^k c_k\cdot 2^k, then t+1=2⋅t2+1=2∑i=0kci⋅2i+1=∑i=1k+1ci−1⋅2i+1⋅20t + 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.

If t+1t+1 is an even number. Let t+12=∑i=0kci⋅2i\frac{t + 1}{2}=\sum_{i=0}^k c_i\cdot 2^i, then t+1=2⋅t+12=2∑i=0kci⋅2i=∑i=1k+1ci⋅2i+0⋅20t+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.

In all, the proposition holds.

4 Fibonacci for Home

Let P(n)P(n) be the proposition that 2∣F3n2\mid F_{3n}. Let’s prove it by induction.

Base Case: When n=1n=1, F3n=2F_{3n}=2 so 2∣F3n2\mid F_{3n}.

Induction Hypothesis: We assume that 2∣F3k2\mid F_{3k} when k∈Nk\in\N.

Induction Step:

F3(k+1)≡F3k+3(mod2)≡F3k+2+F3k+1(mod2)≡F3k+1+F3k+F3k+1(mod2)≡2F3k+1+F3k(mod2)≡0(mod2)\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}

So 2∣F3(k+1)2\mid F_{3(k+1)}.

In all, ∀n∈N,2∣F3n\forall n\in \N, 2\mid F_{3n}.

Homework 1

1 Solving a System of Equations

Let the prices for an apple, for a beet, and for a carrot be a,b,ca, b, c separately. Then we have:

[111230123]⋅[abc]=[162335]\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
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=[457]Tx=\begin{bmatrix}4&5&7\end{bmatrix}^{\mathrm{T}}. So a=4,b=5,c=7a=4, b=5, c=7.

2 Calculus Review

(a)

∫0∞e−tsin⁡t dt=−∫0∞sin⁡t d(e−t)=−((sin⁡(t)⋅e−t)0∞−∫0∞e−t d(sin⁡t))=∫0∞e−tcos⁡t dt=−∫0∞cos⁡t d(e−t)=−((e−tcos⁡t)0∞−∫0∞e−t d(cos⁡t))=∫0∞e−t d(cos⁡t)−(e−tcos⁡t)0∞=−∫0∞e−tsin⁡t dt+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}

So,

∫0∞e−tsin⁡t dt=−∫0∞e−tsin⁡t dt+1.\int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t=-\int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t+1.

Which is

∫0∞e−tsin⁡t dt=12.\int_{0}^{\infty}e^{-t}\sin t\ \mathrm{d}t=\frac{1}{2}.

1
2
syms x;
disp(int(sin(x) * exp(-x), 0, inf));

(b)

f′(x)=2x⋅e−x4f'(x)=2x\cdot e^{-x^4}

Since e−x4>0e^{-x^4}>0, f′(x)<0f'(x)<0 when x<0x<0 and f′(x)>0f'(x)>0 when x>0x>0.

So when x=0x=0, the minimum value of f(x)f(x) is 00.

(c)

∬R2x+y dA=∫01dx∫0x2x+y dy=∫01(2xy+12y2)y=0y=xdx=∫0152x2 dx=56\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}

3 Implication

(a) True.

(b) False. Let Q(x,y)Q(x, y) be x=yx=y.

(c) True. For all yy, we just choose the xx previously selected.

(d) True.

4 Logical Equivalence?

(a) True.

∀x (P(x)∧Q(x))≡⋀x(P(x)∧Q(x))≡(⋀xP(x))∧(⋀xQ(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}

(b) False.

Let P(x)=(x>0),Q(x)=(x≤0)P(x)=(x>0), Q(x)=(x\le 0). ∀x (P(x)∧Q(x))\forall x\ (P(x)\land Q(x)) is true but (∀x P(x))∨(∀x Q(x))\left(\forall x\ P(x)\right)\lor\left(\forall x\ Q(x)\right) is false.

(c) True.

∃x (P(x)∨Q(x))≡⋁x(P(x)∨Q(x))≡(⋁xP(x))∨(⋁xQ(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}

(d) False.

Let P(x)=(x=2)P(x)=(x=2) and Q(x)=(x=3)Q(x)=(x=3). LHS\mathrm{LHS} is false but RHS\mathrm{RHS} 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}

So f−1(A∩B)=f−1(A)∩f−1(B)f^{-1}(A\cap B)=f^{-1}(A)\cap 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}

So f−1(A∖B)=f−1(A)∖f−1(B)f^{-1}(A\setminus B)=f^{-1}(A)\setminus 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}

So f(A∩B)⊆f(A)∩f(B)f(A\cap B)\subseteq f(A)\cap f(B).

The counterexample for f(A∩B)=f(A)∩f(B)f(A\cap B)= f(A)\cap f(B) is when A={2}A=\{2\} and B={−2}B = \{-2\}, and we let f(x)=x2f(x)=x^2. f(A∩B)=∅f(A\cap B)=\emptyset but f(A)∩f(B)={4}f(A)\cap 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}

So f(A∖B)⊇f(A)∖f(B)f(A\setminus B)\supseteq f(A)\setminus f(B).

The counterexample for f(A∖B)=f(A)∖f(B)f(A\setminus B)= f(A)\setminus f(B) is when A={−2,2}A=\{-2, 2\} and B={−2}B = \{-2\}, and we let f(x)=x2f(x)=x^2. f(A∖B)={4}f(A\setminus B)=\{4\} but f(A)∩f(B)=∅f(A)\cap f(B)=\emptyset.

6 Prove or Disprove

(a) True. Let n=2k+1n=2k+1, k∈Zk\in \Z. n2+4n=4k2+12k+5n^2+4n=4k^2+12k+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}

(c) True.

r2∉Q  ⟹  r∉Q≡ ¬(r∉Q)  ⟹  ¬(r2∉Q)≡ r∈Q  ⟹  r2∈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}

Let r=pqr=\frac{p}{q}, where p,q∈Zp, q\in \Z and gcd⁡(p,q)=1\gcd(p, q) = 1. r2=p2q2∈Qr^2=\frac{p^2}{q^2}\in\mathbb{Q}.

(d) False.

1
2
3
4
from math import factorial

n = 10
print(5 * n ** 3 > factorial(n))

7 Rationals and Irrationals

We use proof by contradiction. Let x∈Q,y∈R∖Q,z∈Qx\in \mathbb{Q}, y\in\mathbb{R}\setminus\mathbb{Q}, z\in\mathbb{Q} and z=xyz=xy.

But y=zx∈Qy = \frac{z}{x}\in \mathbb{Q}, which conflicts with y∈R∖Qy\in \R\setminus\mathbb{Q}, so zz must be irrational.

8 Twin Primes

(a) If 3∣p3\mid p, pp is not a prime number. So 3∤p3\nmid p. So p≡1(mod3)p\equiv 1\pmod 3 or p≡2≡−1(mod3)p\equiv 2\equiv -1\pmod 3.

So pp is of the form 3k+13k + 1 or 3k−13k - 1 for some integer kk.

(b) If the three prime numbers are p,p+2,p+4 (p>3)p, p + 2, p + 4\ (p>3), we could let p=3k±1p=3k\pm 1.

If p=3k+1p=3k + 1, we have p+2=3k+3=3(k+1)p + 2=3k + 3 = 3(k + 1) is not a prime number.

If p=3k−1p=3k - 1, we have p+4=3k+3=3(k+1)p + 4 = 3k + 3 = 3(k + 1).

So 55 is the only prime number that takes part in two different twin prime pairs.

评论