Download CPSC438F2011M - Governors State University

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Function of several real variables wikipedia , lookup

Transcript
GOVERNORS STATE UNIVERSITY
College of Arts and Science
CPSC 438
Discrete Structures
Dr. Winfried K. Rudloff
MIDTERM EXAM Fall 2011
STUDENT NAME:____________________STUDENT ID:_____________
NOTE: This exam has three parts: The first part contains multiple choice questions (A). The second has essay-type questions
(B). The third has small exercises(C). It is suggested that you read through the exam with an open mind, and try to answer
those questions first that seem easy to you. In successive trials you then solve the more difficult problems. This approach will
prevent you from getting hung up on the difficult questions in the beginning of the exam. It is your judgement which question
to choose first. Numbers in brackets, {}, are points.
>>>> GOOD LUCK - bonne chance - VlEL GLUECK - mucho fortuna <<<
Problem #A1 {5}:
With respect to Formal Logic, consider the following statements:
1. Formal logic focuses on the relationship between statements as opposed to the content of any particular statement.
2. Prolog is a practical application of formal logic in computer science.
3. Logical gates such as, “AND”, “OR”, “NOT”, or “NAND” gates are important hardware parts in computer circuitry based
on formal logic.
4. A statement or propositional form is an expression made up of statement variables (such as A and B) and logical
connectives (such as Λ, V, , ) that becomes a statement when actual statements are substituted for the component
statement variables.
5. In Formal Logic, a Conjunction is symbolized by “V” and a Disjunction by “Λ”.
With respect to the above statements, select the
best answer:
A. All statements, (1), (2), (3), (4), and (5) are false
B. (3) and (2) are incorrect
C. Only (5) is false
D. Only (2), (4), and (5) are correct
E. All statements, (1), (2), (3), (4), and (5) are correct
Problem #A2 {5}:
Consideer the following sentences:
1.
2.
3.
4.
5.
A proof is a demonstration that some statement is true.
Digital computers are based on “on” and “off” switches whereby in machine code the binary value, “1”, symbolizes
the “on” and “0” the “off” state.
Logical gates are electronic devices that can resolve “true” or “false” statements.
“A and B”, “not A”, and “A or B” are called disjunction, negation, and conjuction, respectively.
Truth tables can be used to understand the output of logical gates.
With respect to the above statements, select the incorrect answer:
A. Only (3) is correct
B. Only (1), (2), and (5) are correct
C. Only (4) is false
D. All statements, (1), (2), (3), (4), and (5) are correct
E. (1) and (2) are incorrect
Problem #A3 {5}:
With respect to graphs, select the statement that is incorrect:
A. A graph is set of objects called vertices or nodes where some pairs of objects may be connected by edges.
B. A directed graph has edges that point in one direction.
C. A tree is a connected graph (a path between any two points) with no cycles.
D. The top node of a tree is the root, the nodes directly below a node are its children, the node directly above a node is the
parent, the bottom nodes are leaves, and the height or depth of the tree is the length of the longest path of distinct edges
from root to a leaf.
E. Breath-first traversal of a graph can only start at the root.
Problem #A4 {5}:
With respect to sets and set operations, find the
incorrect statement(s):
A. A set is a collection of things, e.g. {bananas, apples, pears, blueberries} is a set of fruit.
B. If S is a set and x is a member or element of S we write x  S. Otherwise we write x  S.
C. A = [m, i, s, s, i, s, s, i, p, p, i] is a set of alphabetic characters that represents the Mississippi river.
D. The cardinality of a set S is denoted by | S | and is the absolute number of members in the set
E. Union: A  B and Intersection: A  B, are operations on sets.
Problem #A5 {5}:
Study the following statements:
1. In logic, a variable is a symbol that stands for an individual in a collection or set.
2. A sentence containing a variable is called an incomplete statement.
3. Function property, “Inverses” means If ƒ : A  B is a bijection, then there is an inverse function g : B  A defined by g(b)
= a iff ƒ(a) = b. The inverse of ƒ is denoted by ƒ–1.
4. Injective property of a function is called a “one-to-one” relation.
5. Surjective is called “onto” and means that the range is the codomain. In other words, each b  B has the form b = ƒ(a) for
some a  A.
With respect to the above statements, select the best answer:
A. Only (1) is correct
B. All statements, (1), (2), (3), (4), and (5) are incorrect
C. Only (3) is false
D. Only (4), and (5) are incorrect
E. All statements, (1), (2), (3), (4), and (5) are correct
Problem #A6 {5}:
With respect to Propositional Calculus (PC), which one of the following statements is false:
A. The semantics of PC expressions can only be true or false
B. “Fuzzy Logic” allows for values between “True” and “False”.
C. Connectives in PC are symbolized, for example, by Λ, V, , 
D. Variables in PC are terms that have fixed values
E. PC symbols denote relations or functional mappings from the elements of a domain D to the values true or false
Problem #A7 {5}:
Consider the following statements:
1. A binary tree can be used in computer science to sort words alphabetically..
2. Propositions can be called assertions because they assert what is supposed to be true about the program variables at that
point in the program.
3. A program written in a declarative language (e.g. PROLOG) consists of statements that are actually propositional wffs.
4. A function ƒ is recursively defined if at least one value ƒ(x) is defined in terms of another value ƒ(y), where x ≠ y.
5. A grammar is a finite set of rules, called productions, that are used to describe the strings of a language.
With respect to the above statements, select the best answer:
A. Only (5) is correct
B. All statements, (1), (2), (3), (4), and (5) are incorrect
C. Only (4) is false
D. Only (1), and (5) are incorrect
E. All statements, (1), (2), (3), (4), and (5) are correct
Problem #A8 {5}:
What is the negation of “Everybody learns something sometime.”
A.
B.
C.
D.
E.
.
Everybody learns nothing sometime
Somebody learns something all the time
Somebody learns nothing all the time
Everybody learns nothing all the time
Nobody learns everything all the times
Problem #A9 {5}:
Study the following statements as they relate to Functions and select the
best answer:
1. The floor and ceiling functions have type R  Z, where floor(x) is the closest integer less than or equal to x and ceiling(x)
is the closest integer greater than or equal to x.
2. By convention of number systems, “R” stands for real numbers, and “Z” for natural integer numbers.
3. The “mod” function is the residue of integer division.
4. The greatest common divisor, gcd(27, 15) = 5.
5. In the function, ƒ : A  B, A is called the domain and B the codomain.
A. Only (1) is correct
B. All statements, (1), (2), (3), (4), and (5) are correct
C. Only (4) is false
D. Only (1), (2), and (5) are correct
E. (2) and (4) are incorrect
Problem #A10 {5}:
Let R be a binary relation over a set A. Consider the following definitions:
1. R is reflexive means: (x, x)  R for all x  A.
2. R is antisymmetric means: x R y and y R x implies x = y for all x, y  A.
3. R is transitive means: x R y and y R z implies x R z for all x, y, z  A.
4. R is irreflexive means: x R x for all x  A.
5. R is symmetric means: x R y implies y R x for all x, y  A.
With respect to the above statements, select the best answer:
A. Only (1) is correct
B. All statements, (1), (2), (3), (4), and (5) are correct
C. Only (4) is false
D. Only (1), (2), and (3) are correct
E. (1) and (4) are incorrect
Problem #B1 {10}:
Describe in detail the characteristics of Well Formed Formulas (wffs):
Problem #B2 {5}:
Define and describe in your own words the concepts:
1. Axiom,
2. Proposition,
3. Truth Table,
4. Disjunction,
5. Hypothesis
6. Conjunction:
Problem #B3 {5}:
With respect to propositional calculus, explain the following terms (use examples where possible):
1.
Semantics
2.
Tautology
3.
Contradiction
4.
Equivalence
5.
Modus Ponens
Problem #C1 {10}:
By definition, the term “Factorial” is expressed by an exclamation mark “!”. Thus,
N! = N* (N-1)*……3*2*1
Develop a pseudocode that could evaluate this expression.
Problem #C2 {15}:
You want to develop an algorithm, A, for a Problem, P, whereby P is to find a piece of meat in a grocery store that has a
weight considerably less than indicated on the sticker of the package. The Guy from the quality assurance weighs seven
packages and finds one where the grocer has cheated on the weight.
Use the concept of decision trees to find an optimal worst-case pan-balance algorithm to detect the one bad package among
a set of seven, where the output states whether the bad package is under weight.
A Solution: