Automata theory, grammars and languages ip

Assignment Help Basic Computer Science
Reference no: EM13960961

Automata Theory, Grammars and Languages IP

Task Background: This assignment involves solving problems by using various discrete techniques to model the problems at hand. Quite often, these models form the foundations for writing computer programming code that automate the tasks. To carry out these tasks effectively, a working knowledge of sets, relations, graphs, finite automata structures and Grammars is necessary.
Part I: Set Theory

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}
From these, determine each of the following:

A∪B
A∩D
B∩C
C∪E
B∩F
E∩F
Part II: Relations, Functions, and Sequences

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 table form, that depicts possible results of 10 trials of the game. Include the following results of the game:

Number
Color
Odd or even (note: 0 and 00 are considered neither even nor odd.)
Also include a primary key. What is the value of n in this n-ary relation?

Part III: Graphs and Trees

Create a tree that models the following scenario. A player decides to play a maximum of 4 times, betting on red each time. The player will quit after losing twice. In the tree, any possible last plays will be an ending point of the tree. Branches of the tree should indicate the winning or losing, and how that affects whether a new play is made.

Part IV: Automata Theory, Grammars and Languages (There are 2 questions for this part)

(1) A gate with three rotating arms at waist height is used to control access to a subway in New York city. Initially, the arms of the gate are locked preventing customers from passing through. Unlocking the arms requires depositing a token in a slot, which allows the arms to rotate to a complete turn which allows one customer to push through and enter. Once the customer passes through the arms are then locked again until another customer deposits another token in the slot.

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)

(ii). Provide a parse tree for this derivation.

Reference no: EM13960961

Questions Cloud

Automata theory involves the study of mathematical objects : Automata theory involves the study of mathematical objects called automata and the computational problems that can be solved using them. Context-free grammar provides us with mathematical techniques of building phases in a language from other bloc..
Disadvantages of having an employer draw attention : What are advantages and disadvantages of having an employer draw attention to situations where employees use some of their work time to do non job related activities
Apply the 1st law of thermodynamics to the resistor : A 100 ohm resistor is immersed in a constant temp bath at 300 K. A current of 10 amps flows through the resistor and a steady state is achieved
Using electronic health records vs. traditional paper : Discuss some of the advantages AND disadvantages of using electronic health records vs. traditional paper charts in a medical office. Think about this from a health professional's perspective (in terms of cost, ease of use, accessibility of patient i..
Automata theory, grammars and languages ip : Task Background: This assignment involves solving problems by using various discrete techniques to model the problems at hand. Quite often, these models form the foundations for writing computer programming code that automate the tasks. To carry ..
Find the planned order releases for all items : One unit of A is composed of two units of B and three units of C. Each B is composed of one unit of F. C is made of one unit of D, one unit of E, and two units of F. Items A, B, C, and D have 20, 50, 60, and 25 units of on-hand inventory, respectivel..
What is the final temperature of the aluminum : A hand help shopping basket 62.0 cm long has a 1.81 kg carton of milk at one end, and a 0.722 kg box of cereal at the other end. Where should a 1.80 kg container of orange juice be placed so that the basket balances at its center?
The materials with the lowest resistance are called : An electron is moved from point A to point B along an equipotential surface.
What is annual inventory holding cost-annual ordering cost : Ross White’s machine shop uses 2,500 brackets during the course of a year, and this usage is relatively constant throughout the year. These brackets are purchased from a supplier 100 miles away for $19 each, and the lead time is 4 days. What is the a..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Refuses to comply with walmart''s request

Express you personal opinion in the essay below and answer the following questions and put them in the last paragraph and put  it in order or by number.1)  If a vendor or company refuses to comply with Walmart's request, is there anything Walmart?2) ..

  Difference between a business case and a business plan

Define Business Case and explain the difference between a Business Case and a Business Plan.

  Individual traffic light has at least three states (g.y,r)

Consider a traffic light system at a four-way crossroads (two roads intersecting at right angles) with a countdown timer, a crosswalk button, and a speaker that announces it's ok or not ok to walk

  Multitasking operating system

You are testing out a new multitasking operating system. In your testing, you find that some applications are not getting sufficient CPU time while others are getting more than necessary. Which component is likely to be the cause of this problem?

  Integration layers

Integration layers

  Write a java application that inputs three integers

Write a Java application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers. Use a Scanner object to get the input from the user.

  Circut which detects even parity

Consider the following circuit, which detects even parity. There are one output, even, and three inputs, a(2), a(l) and a(0), which are grouped as a vector or bus. The output is asserted when there are even numbers (i.e., 0 or 2) of 1s from the in..

  How many pages does a process have

A machine has a 32 bit virtual address space and a 16kb page size. It has 1gb of physical memory. How many pages does a process have? How many bytes are needed for a page table, assuming 4 control bits and that disk addresses are stored elsewhere?

  The style rule below gives a monochrome colour scheme

The style rule below gives a monochrome colour scheme? body{ background-color: hsl(0,50%,75%); color: hsl{1,50%,25%);} a)true b)false 16. In class, we saw dark blue is specified by #000055, Suppose Css4 will offer colour specification using a base-12..

  Java program that displays do java

Write a Java program that displays DO JAVA as following pattern: Hint: You may need to use the System.out.println() function. Use one vertical space between two letters in a word and two vertical spaces between two words (i.e., DO and JAVA).

  Why is the formulation of the rto and rpo

Why is the formulation of the RTO and RPO a trade-off process?

  Identify tactical

Conduct research to find examples of the differences between I.T. security controls and countermeasure gap analysis, and identify tactical, strategic, risk mitigation, threats, and vulnerability dimensions and gaps associated with compliance recom..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd