2014年10月4日星期六

Reflection of CSC165 Lec. 4 Sep. 30th.

Reflection of CSC165 Lec. 4 Sep. 30th.


Just something I want to write at first. I regard SLOG as another way to review the whole course,  so my goal is to repeat all the contents the professor taught as completely as possible. This is also a process of self-check if I am good at everything from this lecture. However, it is not a simple copy of the professor's powerpoint. I will rewrite all content in my own words, just like I am the teacher and I will teach students by this slog. The slog will contain some of my personal views or comments of the lecture. To make it clearer, I will use Italic font to mark it, and as some of you may find, I use bold font  to emphasize the concepts or sentences which I think is crucial.

Also, I plan to write a slog about recommending others' slog as I really see some interesting thing that I may neglect. This will be done later and separately.



4.1 Bi-implication, transitivity, mixed quantifiers



4.1.1 Bi-implication



Bi-implication is a bilateral implication. That is to say, P implies Q and Q implies P. (P => Q ) ∧ (Q => P), also we give a new sign P <=> Q to indicate bi-implication.

To more comprehensively understand bi-implication, we may try to modify it in the form (X ∧ X ) ∨ ( X ∧ X ).
By doing this we need to be familiar with the law mentioned in 3.3.2. In fact, I do not really pay attention to this part last time doing the slog as I do not quite get the reason why are we using it. I found it becomes extremely important in this lecture, so I want to do a review about laws first.

Laws:
1. De morgan's laws:

¬(P ∨ Q) <=> ¬P ∧ ¬Q
¬(P ∧ Q) <=> ¬P ∨ ¬Q

De morgan's law could be easily deduced by negating P ∧/∨ Q. Remembering the result would be efficient to solve the problem when it is comlicate.

2. Commutative laws:

P ∧ Q <=> Q ∧ P
P ∨ Q <=> Q ∨ P

We can change the order of Q and P as in and, or  relation they are lateral, but the change could not be made if P => Q as they have causality.

3. Associative laws:
4. Distributive laws:

I want to put associative law and distributive law together as they both talk about the situation when we have three predicates.

The associative law claims:

(P ∧ Q) ∧ R <=> P ∧ (Q ∧ R)
(P ∨ Q) ∨ R <=> P ∨ (Q ∨ R)

Associative law means if all three predicates are in the same condition, the parenthesis will not the affect the result.  

The distributive law claims:

(P ∨ Q) ∧ R <=> (P ∧ R) ∨ (Q ∧ R)
(P ∧ Q) ∨ R <=> (P ∨ R) ∧ (Q ∨ R)

Distributive law works quite the same as (P + Q) * R as P and Q are respectively distributed to R.

5. Identity laws:

P ∧ (Q ∨ ¬Q) <=> P
P ∨ (Q ∧ ¬Q) <=> P

The (Q ∨ ¬Q) is an empty set as one thing cannot be itself and not itself at the same time. A predicate and an empty set would lead to the predicate itself.

The (Q ∧ ¬Q) is always "all" set as it claims something would either be Q or not Q, which include all the possibilities, so it will also not affect the result.

6. Idempotent laws

P ∧ P <=> P
P ∨ P <=> P

P and P , P or P will not change the result of P, so it is the same as P itself. I still do not know the meaning of this one in fact.

Now we know  (P => Q ) ∧ (Q => P) is P <=> Q and (P => Q)  ¬P ∨ Q. P <=> Q ¬P ∨ Q) ∧ (¬Q ∨ P)
The negation of P <=> Q is ¬(P <=> Q), which could be written like (P ∧ ¬Q )∨(¬P ∧ Q).
This means either P or Q is true, but not both is true. In daily speak either or could mean one of them (but not both) is true, but in logic either or contains both and. To specifically present either or but not both, we can also use symbol exclusive or, ⊕.


4.1.2 Transitivity



Transitivity basically means the passing property of implication. For example:
P=> Q  and Q=> R, we can conclude with P =>R
The figure of transitivity would be like this: Since P => Q, Q must be true when P is true, R must be true when Q is true. So R contains a larger region than Q and R.



A classic type of transitivity could be Syllogism. A syllogism is a kind of logical argument that applies deductive reasoning to arrive at a conclusion based on two or more propositions that are asserted or assumed to be true. For example:

"All men are mortal.

Socrates is a man.

Therefore, Socrates is mortal."

The example here is not really elaborate as it does not fit the form of predicate, but let's just regard Socrates as P, man as Q, mortal as R. This clearly fits the figure above. Also keep in mind in computer science these P, Q, R may not have any logic relation. They could be anything irrelevant with implication.




4.2 Proofs




"A proof is an argument that convinces someone who is logical, careful and precise"
What we have learnt so far about proof are mostly concepts which is not worthy to conclude, but it shows us a general pattern of proof something. Let's say we want to find P(x) => Q(x), but P and Q seems irrelevant. We can firstly find P(x) => R(x) which R(x) is directly led by P(x). R(x) => R1(x) which R1(x) is directly led by R(x), we follow the pattern until we find Rn(x) => Q(x). The proofs is broken into several steps and each step is easy to follow.

The unexpected hanging paradox is also introduced in class, I found this topic extremely interesting and did a lot of research on it. To save the time and space, I do not want to repeat the paradox itself and the proof about it in class. I think one argument in the proof sounds weak: "It cannot be on Friday, since after Thursday noon it would not be a surprise anymore." This statement is only true when he survives the first four days, but he may still be hanged up in the four days before. Thus, from the prespective of prisoner, the only thing he know is that he is 50% likely to be hanged up in the coming weekdays in the first four days, and this uncertainty becomes a surprise.




4.3 Problem solving session.




In CS or mathematics, we need a series of process to solve one problem. This series of work is called "Polya’s problem solving scheme". This is extremely useful in real life cases as not that much variables or quantifiers are difined. It suggests the following steps:

◆ understand the problem
◆ devise a plan
◆ carry out the plan
◆ look back
◆ acknowledge when, and how, you’re stuck

The case being given in class is called Folding, I am going to solve this problem following the Polya’s problem solving scheme.

1. Understand the problem

The process is written on the paper handout clearly. The aim is to find the pattern of crease's direction(face up or face down).

2. Devise a plan

I want to fold the strip 1 to 4 times and record the data of crease's direction. Then I try to observe the pattern and conclude the general law of it.

3. Carry out the plan

When fold 1 time: 
↓
1
When fold 2 times:
↓↓↑
3
When fold 3 times:
↓↓↑↓↓↑↑
7
When fold 4 times:
↓↓↑↓↓↑↑↓↓↓↑↑↓↑↑
15

I observe the following pattern through the data I collected:
1. the first one is always ↓.
2. the beginning is the same.
3. There are always odd number of creases, and the rear part is the reverse of the from part from the middle to the beginning.

4. Look back

I see the phenomenon and I also need to know why it happens.

1. the first one is always  ↓ because we "keep holding the right end and unfold the entire strip." and "Fold the strip so that the left end is on top of the right end. " Thus, no matter how many times I fold, the first one will always be ↓.

2. 2 happens because the N+1th fold is one the basis of Nth fold, so the initial pattern would  always be the same.

3. 3 happens because we always unfold the strip from the middle and do it again and again.

After understanding these patterns, we could conclude something more general and abstract.
Let's see this:
When fold 4 times:
↓↓↑↓↓↑↑↓↓↓↑↑↓↑↑
In fact ,we could separate the creases into three parts:

When fold 4 times:
↓↓↑↓↓↑↑
↓
↓↓↑↑↓↑↑
The first part equals to "when fold 3 times".
The second part could be called "new", it is always the middle and always face down as explained in 1.
The second part is the reverse of the first part from the end to the beginning.

By this way, we could predict the pattern when we fold the fifth times:

When fold 5 times:
↓↓↑↓↓↑↑↓↓↓↑↑↓↑↑
↓
↓↓↑↓↓↑↑↑↓↓↑↑↓↑↑


5. Acknowledge when, and how, you're stuck


The most difficult part is to observe the phenomenon through the data collected. Sometimes the pattern hides in the data and it hard to find. I need to try a lot of different possibilities. 

没有评论:

发表评论