Information about Intro to computer science module 2

This is module 2 of an introductory course that will introduce computer science and software engineering to the novice, and it is also a course that will teach even veteran computer scientists some new concepts, or explain concepts they thought they understood well. Concepts are introduced with hands on experience using object-oriented pseudo code (which can very easily be translated to C#, Java, C++, etc.) and functional programming pseudo code (which can easily be translated into F#, Erlang, Python, Haskell, etc.)

Foundations of Computer Science and Software Engineering ALBERT EINSTIEN TO THE TEACHER

Foundations of Computer Science and Software Engineering TO THE STUDENT SOCRATES

Foundations of Computer Science and Software Engineering About this Course This is an introductory course that will introduce computer science and software engineering to the novice, and it is also a course that will teach even veteran computer scientists some new concepts, or explain concepts they thought they understood well. Concepts are introduced with hands on experience using object-oriented pseudo code (which can very easily be translated to C#, Java, C++, etc.) and functional programming pseudo code (which can easily be translated into F#, Erlang, Python, Haskell, etc.) About the Author Walid Saba has 20 years of experience in information technology, where he worked at such places as the American Institutes for Research, AT&T Bell Labs, Metlife, Nortel Networks, IBM and Cognos. He has also spent 7 years in academia where he has taught computer science at Carelton University, the New Jersey Institute of Technology, the University of Windsor, and the American University of Beirut. He has published over 30 technical articles, including an award wining paper that he recieved at KI-2008 in Germany. Walid holds a PhD in Computer Science which he obtained from Carleton University in1999

MODULE 2 (1 hour) MATHEMATICAL PRILIMENARIES – LOGIC Foundations of Computer Science and Software Engineering

Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Huh?

Propositional Logic Introduction to Computer Science – Preliminaries Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument

Propositional Logic Introduction to Computer Science – Preliminaries The simplest logical system is that of “propositional logic” – which is roughly equivalent to what is also known in computer science and computer engineering as “Boolean algebra” Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument

Propositional Logic Introduction to Computer Science – Preliminaries Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument The simplest logical system is that of “propositional logic” – which is roughly equivalent to what is also known in computer science and computer engineering as “Boolean algebra” Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False

Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False

Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:

Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:

Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:

Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value)

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese AND The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese OR The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) If Everyone in France Speaks Chinese Then The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) If Everyone in France Speaks Chinese Then The moon is made of cheese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) It is NOT True that Everyone in France Speaks Chinese Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries According to the above, we can make an infinite number of sentences, such as Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries But if we know the truth values of two simple sentences, how do we determine the truth value of a compound sentence? T T F F T F T F T F F F T T F F T F T F T T T F T T F F T F T F T F F T T F T T p and q is true when both are true, and false otherwise p or q is true when either one is true, otherwise it is false if p then q is false only when p is true and q is false not p is false when p is true & true when p is false Introduction to Computer Science – Preliminaries

Propositional Logic Introduction to Computer Science – Preliminaries iff (if and only if), or as it is also called bi-directional if or equivalence Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries

Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q These two statements have the same truth value for every truth value assignment of P and Q, and thus they are equivalent Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying either p is false or q is false Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying either p is false or q is false Which seems reasonable Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q This statement is valid since it cannot be made false, or since it is true for every possible truth assignment of p and q Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Are there truth values for r, p and q that will make it true? Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Are there truth values for r, p and q that will make it true? If it can be made true, in how many ways? Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability This statement can be made true ... Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability If we have the following: Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability Which means we have the following: Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability The OR statement can be made true in three ways Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) An alternative to this process is to make the entire truth table and select at the end the rows for which the last formula comes out to be true. For a formula with 3 symbols this might not be too much, but what if we had 6 or 10 symbols? Introduction to Computer Science – Preliminaries

Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) Try it out! Plug the different truth values of the three combinations we arrived at to see if the original formula comes out to be true! Introduction to Computer Science – Preliminaries

Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS Every digit is displayed by turning some variables ON (true) and some variables OFF (false)

Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS Every digit is displayed by turning some variables ON (true) and some variables OFF (false)

Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS ? Every digit is displayed by turning some variables ON (true) and some variables OFF (false)

Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences:

Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true)

Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true) But this statement is not valid – it is not true for all possible truth values of p, q and r

Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true) But this statement is not valid – it is not true for all possible truth values of p, q and r WHAT WENT WRONG?

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed First-Order Logic (FOL), or the Predicate Calculus, as it is also called, introduces predicates, quantifiers and variables

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed First-Order Logic (FOL), or the Predicate Calculus, as it is also called, introduces predicates, quantifiers and variables

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y Note that the scope of y is within the scope of x

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y Note that the scope of y is within the scope of x Later in the course we will see that the notion of introducing and defining variables in a certain scope in programming languages is exactly the same as that in first- order logic

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y Is true if x is positive

First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y Is true if x is positive For any x and for any y, if y is the square of x, then y is positive

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inference Rules in Logic: Modus Ponens (MP) An important rule of inference in propositional logic is called modus ponens, which can be described as follows:

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries An important rule of inference in propositional logic is called modus ponens, which can be described as follows: The rule says: if p implies q, and we can establish p, therefore we can conclude q. Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following:

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If p is true, and q is true, then we can infer (p and q)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If (p and q) is true, the we can infer p and we can infer q If p is true, and q is true, then we can infer (p and q)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If (p and q) is true, the we can infer p and we can infer q (elimination) if (not p or q) is true, and we know p is true, then q must be true If p is true, and q is true, then we can infer (p and q)

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL Let us now re-consider this argument and use first order logic to make this inference:

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL Let us now re-consider this argument and use first order logic to make this inference: Let us introduce these predicates: True if x is a mathematician True if x is clever

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1.

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2.

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2. 3.

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2. 3. 4.

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Let us see how we can use FOL in data and information representation and reasoning Suppose we want to represent the blocks world depicted graphically below, where the goal is stack all the blocks from A (at the top) to E (at the bottom) and where the rule that we should follow is that a block cannot be placed on top of another block unless it precedes it alphabetically

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – predicates to describe the domain

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – predicates to describe the domain

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning If block x is not stacked, and block x precedes y, and block y is free, then block x can be placed on top of block y Representing the domain – rules of movement

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – domain knowledge If block x precedes y, and block y precedes z, then block x precedes block y

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science FOL can be used to define sets and relations As an example, let us define the predicate even 0 is even (or, that 0 is even is true!) Any number is even if the one preceding it is not

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition Check using the above definition of even if even(5) comes out to be true or false

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition Later in the course you will see how we can write a simple function/program to test whether some input number is an even number of not

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects Define the set that would contain the elements {3, 7, 9, 11} without listing the elements but using the predicate even

Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects Sets, relations (between sets) and functions will be the subject of the next module!

Introduction to Computer Science END OF MODULE 2 MATHEMATICAL PRILIMENARIES – SETS AND RELATIONS Next module

Want to watch this again later? Sign in to add this video to a playlist. This video is part of an online course, Intro to Computer Science ...

Read more

This video is part of an online course, Intro to Computer Science. Check out the course here: https://www.udacity.com/course/cs101.

Read more

Quiz 2; Unit 3 ... What Do Computer Scientists Do? Final Exam; Download Course Materials; ... 6.00SC Introduction to Computer Science and Programming, ...

Read more

School of Computer Science - Modules ... mod-intro-comp-sec: 2/I: ... These in turn link to the School of Computer Science Module Description.

Read more

Intro to Computer Science ... Lesson 2: How to Repeat. Introducing Procedures; ... Intro to Programming Tech Entrepreneur

Read more

CS50 is a free online class introducing students to the basics of computer science. CS50 is taught by David Malan of Harvard University.

Read more

Computer science is a diverse topic encompassing computer technology, hardware, software, ... Module 1: Introduction to Computer Science: Module 2: ...

Read more

Fall, 2015, NYU Department of Computer Science ... Functions and Modules; ... Intro To Computer Programming

Read more

... Introduction to IT Security and Computer ... Module 2 – Darknets Tor Hidden Services; Module 3 ... and IT Professionals since 1998 with a diverse ...

Read more

Teach our K-8 Intro to Computer Science. ... Artist 2; Functions; Farmer 1; Conditionals; Artist 3; Song-writing; Farmer 2; Abstraction; Artist 4; Relay ...

Read more

## Add a comment