1. Trang chủ
  2. » Giáo Dục - Đào Tạo

(TIỂU LUẬN) chapter 2 logics (cont ) discrete structures for computing on august 31, 2017

46 3 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Logics (Cont.) Discrete Structures for Computing
Tác giả Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang
Trường học University of Technology VNUHCM
Chuyên ngành Computer Science and Engineering
Thể loại Essay
Năm xuất bản 2017
Thành phố Ho Chi Minh City
Định dạng
Số trang 46
Dung lượng 447 KB

Nội dung

Logics (cont.) Chapter Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Logics (cont.) Discrete Structures for Computing on August 31, 2017 Contents Predicate Logic Exercise Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Faculty of Computer Science and Engineering University of Technology VNUHCM nakhuong@hcmut.edu Contents Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Predicate Logic Contents Predicate Logic Exercise Exercise 2 Course outcomes Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Course learning outcomes L.O.1 L.O.2 L.O.3 L.O.4 Understanding of logic and discrete structures L.O.1.1 – Describe definition of propositional and predicate logic L.O.1.2 – Define basic discrete structures: set, mapping, graphs Represent and model practical problems with discrete structures L.O.2.1 – Logically describe some problems arising in Computing L.O.2.2 – Use proving methods: direct, contrapositive, induction Understanding of basic probability and random L.O.2.3 – Explain problem modeling using discrete variables structures L.O.3.1 – Define basic probability theory L.O.3.2 – Explain discrete random variables Compute quantities of discrete structures and probabilities L.O.4.1 – Operate (compute/ optimize) on discrete structures L.O.4.2 – Compute probabilities of various events, conditional ones, Bayes theorem Contents Predicate Logic Exercise Limits of Propositional Logic Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents • x>3 All square numbers are not prime numbers 100 is • a square number Therefore 100 is not a prime number Predicate Logic Exercise Predicates Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Definition A predicate (vị từ) is a statement containing one or more variables If values are assigned to all the variables in a predicate, the resulting statement is a proposition (mệnh đề ) Example: • x > (predicate) 5>3 • (proposition) • 2>3 (proposition) Contents Predicate Logic Exercise Predicates Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents • x > → P (x) 5>3 → P (5) , x n, , • A predicate with n variables1 P (x x ) • Predicate Logic Exercise Truth value Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang • x > is true or false? 5>3 • For every number x, x > holds • There is a number x such that x • >3 Contents Predicate Logic Exercise Quantifiers Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang • ∀: Universal – Với • ∀xP(x) = P (x) is T for all x • ∃: Existential – Tồn Contents Predicate Logic Exercise • ∃xP(x) = There exists an element x such that P (x) We need a domain of discourse for • is T variable Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Example Let P (x) be the statement “x < 2” What is the truth value of the quantification ∀xP(x), where the domain consists of all real number? • P (3) = < is false • Contents Predicate Logic Exercise ⇒ ∀xP(x) is false • is a counterexample (phản ví dụ) of ∀xP(x) Example What is the truth value of the quantification ∃xP(x), domain consists of all real number? where the Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Example Express the statement “Some student in this class comes from Central Vietnam.” Solution • M (x) = x comes from Central Vietnam • Domain for x is the students in the • class Contents Predicate Logic Exercise ∃xM(x) Solution • Domain for x is all • people 10 Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Translating the following nested quantifiers: a) B (c, m) (O(c, m) O(m, c)) ∧ ∨ b) B(c, m) ∧ F (a, m) → O(a, c) ∧ F (a, Contents Predicate Logic Exercise c) d) ∃x((S(x, m)m) ∨∧ H(c, x)) c) ∀x∀y(S(x, B(c, y)∨→∃x(H(x, x = y) m) ∧ O(x, m))) e) ∀x∀y(S(x, m) ∧ S(y, m) → O(x, y) ∨ O(y, x)) 32 Logics (cont.) Solutions: a) B(c, m) ∧ (O(c, m) ∨ O(m, c)) c is a brother (elder/younger) of m b) B(c, m) ∧ F (a, m) → O(a, c) ∧ F (a, c) If c is a brother of m and a is a father of m, then a is elder than c and a is the father of c c) ∀x∀y(S(x, m) ∧ B(c, y) → x = y) Whoever is the sister of m, then c is also a brother of that person d) ∃x((S(x, m) ∨ H(c, x)) ∨ ∃x(H(x, m) ∧ O(x, m))) There is a sister of m or c is her husband, or there is a husband of m and elder than m e) ∀x∀y(S(x, m) ∧ S(y, m) → O(x, y) ∨ O(y, x)) All of the sisters of m are older or younger together Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents Predicate Logic Exercise 33 Logics (cont.) Given a predicate N (x) "x has been to Da Lat" with the domain is the all students in Mathematics class Translate the following predicates a) ∃xN(x) into English b) c) d) e) f) ∀xN(x) ¬∃xN(x) ∃x¬N (x) ¬∀xN(x) ∀x¬N (x) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents Predicate Logic Exercise a) There is a student in this class has been to Da Lat b) All students in Math class have been to Da Lat c) There is no exists a student in Math class has gone to Da Lat d) There is a student in this class has never gone to Da Lat e) Not all students in Math class have ever been to Da Lat f) All students in Math class have never been to Da Lat 34 Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Given the predicate N (x) "x studies more than hours in class every weekday" with the domain is the all students in Mathematics class Express the following predicates: a) ∃xN(x) b) ∀xN(x) c) ∃x¬N (x) d) ∀x¬N (x) Contents Predicate Logic Exercise a) There is a student who studies in the class over hours in class every weekday b) All of the students in Math class study over hours every weekday c) There is a student who does not study in the class over hours every weekday d) There are no student studies in the class over hours every weekday 35 Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Hãy cho biết công thức vị từ đoạn mã giả (pseudo code) sau: for (i = 0; i 3 (proposition) Contents Predicate Logic Exercise Predicates Logics (cont.) Nguyen An Khuong, Tran Tuan Anh, Le Hong Trang Contents

Ngày đăng: 06/12/2022, 15:17

w