Posts

Showing posts from October, 2019

Discrete Mathematics - Week 1 - Summary

Image
Definition of Discrete Mathematics * It is the study of discrete objects, which are different from connected objects * Discrete objects are those which are separated or distant from each other. Such as integers, rational numbers, houses, people, etc * Course is concerned with objects such as integers, propositions, sets, relations, and functions, which are all discrete * We will learn concepts associated with them, their properties, and relationships among them * It's being applied to the practical fields of mathematics and CS * Improves reasoning and problem-solving capabilities The definition of a set * Set theory branch of mathematics that deals with the properties of well-defined collections of objects. * Set theory forms the basis of several other fields of study such as counting theory, relations, graph theory and finite state machines. What is a set Mathematicians use the term set to refer to a collection of any kind of objects: people, ideas, or numbers, for...

Introduction to Programming - Week 1 and 2 Summary

Image
What is programming? Commands are the smallest building blocks of your program. A single intruction to the computer to perform an action. A program is a collection of these individual ccommands put together in the right order to solve a problem, complete a task, or maybe interact with the user. The collection of commands you write for your program is called source code. 2D coordinate system * Computer screens are made up of tiny dots * Each one of these dots is called pixels * In p5.js we create an area of pixels on a webpage we can draw to: this is called the canvas * A canvas needs a width and height in pixels How you will be assessed?  * New topic every two weeks * This is your first topic (development environment) * Each topic will be divided into a series of lessons * In a lesson you will learn by watching videos * The game keeps a running total of your score which increases as you progress but fixed grades are taken at two points in the term. Each of...

Fundamentals of Computer Science - Week 2 Summary - Part 2 out of 2

Predicates and Quantifiers Introduction Until now, propositional logic cannot adequately express the meaning of all statements in mathematics and in natural language. For example, suppose that we know that "every computer connected to the university network is functioning properly" No rules of propositional logic allow us to conclude the trutth of the statement Predicates Statements involving variables, such as "x > 3", "x = y + 3" and "computer x is under attack by an intruder" are often found in mathematical assertions. These statements are neither true nor false when the values of the variables are not specified. There are ways that propositions can be produced from such statements. Consider "x is greater than 3" * has two parts * x, is the subject of the statement * "is greater than 3" refers to a property that the subject of the statement can have. * "x is greater than 3" can be denot...

Fundamentals of Computer Science - Week 2 (Essential reading) Exercises p. 34, p. 35, p. 36

TODO

Fundamentals of Computer Science - Week 2 (Essential reading) - Part 1 out of 2

Image
Propositional Equivalences An important type of step used in a mathematical argument is the replacement of a statement with another statement with the same truth value. Note that we will use the term “compound proposi- tion” to refer to an expression formed from propositional variables using logical operators, such as p ∧ q. Tautology: compound proposition that is always true Contradiction: compound proposition that is always false Contingency: compound proposition that is neither tautology nor a contradiction Logical Equivalences Compound propositions that have the same truth values in all possible cases are called logically equivalent. We can also define this notion as follows: > The compound propositions p and q are called logically equivalent if p ↔ q is a tautology. The notation p ≡ q denotes that p and q are logically equivalent. Propositional Satisfiability An unsatisfiable compound proposition happens when the negation is a tautology. A satisfiable...

Fundamentals of Computer Science - Week 2 Summary - Part 1 out of 2

Propositional Equivalences * Two formulas are equivalent when they have the same truth tables * We denote equivalence by ≡ * A ≡ B means that A and B always have the same truth values, regardless of how the variables are assigned. * Note that ≡ is a relation and NOT a connective De Morgan's Laws ¬(p∧q)≡¬p∨¬q  ¬(p∨q)≡¬p∧¬q It is similar to the process of algebra when you have a negative before a parenthesis. First law tells us also that the connective also changes.

Fundamentals of Computer Science - Week 1 Summary - Part 2 out of 2

Tautology: formula is a tautology when all scenarios are true Consistent: formula is consistent when at least 1 scenario is true Contradiction: formula is a contradiction when all scenarios are false

Fundamentals of Computer Science - Week 1 (Essential reading) Exercises p. 22, p. 24

TODO

Fundamentals of Computer Science - Week 1 (Essential reading) - Part 2 out of 2

Language of logic makes statements in mathematics and the sciences and in natural language precise. It is used in the specification of software and hardware. Translating English Sentences English is ambiguous. Translating sentences into compound statements (and other types of logical expressions) removes the ambiguity. “You can access the Internet from campus only if you are a computer science major or you are not a freshman.” a → (c ∨ ¬f) “You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old.” (r ∧ ¬s) → ¬q System Specifications Translating sentences in natural language into logical expressions is an essential part of specifying both hardware and osftware systems. Boolean searches Logical connectives are used extensively in searches of large collections of information such as indexes of web pages. Because these searches employ techniques from propositional logic, they are called Boolean searches. Logic Puzzles P...

Fundamentals of Computer Science - Week 1 (Essential reading) - Part 1 out of 2

Rosen, K.H.  Discrete mathematics and its applications  (New York: McGraw-Hill, 2012) 7th edition, Chapter 1.1-1.2, pp.1-22. Proposition: a proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false. We use letters to denote propositional variables (or statement variables), that is, variables that represent propositions. Conventional letters used for prositional ariables are p, q, r, s. Truth is denoted by T whereas false is denoted by F. Operators: The "not" operator stands for "is not the case". The conditional statement (p -> q) stands for "if..then" and it asserts that q is true on the condition that p holds. A useful way to understand the truth value of a conditional statement is to think of an obligation or a contract. Converse, contrapositive, and inverse For p->q, Converse: q->p Contrapositive:  !q -> !p Inverse: !p -> !q Logic and Bit Operations Computers repre...

Fundamentals of Computer Science - Week 1 (Essential reading) Exercises p. 12, p. 13

Rosen, K.H.  Discrete mathematics and its applications  (New York: McGraw-Hill, 2012) 7th edition, Chapter 1.1-1.2, pp.1-22. 1) 1a) true 1b) true 1c) true 1d) false 1e) not proposition 1f) not proposition 2) 2a) not proposition 2b) not proposition 2c) false 2d) not proposition 2e) false 2f) not proposition  3) 3a) is not the case that Mei has an MP3 player 3b) There is pollution in New Jersey 3c) 2 + 1 is not equal 3 3d) is not the case that the summer in Maine is hot and sunny 4) 4a) is not the case that Jennifer and Teja are friends 4b) There are not 13 items in a baker's dozen 4c) is not the case that Abby sent more than 100 text messages every day 4d) 121 is not a perfect square 5) 5a) is not the case that ...  5b) is not the case that ...  5c) 7 . 11 . 13 != 999  5d) is not the case that ...  6) 6a) true 6b) true 6c) false 6d) false 6e) false 7) 7a) false 7b) true 7c) false 7d) false 7e) true 8) 8a) is not...

Fundamentals of Computer Science - Week 1 Summary - Part 1 out of 2

1.1 Propositional logic What is propositional logic? It's a system that deals with propositions or statements. What is a proposition? What is a statement? Proposition is a statement that can be either true or false. It must be one or the other. Cannot be both. Examples: 2 is a prime number // true 5 is an even number // false Examples of sentences that are not propositions * Sentences whose truth value depends on variables are not propositions. * Questions and imperatives are not propositions. X is a prime number // can't tell since it can be both as we don't know X Are you going to school? // cannot assign a truth value because it's a sentence Do your homework // sentence is an order. has no truth value Notations of propositional logic * Propositions are denoted by CAPITAL letters, P, Q, S, ...   * P = carrots are orange   * Q = I went to a party yesterday * General statements are denoted by lowercae letters, p, q, ...   * unspecified tru...