CMIS 160 Discrete Math Programs

Download these into a C++ compiler such as DevC++ or GNU


Boolean expression evaluator
Truth table maker

Binary numbers

Two's complement int
Floating-point format

Chap. 3: Prime numbers etc.

Prime numbers generator
all 6542 prime numbers <64K (38KB)
all 78498 prime numbers <1M (538KB)
prime numbers <5M PNG image
Prime (unique) factorization

Irrational numbers:
first 10000 digits
first 1 M digits     as image (each triple of digits is coord)

mod div floor ceiling rounding

Euclidean algorithm for GCD


Sum of arithmetic sequence
Sum of geometric sequence


Power set
Throwing Dice     dice.exe
Combinations (alt.)
Random numbers
Binomial coefficients

Finite State Automata

FSA simulator     fsa.exe

Example: Epp 7.2.2
Example: Epp 7.2.3
Example: made-up one


Ackermann's function
Towers of Hanoi
Ulam's function


Generate random graph
Connected components
Euler circuit
Minimum spanning tree (Kruskal and Prim)
Topological sorting
graph.h include file Download this too.

Example graph: Epp 11.6.3
Example graph: Epp 11.6.11
Example graph: CLR 24.4
Example graph: USA mileage
Example graph: Epp 10.5.7
Example graph: Epp 10.5.10
Example graph: Epp 11.2.6
Example graph: K3
Example graph: K5
Example graph: K10
Example graph: K100
Example graph: K101