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

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


了解详情 >

寒假找点事干

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

Discussion 0A

1 Truth Tables

(a)

PPQQQPQ\lor PP(QP)P\land(Q\lor P)PQP\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)

PPQQRRPQP\lor Q(PQ)R(P\lor Q)\land RPRP\land RQRQ\land R(PR)(QR)(P\land R)\lor(Q\land R)
FalseFalseFalseFalseFalseFalseFalseFalse
FalseFalseTrueFalseFalseFalseFalseFalse
FalseTrueFalseTrueFalseFalseFalseFalse
FalseTrueTrueTrueTrueFalseTrueTrue
TrueFalseFalseTrueFalseFalseFalseFalse
TrueFalseTrueTrueTrueTrueFalseTrue
TrueTrueFalseTrueFalseFalseFalseFalse
TrueTrueTrueTrueTrueTrueTrueTrue

So LHSRHS\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)

PPQQRRPQP\land Q(PQ)R(P\land Q)\lor RPRP\lor RQRQ\lor R(PR)(QR)(P\lor R)\land(Q\lor R)
FalseFalseFalseFalseFalseFalseFalseFalse
FalseFalseTrueFalseTrueTrueTrueTrue
FalseTrueFalseFalseFalseFalseTrueFalse
FalseTrueTrueFalseTrueTrueTrueTrue
TrueFalseFalseFalseFalseTrueFalseFalse
TrueFalseTrueFalseTrueTrueTrueTrue
TrueTrueFalseTrueTrueTrueTrueTrue
TrueTrueTrueTrueTrueTrueTrueTrue

So LHSRHS\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)

xR,x∉Q.\exist x\in\R, x\not\in\mathbb{Q}.

(b)

nZ,((nN)(n<0))¬((nN)(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)

nN,(6n    (2n)(3n)).\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)

nN,(4n    2n).\forall n\in\N, (4\mid n\implies 2\mid n).

It is true.

We let n=4k,kNn=4k, k\in \N.

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

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

nN,(4n    2n).\forall n\in\N, (4\nmid n\implies 2\nmid n).

It is false.

A possible counterexample is when n=2n=2, 424\nmid 2, but 222\mid 2.

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

nN,(2n    4n).\forall n\in\N, (2\mid n\implies 4\mid n).

It is false.

A possible counterexample is when n=2n=2, 222\mid 2, but 424\nmid 2.

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

4 Equivalences with Quantifiers

(a)

LHSx ((y Q(x,y))    P(x))x (¬(y Q(x,y))P(x))x ((y ¬Q(x,y))P(x))xy (¬Q(x,y)P(x))xy (Q(x,y)    P(x))≢xy (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)

LHSxy (¬(P(x,y)    ¬Q(x,y)))xy (¬(¬P(x,y)¬Q(x,y)))xy (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, xy+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=x1y = x - 1, so it is also true. In all RHS\mathrm{RHS} is true. So LHS≢RHS\mathrm{LHS}\not\equiv\mathrm{RHS}.

(c)

LHSxy (¬P(x)Q(x,y))RHSx (¬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, LHSxy (FQ(x,y))xy Q(x,y)\mathrm{LHS}\equiv \forall x\exist y\ (\mathtt{F}\lor Q(x, y))\equiv \forall x\exist y\ Q(x, y), RHSx (F(y Q(x,y)))xy 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 LHSRHS\mathrm{LHS}\equiv \mathrm{RHS}.

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

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

Homework 0

5 Propositional Practice

(a)

xR ((x2=0)(yR ((y2=0)    (x=y)))).\exist x\in\R\ ((x^2=0)\land(\forall y\in\R\ ((y^2=0)\implies (x=y)))).

(b)

xQ yQ zQ ((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)

xZ ((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 x2y2=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.

ni=0k1(ai10i)(mod9)i=0k1(ai10imod9)(mod9)i=0k1(ai(10imod9))(mod9)i=0k1(ai(10mod9)i)(mod9)i=0k1ai(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,kZa=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, nN\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)k1+kx(1+x)^k\ge 1+kx, for kNk\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+kx21+(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, nN,x>1, (1+x)n1+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 kN,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, nN,n>1, n!<nn\forall n\in\N, n>1, \ n!<n^n holds.

4. We define an ask ABA\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 ABA\to B and BAB\to A. And now we know everything and it is easy for us to find the answer. We asked 3n4=23n-4=2 times. So f(n)3n4f(n)\le 3n-4 holds for n=1n=1.

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

Induction Step: When n=k+1n=k+1, we could randomly choose two people A and B, asking ABA\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+(3k4)=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)3n4f(n)\le 3n-4 holds for all nN,n2n\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)(ac)(bd)    (a+bc+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,n1]Za_i\in[0, n-1]\cap \Z.

Then we check if there exist k[0,n1]Zk\in [0, n-1]\cap\Z, i,aik\forall i, a_i\neq k.

  1. k[0,n1]Z,i,aik\exist k\in [0, n-1]\cap\Z, \forall i, a_i\neq k. Which means, i,ai[0,n1]Z\{k}\forall i, a_i\in [0, n-1]\cap\Z\backslash\{k\}. And since [0,n1]Z\{k}=n1\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,n1]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 n1n-1 friends (name B). A have 00 friends shows that A and B are not friends, but B have n1n-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 f1(AB)f1(A)f1(B)f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B) and f1(AB)f1(A)f1(B)f^{-1}(A\cup B)\supseteq f^{-1}(A)\cup f^{-1}(B).

We first show f1(AB)f1(A)f1(B)f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B).

Let xf1(AB)x\in f^{-1}(A\cup B), which means f(x)ABf(x)\in A\cup B. So (f(x)A)(f(x)B)(f(x)\in A)\lor (f(x)\in B). So (xf1(A))(xf1(B))\left(x\in f^{-1}(A)\right)\lor \left(x\in f^{-1}(B)\right), which means xf1(A)f1(B)x\in f^{-1}(A)\cup f^{-1}(B). So f1(AB)f1(A)f1(B)f^{-1}(A\cup B)\subseteq f^{-1}(A)\cup f^{-1}(B).

Then let’s prove f1(AB)f1(A)f1(B)f^{-1}(A\cup B)\supseteq f^{-1}(A)\cup f^{-1}(B).

We let xf1(A)f1(B)x\in f^{-1}(A)\cup f^{-1}(B), which means xf1(A)x\in f^{-1}(A) or xf1(B)x\in f^{-1}(B). So f(x)Af(x)\in A or f(x)Bf(x)\in B, which is f(x)ABf(x)\in A\cup B. So xf1(AB)x\in f^{-1}(A\cup B). So f1(A)f1(B)f1(AB)f^{-1}(A)\cup f^{-1}(B)\subseteq f^{-1}(A\cup B).

In all, f1(AB)=f1(A)f1(B)f^{-1}(A\cup B)=f^{-1}(A)\cup f^{-1}(B).

(b) We want to prove f(AB)f(A)f(B)f(A\cup B)\subseteq f(A)\cup f(B) and f(AB)f(A)f(B)f(A\cup B)\supseteq f(A)\cup f(B).

We firstly prove f(AB)f(A)f(B)f(A\cup B)\subseteq f(A)\cup f(B). Let xf(AB)x\in f(A\cup B), which is yAB,f(y)=x\exist y\in A\cup B, f(y)=x. So yA,f(y)=x\exist y\in A, f(y)=x or yB,f(y)=x\exist y\in B, f(y)=x. So xf(A)x\in f(A) or xf(B)x\in f(B). So xf(A)f(B)x\in f(A)\cup f(B). So f(AB)f(A)f(B)f(A\cup B)\subseteq f(A)\cup f(B).

Then we want to prove f(AB)f(A)f(B)f(A\cup B)\supseteq f(A)\cup f(B). Let xf(A)f(B)x\in f(A)\cup f(B), which is xf(A)x\in f(A) or xf(B)x\in f(B). So yA,x=f(y)\exist y\in A, x=f(y) or yB,x=f(y)\exist y\in B, x = f(y). So yAB,x=f(y)\exist y\in A\cup B, x = f(y). So xf(AB)x\in f(A\cup B). So f(A)f(B)f(AB)f(A)\cup f(B)\subseteq f(A\cup B).

In all f(AB)=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)k1+kx(1+x)^k\ge 1+kx, for kNk\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+kx21+(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, nN,x>0, (1+x)n1+nx\forall n\in\N, x>0, \ (1+x)^n\ge 1+nx holds.

2 Make It Stronger

(a) No. If we let an32na_n\le 3^{2^n}, an+1=3an23(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+132n+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, 32n1=33^{2^n-1}=3. So an32n1a_n\le 3^{2^n-1} holds for n=1n=1.

Induction Hypothesis: Assume that ak32k1a_k\le 3^{2^k-1}, for kNk\in \N.

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

ak+1=3ak23(32k1)2=32k+11.a_{k+1}=3a_{k}^2\le 3\cdot \left(3^{2^k-1}\right)^2=3^{2^{k+1}-1}.

So for all nN+n\in\N^+, an32n1a_n\le 3^{2^n-1}.

(c) For nNn\in\N, an32n1=1332n32na_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=120n=1\cdot 2^0. So the assumption holds when n=1n=1.

Induction Hypothesis: We assume that the proposition holds for ntn\le t.

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

If t+1t + 1 is an odd number. Let t2=i=0kck2k\frac{t}{2}=\sum_{i=0}^k c_k\cdot 2^k, then t+1=2t2+1=2i=0kci2i+1=i=1k+1ci12i+120t + 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=0kci2i\frac{t + 1}{2}=\sum_{i=0}^k c_i\cdot 2^i, then t+1=2t+12=2i=0kci2i=i=1k+1ci2i+020t+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 2F3n2\mid F_{3n}. Let’s prove it by induction.

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

Induction Hypothesis: We assume that 2F3k2\mid F_{3k} when kNk\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 2F3(k+1)2\mid F_{3(k+1)}.

In all, nN,2F3n\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)

0etsint dt=0sint d(et)=((sin(t)et)00et d(sint))=0etcost dt=0cost d(et)=((etcost)00et d(cost))=0et d(cost)(etcost)0=0etsint 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,

0etsint dt=0etsint 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

0etsint 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)=2xex4f'(x)=2x\cdot e^{-x^4}

Since ex4>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=01dx0x2x+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)=(x0)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)

xf1(AB) f(x)AB (f(x)A)(f(x)B) (xf1(A))(xf1(B)) xf1(A)f1(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 f1(AB)=f1(A)f1(B)f^{-1}(A\cap B)=f^{-1}(A)\cap f^{-1}(B).

(b)

xf1(AB) f(x)AB (f(x)A)(f(x)∉B) (xf1(A))(x∉f1(B)) xf1(A)f1(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 f1(AB)=f1(A)f1(B)f^{-1}(A\setminus B)=f^{-1}(A)\setminus f^{-1}(B).

(c)

yf(AB) xAB,f(x)=y    (xA,f(x)=y)(xB,f(x)=y) (yf(A))(yf(B)) yf(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(AB)f(A)f(B)f(A\cap B)\subseteq f(A)\cap f(B).

The counterexample for f(AB)=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(AB)=f(A\cap B)=\emptyset but f(A)f(B)={4}f(A)\cap f(B)=\{4\}.

(d)

yf(AB) xAB,f(x)=y     (xA,f(x)=y)(xB,f(x)y) (yf(A))(y∉f(B)) yf(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(AB)f(A)f(B)f(A\setminus B)\supseteq f(A)\setminus f(B).

The counterexample for f(AB)=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(AB)={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, kZk\in \Z. n2+4n=4k2+12k+5n^2+4n=4k^2+12k+5 is an odd number.

(b) True.

a+b15    (a11)(b4) ¬((a11)(b4))    ¬(a+b15) (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) rQ    r2Q\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,qZp, q\in \Z and gcd(p,q)=1\gcd(p, q) = 1. r2=p2q2Qr^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 xQ,yRQ,zQx\in \mathbb{Q}, y\in\mathbb{R}\setminus\mathbb{Q}, z\in\mathbb{Q} and z=xyz=xy.

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

8 Twin Primes

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

So pp is of the form 3k+13k + 1 or 3k13k - 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=3k1p=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.

评论