MODULES 1-3 Flashcards

Midterm Summative Assessment Reviewer

1
Q

COURSE: RECAP

Course code

A

S-CSPC327

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

COURSE: RECAP

Course title

A

Automata Theory and Formal Languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

COURSE: RECAP

Full name of the professor

A

Ms. Jennylinde R. Manaois

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

COURSE: RECAP

The course allows the students to analyze formal models in computer science, including _, _, _, _, and _.

A

regular expressions,
finite automata,
context-free grammars,
pushdown automata,
Turing machines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

COURSE: RECAP

At the end of the course, the students are expected to develop a simple _ that will check the syntax of a certain string if it is a valid string or not in a particular language.

A

compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

COURSE: RECAP

Module 1: Introduction to Computer Theory
Module 2: Regular Expression
Module 3: Finite Automata

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

MODULE 1: QUESTION

It is the study of abstract computing devices or “machines.”

A

Automata Theory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

MODULE 1: QUESTION

It is a study of mathematical model of a computer which can determine whether a particular string is in a language.

A

Automata Theory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

MODULE 1: QUESTION

It is a concept that describes how machine mimic human behavior.

A

Automata Theory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

MODULE 1: QUESTION

It is an abstract model of a digital computer.

A

Automata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

MODULE 1: INFO

Every automaton includes some essential features.
* It has mechanism for reading input.
* It is also assumed to operate in a discrete time frame.

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

MODULE 1: QUESTION

Every automaton has a mechanism for reading _.

A

input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

MODULE 1: QUESTION

An automaton is assumed to operate in a _ time frame.

A

discrete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

MODULE 1: QUESTION

It provides a model way in which computers can parse some language.

A

Automata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

MODULE 1: QUESTION

A mathematical model for a finite state machine.

A

Automata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

MODULE 1: QUESTION

It is a machine that given an input, jumps through a series of states according to a transition function that tells the automaton which state to go next given a current state and a current symbol.

A

Finite State Machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

MODULE 1: INFO

Brief History of Automata
* Alan Turing in the 1930’s introduced his abstract model – Turing Machines – that had all the capabilities of today’s computers.
* In the 1940’s and 1950’s, simpler kinds of machines, called finite automata were studied by Rabin, Scott and others.
* In the late 1950’s, Noam Chomsky introduced formal grammars representing languages accepted by abstract automata.

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

MODULE 1: QUESTION

These are the most powerful abstract machines.

A

Turing Machines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

MODULE 1: INFO

Why study Automata?

Finite Automata are useful model for many important kinds of hardware and software.

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

MODULE 1: INFO

List of Some Applications of the Concept of Finite Automata
* Software for designing and checking the behavior of digital circuits. (ex. on/off switch)
* The “lexical analyzer” of a typical compiler.
* Software for scanning large bodies of text, such as collections of Web pages, to find occurrences of words, phrases, or other patterns.
* Software for verifying systems of all types that have a finite number of distinct states.

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

MODULE 1: INFO

There are important notations that are not automaton-like, but play an important role in the study of automata and their application.
1. Grammars
2. Regular Expression

A

Noted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

MODULE 1: RECAP

Automaton-like formal models in Computer Science

A

Finite Automata, Pushdown Automata, and the Turing machines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

MODULE 1: RECAP

Non-automaton-like formal models in Computer Science

A

Grammars and Regular Expression

24
Q

MODULE 1: QUESTION

These are useful models when designing software that processes data with a recursive structure.

A

Grammars

The best known example is a parser – the component of a compiler that deals with recursively nested features of the typical programming languages.

25
Q

MODULE 1: QUESTION

The component of a compiler that deals with recursively nested features of the typical programming languages.

A

parser

The best known example of Grammars.

26
Q

MODULE 1: QUESTION

This denotes the structure of data, especially text strings.

A

Regular Expression

27
Q

MODULE 1: INFO

Introduction to Computer Theory Summary
* Core mathematics of CS (not changed in over 30 years)
* Many applications, especially in design f compilers and programming languages
* To be able to recognize incomputable and intractable problems
* In order to be computer scientist, not simply a computer programmer

A

Noted

28
Q

MODULE 1: QUESTION

_ is any finite set of symbols.

A

Alphabet (∑)

Common alphabets include:
1. ∑ = { 0,1 } - binary alphabet
2. ∑ = { a,b, …., z } - the set of all lowercase letters
3. The set of all ASCII characters, or the set of all printable ASCII characters.

29
Q

MODULE 1: RECAP

A symbol that denotes alphabets

A

30
Q

MODULE 1: QUESTION

_ is a finite sequence of symbols from some alphabet.

A

String ( Word )

e.g. aba, 01001

31
Q

MODULE 1: QUESTION

The empty string with zero occurrences
of symbols is denoted by _.

A

Λ

32
Q

MODULE 1: QUESTION

It is the number of positions for symbols in the string.

A

String length

33
Q

MODULE 1: QUESTION

String length is denoted by _

A

|string|

e.g. |0110| = 4, |Λ| = 0

34
Q

MODULE 1: INFO

Powers of an alphabet ∑ is defined as the set of strings of length k and denoted by ∑^k.

k - length of string

A

Noted

35
Q

MODULE 1: QUESTION

The set of all strings over an alphabet ∑ is denoted by _

A

∑*

Alphabet symbol with Kleene Closure

∑* = ∑0  ∑1  ∑2  ….

36
Q

MODULE 1: QUESTION

The set of nonempty strings over ∑ is denoted by _.

A

∑+

Alphabet symbol with Positive Closure

37
Q

MODULE 1: INFO

String Concatenation
if x and y are strings then xy denotes the concatenation of x and y.

A

Noted

38
Q

MODULE 1: QUESTION

It is the set of strings ( words ) chosen from some alphabet

A

Language

The language may be infinite, but there is some finite set of symbols of which all its strings are composed.

39
Q

MODULE 1: QUESTION

This denotes the empty language over any alphabet.

A

A symbol resembling a stop sign, but with a longer horizontal line extending from right to left across its center.

40
Q

MODULE 1: QUESTION

It is the symbol of the language consisting of only the empty string.

A

{ Λ }

An upside down V inside the curly braces.

41
Q

MODULE 1: INFO

Note that { Λ } ≠  (empty language)
The former has one string, the latter has no strings.

A

Noted

42
Q

MODULE 1: INFO

Some examples of Languages
1. The set of all binary strings consisting of some number of 0’s followed by an equal number of 1’s
2. The language of all strings consisting of n 0’s followed by n 1’s, for some n ≥ 0
3. The set of compilable C programs
4. English words

A

Noted

43
Q

MODULE 1: INFO

“Set-former” as a Way to Define Languages:
{w|something about w }

1. {w | w consists of an equal number of 0’s and 1’s} (*)
2. {w | w is syntactically correct C program}
3. {w | w is a set of words built according to the rules
of English grammar}
4. {0^n1^n | n ≥ 0}

A

Noted

44
Q

MODULE 2: QUESTION

It is a sequence of pattern that defines a string.

A

Regular Expression

45
Q

MODULE 2: QUESTION

These are used to match character combinations in strings.

A

Regular Expression

46
Q

MODULE 2: QUESTION

String searching algorithm used this pattern to find the operations on a string.

A

Regular Expression

47
Q

MODULE 2: QUESTION

It is the most effective way to represent any language.

A

Regular Expression

48
Q

MODULE 2: INFO

The symbols that appear in regular expressions are the letters of the alphabet (Σ), the symbol for the null string (Λ), parentheses (), the star operator (*), and the plus (or) sign (+).

A

Noted

49
Q

MODULE 2: INFO

The set of regular expressions is defined by the following rules:

Rule 1: Every letter of Σ can be made into a regular expression by writing it in boldface; Λ is a regular expression.

Rule 2: If r1, and r2 are regular expressions, then so are:
1. (rl)
2. r1r2
3. r 1 + r 2
4. rl*

Rule 3: Nothing else is a regular expression.

A

Noted

50
Q

MODULE 2: INFO

The various operations on regular language are:

Union: If L and M are two regular languages then their union L U M is also a union.
1. L U M = {s | s is in L or s is in M}

Intersection: If L and M are two regular languages then their intersection is also an intersection.
1. L ⋂ M = {st | s is in L and t is in M}

Kleene closure: If L is a regular language then its Kleene closure L1* will also be a regular language.
1. L* = Zero or more occurrence of language L

A

Noted

51
Q

MODULE 2: INFO

Some RE Examples:

Regular Expression | Regular Set

(0+10*) | L= { 0, 1, 10, 100, 1000, 10000, … }

(0* 1 0*) | L= {1, 01, 10, 010, 0010, …}

(0+ε)(1+ Λ) | L= {Λ0, 1, 01}

(a+b)* | Set of strings of a’s and b’s of any length including the null string. So L= { ε, a, b, aa, ab, bb, ba, aaa, …}

(a+b)*abb | Set of strings of a’s and b’s ending with the string abb. So L = {abb, aabb, babb, aaabb, ababb, …}

(11)* | Set consisting of even number of 1’s including empty string

A

Noted

52
Q

MODULE 3: QUESTION

It is the simplest abstract machine to recognize patterns with input taken from the given alphabet.

A

Finite Automata (FA)

The job of an FA is to accept or reject an input depending on whether the pattern defined by the FA occurs in the input.

53
Q

MODULE 3: QUESTION

Its job is to accept or reject an input depending on whether the pattern defined by this occurs in the input.

A

Finite Automata (FA)

54
Q

MODULE 3: INFO

A finite automaton is a collection of three things:
1. A finite set of states, one of which is designated as the initial state, called the start state, and some of which are designated as final states.
2. An alphabet Σ of possible input letters, from which are formed strings, that are to be read one letter at a time.
3. A finite set of transitions that tell for each state and for each letter of the input alphabet which state to go to next.

A

Noted

55
Q

MODULE 3: QUESTION

What are the two types of Finite Automaton?

A
  1. Deterministic Finite Automaton (DFA)
  2. Non-deterministic Finite Automaton (NDFA/NFA)
56
Q

MODULE 3: INFO

DETERMINISTIC FINITE AUTOMATA

  • In a DFA, for a particular input character, the machine goes to one state only. A transition function is defined on every state for every input symbol. Also in DFA null (Λ) move is not allowed, i.e., DFA cannot change state without any input character.
  • For example, below DFA with Σ = {a, b} accepts all strings starting with either a or b.

NOTE:
* There can be many possible DFAs for a pattern.
* A DFA with minimum number of states is generally preferred.

See presentation for examples

A

Noted

57
Q

MODULE 3: INFO

NON-DETERMINISTIC FINITE AUTOMATA (NFA)

NFA is similar to DFA except following additional features:

  1. Null (Λ) move is allowed i.e., it can move forward without reading symbols.
  2. Ability to transmit to any number of states for a particular input. However, these above features don’t add any power to NFA. If we compare both in terms of power, both are equivalent.

See presentation for examples

A

Noted