1/4
CIS1910 Discrete Structures in Computing (I)
Winter 2013, Solutions to Assignment 2
PART A
1. These two binary operations are used to define the set C of complex numbers.
Let (a,b), (c,d) and (e,f) be three elements of R2.
(a) We have: (a,b) (c,d) = (
Relations
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Relations
1 / 14
Relations
Common relationships:
I a business and its clients
I staff and their time sheets
I clients and their invoices
I staff and the projects they work on
Generalized Permutations and Combinations
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Generalized Permutations and Combinations
1 / 21
Permutations with Repetition
So far weve looked at permutations and combinations of objects wh
Connectivity
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Connectivity
1/7
Connectivity
Definition
Let G = (V, E) be a simple graph. A path is a sequence of vertices v0 , v1 , . . . , vn where
there is an edge between each consecu
Sets and Set Operations
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Sets and Set Operations
1 / 20
Sets
Definition: Set
A set is an unordered collection of objects.
Sets are the fundamental discrete structure for:
I
Databases: re
Planar Graphs
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Planar Graphs
1/8
Planar Graphs
Circuit Design
When designing electronic circuits or computer chips, it is often desirable to implement
the designs without wires crossing.
Induction
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Induction
1 / 16
Induction
What is Induction?
I reasoning from the particular to the general; whats true for particulars should
(might) be true for all other instances
I a pro
Integer Representations
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Integer Representations
1 / 12
Other Integer Representations
It is often useful to represent integers in bases other than the standard base 10.
Other common base
Trees and Their Applications
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Trees and Their Applications
1 / 14
Trees
We already know that graphs can be used to model many problems. Trees are a
special type of graph with many nice p
Introduction to Graphs
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Introduction to Graphs
1 / 10
Problems Solved Using Graphs
Graphs are frequently used to model real world problems. Many of these
problems can be solved by applyi
Functions
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Functions
1 / 16
Functions
The theory that has had the greatest development in recent times
is without any doubt the theory of functions.
 Vito Volterra, 1888.
The assigning
Sequences and Sums
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Sequences and Sums
1 / 17
Sequences
Definition
Sequences are used to represent ordered lists of elements.
They can be finite (we call them strings), or infinite. We w
Methods of Proof
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Methods of Proof
1 / 26
Definitions
Definition
A theorem is a statement that can be shown to be true.
We demonstrate that a theorem is true with a sequence of statement
Discrete Probability
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Discrete Probability
1 / 23
Where do we use Probability?
I
Average case analysis of running times for algorithms
I
Inheritance of genetic traits
I
Gambling
I
Random
Boolean Algebra
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Boolean Algebra
1 / 28
Outline
Topics:
I
Boolean variables, functions, operators
I
Relationship with logic
I
Combinatorial circuits (gating networks)
I
Duality
I
Sum of
Introduction to Logic
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Introduction to Logic
1 / 46
Logic: What is it Good For?
The rules of logic apply directly to future topics in computer science:
I design of computer circuits
I de
The Basics of Counting
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
The Basics of Counting
1 / 36
Combinatorics
Definition
Combinatorics is the study of the arrangement of objects. An important area of
combinatorics is enumeration
Terminology and Special Types of Graphs
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Terminology and Special Types of Graphs
1 / 16
Terminology for Undirected Graphs
Definition
Two vertices u and v are said to be adjacent or neigh
Discrete Mathematics Introduction
CIS 2130 (DE)
Notes by: Joe Sawada
University of Guelph
CIS 2130 (DE)
Discrete Mathematics Introduction
1/7
What is Discrete Mathematics?
Definition: Discrete Mathematics
Discrete Mathematics is the part of mathematics th
1/6
CIS1910 Discrete Structures in Computing (I)
Winter 2013, Solutions to Assignment 4
QUESTION A.
1. (a) The domain of definition of f is the set of all the elements x
of the domain R such that (x1)/(2x+1) belongs to the codomain R.
It is cfw_xR  (x1)/
1/5
CIS1910 Discrete Structures in Computing (I)
Winter 2013, Solutions to Midterm
To simplify the task of marking, Q1 was marked out of 18, Q2 out of 7.5, Q3 out of 10.5,
Q4 out of 13.5 (plus 3 bonus marks for question 2c), Q5 out of 12 (plus 3 bonus mar
1/3
CIS1910 Discrete Structures in Computing (I)
Winter 2013, Solutions to Assignment 1
PART A
1. Possible answers are (a) S=cfw_1,2 (b) S=cfw_2,3 (c) S=cfw_2,cfw_3 (d) S=cfw_3,cfw_3.
For example, the elements of S=cfw_2,cfw_3 are 2 and cfw_3,
i.e., 3 doe
1/7
CIS1910 Discrete Structures in Computing (I)
Winter 2013, Solutions to Assignment 3
A. Rules of Inference
1) Let r be the proposition it rains, let f be the proposition it is foggy, let s be the proposition
the sailing race will be held, let l be the
Composition of Relations

The composition of relations R and S on set A is another relation on A, denoted S o R
The pair (a,c) S o R if and only if there is a,b,c A such that (a,b) R and (b,c) S
Here are two relations defined on the set cfw_a,b,c,d:
o S
QUANTIFIERS

Quantifiers provide notation that allows to quantify (count) objects in the domain of the variable
UNIVERSAL QUANTIFIERS

(upside down capital A) is known as the universal quantifier
x P(x) means that for all x in the domain, the predicate
SEQUENCES


A sequence is a special type of function in which the domain is a consecutive set of integers
When a function is specified as a sequence, using subscripts to denote the input to the function
is more common
The expression gk is called a term

Discrete mathematics is the study of mathematical structures that are fundamentally discrete
rather than continuous
LOGIC


Logic is the study of formal reasoning important to make precise statements
Proposition denoted as p,q or r s the basic element
FUNCTIONS

From calculus you are familiar with the concept of a realvalued function f,
which assigns to each number x a particular value y = f(x) where y
But the notion of a function can also be naturally generalized to the concept
of assigning element
Binary Relations

A binary relation is a way of expressing a relationship between two sets
Mathematically, a binary relation between two sets A and B is a subset R of A x B
The term binary refers to the fact that the relation is a subset of the Cartesian