comp-think/2022-2023

Lecture "Introduction to Computational Thinking", exercise 1

essepuntato opened this issue · 12 comments

What are all the possible sentences that one can produce using the regular grammar introduced in Section “Historic hero: Noam Chomsky”?

  • I write
  • I read
  • You write
  • You read

I write/ I read/ You write/ You read

Possible sentences: I write, I read, You write, You read.

  • "I" "read"
  • "I" "write"
  • "you" "read"
  • "you" "write"
  • I read
  • I write
  • You read
  • You write

I write, You write, I read, You read

  • I write
  • I read
  • You write
  • You read
  • I write
  • You write
  • I read
  • You read

I write
I read
you write
you read

i write
i read
you write
you read

The possible sentences are:

  • I write
  • I read
  • You write
  • You read

I write
You read
You write
I read