Algorithms
Summer, 2013
1 / 38
What is an algorithm?
I There are many ways to de_ne an algorithm
I An algorithm is a step-by-step procedure for carrying
out a
task or solving a problem
I an unambiguou
Comp 2700 (Discrete Structures) Fall 2016. Lab 3.
Submissions: This assignment is due at 11:59 PM on the 14th of November, 2016. Each student must submit his or
her own assignment. This is a programmi
Solutions to PS1.
Problem 1 [5 + 5 pts]: Construct the truth table for the following compound propositions:
(a) (p q) (p q)
(b) (p q) r) s
Solution:
(a)
p
F
F
T
T
q
F
T
F
T
pq
T
F
F
T
p q
F
T
T
F
(a)
Comp 2700 (Discrete Structures) Fall 2016. Problem Set 4.
Submissions: This assignment is due at 11:59 PM on the 19th of October, 2016. Each student must submit his or her
own assignment. Submit a har
Comp 2700 (Discrete Structures) Fall 2016. Problem Set 5.
Submissions: This assignment is due at 11:59 PM on the 31st of October, 2016. Each student must submit his or her
own assignment. Submit a har
import java.util.*;
import java.io.*;
public class Matrices
cfw_
public static void main(String[] args) throws IOException
cfw_
File data = new File("data2.txt"); / The input file data.txt is locat
COMP 2700
Spring 2016
Lab 1
Due Thursday, Feb. 11th
0. You may choose to work with one other student enrolled in your COMP 2700 class on this assignment if you wish. If
you do, the project only needs
/*
* Write a description of class Sorting here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Sorting
cfw_
public static void insertionSort(int[] a)
cfw_
COMP 2700
Spring 2016
Lab 2
Due Thursday, March 3rd
0. You may choose to work with one other student enrolled in your COMP 2700 class on this assignment if you wish. If
you do, the project only needs
COMP 2700 Discrete Structures Spring 2017
Mr. Kriangsiri (Top) Malasri
Contact Information:
Office: Dunn Hall 396
Department Office: Dunn Hall 375
Office Phone: 901.678.5689
Department Phone: 901.678.
Comp 2700 (Discrete Structures) Fall 2016. Problem Set 1.
Submissions: This assignment is due at 11:59 PM on the 7th of September, 2016. Each student must submit his or
her own assignment. Solutions c
Comp 2700 (Discrete Structures) Fall 2016. Lab 1.
Submissions: This assignment is due at 11:59 PM on the 14th of September, 2016. Each student must submit his or
her own assignment. This is a programm
Counting
Arthur G. Werschulz
Summer, 2013
1 / 40
Why talk about counting in a college-level course?
I Counting isn't as easy as it looks.
I Simple sets: trivial to count.
I Complicated sets: hard to c
Sets
Arthur G. Werschulz
Department of Computer and Information Sciences
Summer, 2013
1 / 31
Outline
I Basic defnitions
I Naming and describing sets
I Comparison relations on sets
I Set operations
I P
Arthur G. Werschulz
Department of Computer and Information Sciences
Summer, 2013
1 / 21
Outline
I Finding patterns
I Notation
I Closed form
I Recursive form
I Converting between them
I Summations
2 /
CISC 1100: Structures of Computer Science
Chapter 0
Introduction
Arthur G. Werschulz
Summer, 2013
1 / 30
Welcome to CISC 1100!
I A computer science course, seasoned with a soup_con of math.
I Counts t
Functions
Arthur G. Werschulz
Summer, 2013
1 / 64
Why functions?
I Sets: rigorous way to talk about collections of objects
I Logic: rigorous way to talk about conditions and
decisions
I Relations: rig
Logic
Arthur G. Werschulz
Fordham University Department of Computer and
Information Sciences
Summer, 2013
1 / 49
Logical (or illogical?) reasoning
I Is this a valid argument?
I All men are mortal.
I S
Probability
Summer, 2013
1 / 49
Why study probability?
Want to know the likelihood of some event:
I Getting a \head" when ipping a coin (should be 12
)
I Getting at least two \heads" when ipping a coi
Relations
Arthur G. Werschulz
Department of Computer and Information Sciences
Summer, 2013
1 / 34
Why relations?
I Sets: rigorous way to talk about collections of objects
I Logic: rigorous way to talk
Comp 2700 (Discrete Structures) Fall 2016. Solutions to PS2.
Problem 1[10 pts]: If functions f and f g are one-to-one does it follow that g is one-to-one? If your answer is Yes
give a proof, otherwise
MT 430 Intro to Number Theory
PROBLEM SET 2
Solutions
Problem 1. If (a, b) = p, a prime, what are the possible values of (a3 , b)?
Since the only common prime divisor of a and b is p, we only need to