1 / 4

Understanding Permutations and Formal Languages: Key Concepts and Exercises

This week in CST229, we tackle the differences between permutations and unrestricted element usage. Homework #1 is due, and we will explore generating all permutations with code examples. Critical reading includes Chapters 2 and 3, covering formal language definitions, notations, and machines, while preparing for Chapter 4 next week. We will conduct in-class exercises on recursive definitions, language generation, and palindrome checks in C/C++. The need for formal languages and grammars will also be discussed, along with properties of even numbers.

hazel
Download Presentation

Understanding Permutations and Formal Languages: Key Concepts and Exercises

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CST229 Week 2 • Questions or concern? • Homework #1 due • Difference between permutation and no restrictions on using an element more than once. • Code example: Generate all permutation • Reading: Chapters 2 & 3 this week, Chapter 4 next week. • Review of main topics for this class. • Languages (formal languages) – language definitions/notations (chapters 2, 3, 4) • Machines (chapters 5, 7, 14, 15) • Grammar (chapters 12, 13) • Why the need for formal languages or grammars? • Chapter 2 – language definitions (set notation & Kleene closure) • In-Class Exercise Part a • Chapter 3 – recursive definitions • In-Class Exercise Part b & c

  2. In-Class Exercise #2 part a • Let S1 = {aa, b}, how many words of length 2 does S1* have? Length 3? Length 4? • Let S2 = {aa, aba, baa}, let L2 = S* is aabaa L2? is baaabaaaL2? is baaaaababaaaL2? • If S = {ab, bb} & T = {ab, bb, bbbb}, is S* = T*?

  3. In-Class Exercise 2 part b • Write a recursive function in C/C++ to compute if a word is a palindrome? boolisPal(char * word, .....

  4. In-Class Exercise 2 part c • Use recursive definition to show that all numbers end in the digits 0, 2, 4, 6, 8 are even

More Related