Purdue University
West Lafayette
CS 182
Vernon J.Rego
Fall 2017
Assignment 4
Due: Wednesday, November 1st, 2017, upload before 11:59pm
1) (50 pts.) Solve the recurrences:
a) an =4an1
a0 =1
n > 1
b) an
$5 du
Your Name:
CS 182
MIDTERM
Fall 2011
Left Neighbor: M_ Right Neighbor:
This exam contains 9 numbered pages. Check your copy and exchange it immediately if
it is defective. Print your name and y
CS 182 Spring 2015 Homework 6
Due date: Monday, April 6, 2015 (before class)
1. (8pts)
(a) How many ways are there to pick a sequence of two dierent letters of the alphabet that appear in
the word MAT
CS182 Spring 2016: Solution to Homework 1
Due date: Tuesday, September 4th, 2012 (before class).
1. (8pts) Show that each of these implications is a tautology by using truth tables.
(a) [q (p q)] q.
p
CS 182 Spring 2015 Homework 8
Due date: Friday, May 1, 2015 (before class)
Total points: 100
1. (20pts) Solve the congruence
(a) 7x 4 (mod 12).
(b) 2x 7 (mod 17).
2. (20pts) Find the solutions to the
CS 182 Spring 2015 Homework 7
Due date: Monday, April 20, 2015 (before class)
1. (10pts) Assume that the probability a child is a boy is 0.6 and that the sexes of children
born into a family are indep
CS 182 Spring 2015 Homework 6
Due date: Monday, April 6, 2015 (before class)
1. (8pts)
(a) How many ways are there to pick a sequence of two dierent letters of the alphabet that appear in
the word MAT
[40] Homework 5: Big O, .
[10] Select the best big Oh notation for each expression. Justify by showing the constants
c and n0 . Note that f (n) = O(g(n) if there are constants c > 0 and n0 > 0 so that
[50] Homework 4. Proof Techniques
Each problem is worth 10 points
[10] Show that
3
3 is irrational.
[10] Let A be a set of cardinality n. Let P (A) be the power set, that is, the set of all subsets
of
CS 182 Spring 2015 Homework 8
Due date: Friday, May 1, 2015 (before class)
Total points: 100
1. (20pts) Solve the congruence
(a) 7x 4 (mod 12).
Notice that gcd(12,7) = 1, so an inverse of 7 modulo 12
Big-O
Margaret M. Fleck
20 October 2011
These notes cover asymptotic analysis of function growth and big-O notation.
1
Running times of programs
An important aspect of designing a computer programs is
Functions and one-to-one
Margaret M. Fleck
23 September 2011
These notes cover what it means for a function to be one-to-one and
bijective. This general topic includes counting permutations and compar
Countability
Margaret M. Fleck
30 November 2011
These notes discuss innite sets and countability.
1
The rationals and the reals
Youre familiar with three basic sets of numbers: the integers, the ratio
Algorithms
Margaret M. Fleck
26 October 2011
These notes cover how to analyze the running time of algorithms.
1
Introduction
The techniques weve developed earlier in this course can be applied to anal
Functions and onto
Margaret M. Fleck
22 Sept 2011
These notes cover functions, including function composition and when a
function is onto. This topic includes discussion of nested (dissimilar) quantie
Graphs
Margaret M. Fleck
10 October 2011
These notes cover the basics of (nite) undirected graphs, including isomorphism, connectivity, and graph coloring.
1
Graphs
Graphs are a very general class of
Math jargon
Margaret M. Fleck
Fall 2010
Mathematicians write in a dialect of English that diers from everyday
English and from formal scientic English. To read and write mathematics
uently, you need t
Introduction and math review
Margaret M. Fleck
23 January 2011
This section introduces the course and quickly reviews basic mathematical
concepts.
1
What is the course about?
This course teaches two d
[30] Homework 3. Programming Assignment
The goal of this assignment is to nd good approximations of
n
Hn =
1
k
k=1
and
n! = 1 2 3 n
for large n (n ).
[15] Evaluation of the Harmonic Sum Hn :
Tabulate
EXAMPLE 6 The difference of cfw_1, 3, 5 and cfw_1, 2, 3 is the set cfw_5; that is, cfw_1, 3,5 cfw_1,2,3 2 cfw_5. This
is different from the difference of cfw_1, 2, 3 and cfw_1, 3, 5, which is the set
TABLE 6 Logical Equivalences.
Equivalence Name
Identity laws
E'U
< >
M'
III III
'
Domination laws
Idempotent laws
p Double negation law
A
J
535
p V q E q V p Commutative laws
PAIEIAP
(p V g) V r E p V
'H-IE SUBTRACTION RULE Ifa task can be done in either :11 ways 01-112 ways,then the
numberofwaysto dothetaskisnl +112 minnsthcnumberofwaysto dothetaskthatare
common to the two dierent ways.
EXAMPLE 14 What is the power set of the set cfw_0, 1, 2?
[ma Solution: The power set ?(cfw_0, 1, 2) is the set of all subsets of cfw_0, 1, 2. Hence,
Examnles \*
79(cfw_0,1,2) [email protected],cfw_0,cfw_1,cfw_2,
p is necessary and sufcient for q
if p then 4.3 , and conversely
Hp i q .I
The last way of expressing the bicenditi
if and only if. Note that p <>~ g has ex:
TABLE 6 The Truth Table for the
Bieonditio
ALGORITHM 3 The Binary Search Algorithm.
procedure binary search (3: integer, a1, a2, . . . , an: increasing integers)
i := 1cfw_i is left endpoint of search interval
j := n [ j is right endpoint of s
TABLE 2 Rules of Inference for Quantied Statements.
. Vx P (3:) Universal instantiation
. . P(c)
P(c) for an arbitrary c
Vx P ()6) Universal generalization
Ele(x)
Existential instantiation
'. P(c) fo
ALGORITHM 4 The Bubble Sort.
procedure bubblesort(a1, . . . , an : real numbers with n 3 2)
for i := 1 to n 1
forj :=1t0ni
if (if > aj+1 then interchange a- and (II-+1
cfw_11, . . . , an is in increas
CS-182
Due- Wednesday September 20, 2017
1)
2)
Lets make P as Logic is difficult
Lets make Q as Many students like logic
Lets make R as Mathematics is easy
AThat mathematics is not easy, if many stude
Purdue University
West Lafayette
CS 182
Vernon J.Rego
Fall 2017
Assignment 3
Due: Wednesday, October 4th, 2017, upload before 11:59pm
1) (20 pts.) Do Exercise 52 of Section 3.1 (page 204)
2) (20 pts.)
CS182 Cheat Sheet
Boolean Algebra
p q p q
1 1
1
Truth table for implies 1 0
0
0 1
1
0 0
1
Disjunctive Normal Form: take truth values from every
True row, and and them together. Then or each row with e