CS 214_STUDY-GUIDE

advertisement

CS 214-01 STUDY GUIDE FINAL EXAM SPRING 2014

GENERAL COMMENTS: Read the discussions in each section and work as many problems as you can. Working problems is the best way to learn to differentiate between the various principles discussed in the chapters. Review your homework, class notes, previous tests and the textbook. New material (not included on the 1 st or 2 nd test) includes Chapter 4.6: the mighty mod function, Chapter 5.1, 5.2, and 5.3: graphs, trees, and decision trees, plus chapter 7.1 (Boolean algebra structure) and a brief introduction to logic networks. The Study guide will emphasize topics from these sections since you haven’t been tested on them previously. The remainder of the study guide will point out the most significant topics from the earlier chapters.

CHAPTER 4.5: The Mighty Mod Function

 Know how to calculate x mod n

 If you have an array of 10 elements and the array index of an element is calculated as x mod 10, what array element would be indicated if x = 3? If x = 12? (Hint: this is similar to the encoding scheme for the Caesar cipher scheme in

Example 50 (page 367) where g -1 (27 mod 26) = g -1 (1) . In other words, the values “wrap around” back to the beginning of the array.

 Understand the theory of hashing and the use of the mod function in determining the hash value of a number.

 Page 378, Exercise 2.

CHAPTER 5.1:Graphs

 Be able to give a formal definition of a graph, expressed as an ordered triple.

Know the difference between a graph and a directed graph (digraph)

Graph terminiology (page 407-408), Practice Problem 3, Example 8

 Graph isomorphism: understand the definition, be able to recognize when graphs are or are not isomorphic and determine the bijection (one-to-one, onto function) that establishes the isomorphism. Example 11, Practice 8,

Example 12, homework problems

 Representation of graphs as adjacency matrices or adjacency lists. When might an adjacency list be preferable to an

 adjacency matrix?

Problem 43, page 429.

CHAPTER 5.2: Trees

 Define root, leaf, parent, depth of a node, depth (height) of a node, and other tree terminology

Define tree and explain similarity/difference between a tree and a graph.

Be able to define a binary tree and binary tree terminology: complete versus full binary tree, right and left child, etc.

Binary tree representation in an array/table and using pointers. Practice 20, page 437.

Tree traversals; Practice 21; expression trees, prefix and postfix notation for expressions. Example 28, page 441.

CHAPTER 5.3: Decision Trees

Definition of decision tree and its use to represent alternate outcomes of actions.

 Search trees for sequential search and binary search. Which works on an unsorted list, which requires a sorted list.

How is a binary search conducted? Performance measures for each search type – worst case number of comparisons to locate an element or determine that it is not present.

 Exercise 5.3, page 459.

CHAPTER 7.1; Boolean Algebra Structure

 A Boolean algebra is denoted by [B, +,  , ′, 0, 1]. What does each element represent?

State the identity property for + and

.

Be able to give an example of a Boolean algebra.

 What is the idempotent property in Boolean algebra?

---------------------------- Old Material: See Study Guides 1 & 2 for problem examples -------------------------------------------

CHAPTER 1: Formal Logic

 Propositions and predicates; difference between propositional logic and predicate logic.

 Connectives, truth values, truth tables for the basic connectives.

Definition of valid argument, contraction, tautology

Be able to translate simple English statements into predicates (see Example 22, page 39).

CHAPTER 2: Proofs, Recursion

 Proof techniques: exhaustive proof, direct proof, proof by contraction, disproof by counter example.

 Proof by induction

 Recursively defined sequences (recurrence relations)

 See study guide 1 for suggested problems.

CHAPTER 3; Sets, Combinatorics, Probability, Number theory

Set terminology, relationships between sets, Example 3, Proactice 6 on page 190.

(S i

) and the Cartesian product (cross Given sets S

1

, S

2

, be able to enumerate the members of the power set product) of S

1

 S

2

.

 Operations on sets

 Know how and when to apply the multiplication principle. Be able to distinguish between multiplication principle with and without repetitions.

 Addition principle: separately, and combined with the multiplication principle.

 Understand the theory behind the two- and three- set formula for inclusion & exclusion.

 Formulas for permutations and combinations. Show that you understand the difference between a problem that requires combinations and one that requires permutations.

 Events, sample spaces, and calculation of probability as a function of set size. See page 252.

CHAPTER 4: Relations and Functions

 Definitions of binary relations: on a set, on multiple sets.

 Properties of relations: reflexive, symmetric, transitive, antisymmetric.

Be able to recognize the presence or absence of these properties when presented with a set

 Partial ordering and equivalence relations: know definition, be able to recognize relations as being (or not being) a particular type of relation

Definition of function; know terminology such as domain, codomain, range, image, preimage

Definition of onto, one-to-one (injective) and bijective functions.

 Inverse and identity functions.

Download