Discrete Mathematics Essay

953 Words Jul 30th, 2014 4 Pages
Phase 5 Individual Project
Math 203

Part I: Look up a roulette wheel diagram. The following sets are defined:
A = the set of red numbers
B = the set of black numbers
C = the set of green numbers
D = the set of even numbers
E = the set of odd numbers
F = {1,2,3,4,5,6,7,8,9,10,11,12}
AUB- {All BLACK and RED numbers}
A∩D- {All numbers that are both RED and EVEN}
B∩C- {NO numbers intersect between these two sets}
CUE- {All ODD numbers and 00, 0}
B∩F- {2,4,6,10,11}
E∩F- {1,3,5,7,9,11}
Part II: The implementation of the program that runs the game involves testing. One of the necessary tests is to see if the simulated spins are random. Create an n-ary relation, in
…show more content…
The gate has two states: LOCKED and UNLOCKED. It also has two inputs: TOKEN and PUSH. When the gate is locked, pushing the arm of the gate has no effect regardless of how many times it is pushed. The input TOKEN changes the state from LOCKED to UNLOCKED. When the gate is in the UNLOCKED state, inserting additional tokens has no effect on the state. But when in the UNLOCKED state, a PUSH input changes the state to LOCKED.
(i). Provide a transition table showing each state, the inputs, and the resulting new states for each input

(ii). Represent your transition table into a digraph (transition diagram)

(2) Here is a context-free grammar that can be used to generate algebraic expressions via the arithmetic operators (addition, subtraction, multiplication, and division), in the variables p, q, and r. The letter E stands for expression:
Rule 1: E —› p
Rule 2: E —› q
Rule 3: E —› r
Rule 4: E —› E + E
Rule 5: E —› E – E
Rule 6: E —› E X E
Rule 7: E —› E/E
Rule 8: E —›(E)
(i). Use the above grammar to derive the string given by the mathematical expression E = (p + q) X p – r X p/(q + q)
E * E
E * E * E
E * E * E/E
(E) * E * E/E
(E + E) * E * E/E
(P+E) * E * E /E
(P + Q) * E * E/E
(P +Q) * (E0 * E/E
(P + Q) * (E - E) * E/E
(P + Q) * (P - R) * E/E
(P + Q) * (P - R) * P/E
(P + Q) * (P - R) * P/(E + E)
(P + Q) * (P - R) * P/(Q + E)
(P + Q) * (P - R) * P/(Q + Q)
(ii.) Provide a Parse tree for the derivation.

Related Documents