Computer Science / Software Engineering Notes Network

Foundations of Computer Science

Matthew Barnes

Contents

Introductory        6

Greek letters        6

Mathematical properties        6

Logic symbols        6

Set theory        7

Basics        7

Definition        7

Notation        7

Membership        7

Cardinality        7

Common sets in maths        7

Empty set        7

Operations on sets        8

Union        8

Intersection        8

Difference        8

Predicates        8

Naive set theory        8

Reasoning about sets        8

How to relate sets        8

When are two sets equal        9

Products and sums of sets        9

Ordered pairs        9

Cartesian product        9

Sum (or disjoint union)        9

Functions between sets        9

Picture of a function        9

Notation        9

Range        10

Functions of several variables        10

Operations on functions        10

Composition        10

Inverting functions        10

A taxonomy of functions and the isomorphism theorem        10

Injective functions        10

Surjective functions        10

Bijective functions        11

Isomorphism theorem        11

Function spaces and powersets        11

The graph of a function        11

Function spaces        11

Powersets        11

Sizes of infinity        12

Countable sets        12

Uncountable sets        12

Diagonalisation proof        12

Cantor’s Theorem        12

Cantor-Bernstein-Schröder Theorem        12

Relations        12

Relations between sets        13

Digraphs        13

Equivalency        13

Equivalence relations        13

Equivalence classes        13

Partitions        14

Partial Orders        14

Total Orders        14

Propositional and predicate logic        15

Propositional logic        15

Syntax        15

Formulas        15

Backus-Naur form        15

Trees        15

Syntax trees        16

Syntactic conventions and brackets        16

Semantics        16

What is the semantics of a formula?        16

Truth tables        17

Semantics as a (recursively defined) function        17

Tautologies        17

Formal proofs        17

Semantic entailment        18

Formal proof systems        18

Soundness        18

Completeness        18

Natural deduction        19

Proofs in natural deduction        19

Rules of natural deduction        19

Properties of natural deduction        21

Predicate logic        21

What’s the difference?        21

Arities        21

Example predicate logic formulas        22

Syntax        22

BNF for predicate logic        22

Free and bound variables        22

Syntactic conventions        22

Semantics        23

Semantics of predicate logic        23

Semantics of terms        23

Linear algebra        23

Vectors        23

Gaussian Elimination        24

Row reduction        24

Matrix representations        24

Row operations        25

How many solutions        25

Row operations as matrix multiplication        26

Linear dependence        26

Finding linear dependence with algebra        26

Finding linear dependence with calculus        27

Kernel / Nullspace        27

Span        27

Matrix multiplication rules        28

Transpose        28

Inverse properties        28

Matrix determinants        28

Minor        28

Cofactor        29

Determinant        29

Inverse of a 3x3 matrix        29

Eigenvalues and eigenvectors        31

Calculating eigenvalues        31

Calculating eigenvectors        32

Combinatorics        33

Principle of inclusion and exclusion        33

Pigeonhole principle        33

Fibonacci sequence and recursion        33

Proof by induction        33

Counting by bijections        34

Bit strings        34

Generalised sum and product rule        35

Sum rule        35

Product rule        35

Generalised product rule        36

Permutations        36

Circular arrangements        36

Combinations        37

Counting subsets        37

Binomial expansion        37

Vandermonde Identity        38

Multinomials        38

Probability and statistics        39

Descriptive statistics        39

Ordered stem and leaf diagram        39

Histograms        39

Sample sizes        39

Measures of central location        40

Skewness of relative frequency histograms        40

Measures of variability        41

Relative position of data        41

Percentiles        41

Quartiles        41

Box plot        42

Interquartile range        42

The Empirical Rule        42

Chebyshev’s Theorem        43

Basic concepts of probability        43

Random events        43

Sample space        43

Events        43

Probability of events        44

Tuple        44

Combinatorial analysis        45

Basic sampling        45

Subset of sample        45

Partitions of a set of size k        45

Number of successes in a sample        46

Difference between k successes and successes on k specified draws        47

Conditional probability        47

Basic probability theory        47

Total probability        47

Bayes’ Theorem        47

Distributions        47

Random variables        48

Discrete random variables        48

Continuous random variables        48

Binomial Distribution        49

Normal Distribution        50

Standard Normal Distribution        52

Probabilities for standard normal distribution        52


Introductory

Greek letters

Mathematical properties

Logic symbols

Set theory

Basics

Definition

Notation

Membership

Cardinality

Common sets in maths

Empty set

Operations on sets

Union

Associative

Commutative

Intersection

Associative

Commutative

Difference

NOT associative

NOT commutative

Predicates

Naive set theory

Reasoning about sets

How to relate sets

When are two sets equal

Products and sums of sets

Ordered pairs

Cartesian product

Sum (or disjoint union)

Functions between sets

Picture of a function

Notation

Range

Functions of several variables

Operations on functions

Composition

Inverting functions

A taxonomy of functions and the isomorphism theorem

Injective functions

Surjective functions

Bijective functions

Isomorphism theorem

Function spaces and powersets

The graph of a function

Function spaces

Powersets

Sizes of infinity

Countable sets

Uncountable sets

Diagonalisation proof

Cantor’s Theorem

Cantor-Bernstein-Schröder Theorem

Relations

Relations between sets

Digraphs

Equivalency

Equivalence relations

Equivalence classes

Partitions

Partial Orders

Total Orders

Propositional and predicate logic

Propositional logic

Syntax

Formulas

Backus-Naur form

Trees

Syntax trees

Syntactic conventions and brackets

Semantics

What is the semantics of a formula?

Truth tables

Semantics as a (recursively defined) function

Tautologies

Formal proofs

Semantic entailment

Formal proof systems

Soundness

Completeness

Natural deduction

Proofs in natural deduction

Rules of natural deduction

Rules for conjunction

Rules for implication

Discharging assumptions

Rules for negation

Rules for disjunction

All

Properties of natural deduction

Predicate logic

What’s the difference?

Arities

Example predicate logic formulas

Syntax

BNF for predicate logic

Free and bound variables

Syntactic conventions

Semantics

Semantics of predicate logic

Semantics of terms

Linear algebra

Vectors

Gaussian Elimination

Row reduction

Matrix representations

Row operations

How many solutions

Row operations as matrix multiplication

Linear dependence

Finding linear dependence with algebra

Finding linear dependence with calculus

Kernel / Nullspace

Span

Matrix multiplication rules

Transpose

Inverse properties

Matrix determinants

Minor

Cofactor

Determinant

Inverse of a 3x3 matrix

0 * 0 +

1 * 2 +

2 * -2

Eigenvalues and eigenvectors

Calculating eigenvalues

Calculating eigenvectors

Combinatorics

Principle of inclusion and exclusion

Pigeonhole principle

Fibonacci sequence and recursion

Proof by induction

Counting by bijections

Bit strings

Generalised sum and product rule

Sum rule

Product rule

Generalised product rule

Permutations

Circular arrangements

Combinations

Counting subsets

Binomial expansion

Vandermonde Identity

Multinomials

Probability and statistics

Descriptive statistics

Ordered stem and leaf diagram

Histograms

Sample sizes

Measures of central location

Skewness of relative frequency histograms

Measures of variability

Relative position of data

Percentiles

Quartiles

Box plot

Interquartile range

The Empirical Rule

Chebyshev’s Theorem

Basic concepts of probability

Random events

Sample space

Events

Probability of events

Tuple

Combinatorial analysis

Basic sampling

Subset of sample

Partitions of a set of size k

Number of successes in a sample

Difference between k successes and successes on k specified draws

Conditional probability

Basic probability theory

Total probability

Bayes’ Theorem

Distributions

Random variables

Discrete random variables

Outcome

1

2

3

4

5

6

Probability

1/6

1/6

1/6

1/6

1/6

1/6

Continuous random variables

Binomial Distribution

Normal Distribution

Standard Normal Distribution

Probabilities for standard normal distribution