Automata - Computability - Lecture Slide, Slides of Computer Science

Some concepts of Computability are Algorithmic Problems, Automata, Closure of Regular Languages, Computability, Free Languages, Machine Transforms, Magic Bullets, Minimization, Models of Computation, Nondeterministic Complexity. Important points in this lecture are: Automata, Languages,, Deterministic Finite Automata, Machine Dispenses, Dimes And Quarters, Correct Change, Java-Method Pseudocode, Over-Kill, Vending Machines, Possibilities Multiplicatively

Typology: Slides

2012/2013

Uploaded on 04/25/2013

rajnikanth
rajnikanth 🇮🇳

4.3

(32)

135 documents

1 / 45

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Strings, Languages, Automata
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download Automata - Computability - Lecture Slide and more Slides Computer Science in PDF only on Docsity!

Strings, Languages, Automata

Agenda

Today  Strings  Languages  Deterministic Finite Automata For next time:  Read up to 1.  Check out ABCEZ in lecture 2-4 directory.  HW 1

Vending Machine Example

Soda vend(){

int total = 0, coin; while (total != 45){ receive(coin); if ((coin==10 && total==40) ||(coin==25 && total>=25)) reject(coin); else total += coin; } return new Soda();

}

Vending Machine Example

Why was this over-kill?

Vending Machine Example

Vending Machine Example

Input: DQQD

About to put in a dime

Vending Machine Example

Input: DQQD

About to put in a quarter

Vending Machine Example

Input: DQQD

About to put in a dime

Vending Machine Example

What made this example simpler than the

Java pseudocode?

Vending Machine Example

1. Only needed two coin types “D” and

“Q” – symbols/letters in alphabet

2. Only needed 7 possible current total

amounts – states/nodes/vertices

3. Much cleaner and aesthetically

pleasing than Java lingo

Now generalize and abstractify…

Alphabets, Strings, Languages

A1: S = { D, Q }

A2:

Good: QDD, DQD, DDQ, QQQQDD, etc.

Bad: Q, D, DD, etc.

Ugly: DDD …now you’re screwed!

A3: e signifies trying to get something for

nothing (putting no money in at all).

Alphabets, Strings, Languages

DEF: The length of a string is the

number of symbols that it contains

(repetitions allowed).

Absolute values are used to denote

length.

EG: Lengths of the above good (QDD,

DQD, DDQ, QQQQDD) are: 3, 3, 3, 6

Q: What’s the length of e?

Alphabets, Strings, Languages

DEF: The concatenation of two strings is the

string resulting from putting them together

from left to right. Given strings u and v,

denote the concatenation by u  v, or just

uv.

EG: ire  land = ireland, QQ  DD = QQDD,

DDD  u is still bad, no-matter what u is!

Q1: Why the last claim?

Q2: What’s the Java equivalent of concatenation?

Q3: Find a formula for | u  v |.

Alphabets, Strings, Languages

A1: You are still screwed no matter what

combination of coins you put in.

A2: The + operator on strings.

A3: | u  v | = | u |+| v |