<p>My course takes this approach.  I have the students create a DFA and an NFA runner, and later, a TM runner as well.  We skip PDAs - they turned out to be monstrously difficult for the students to deal with. It turns out that implementing nondeterministic stacks is just a bit too abstractly difficult for many of my students.</p>
<p>I will give you warning of a few traps:</p>
<ol>
<li>Many students don't think to test the smallest possible machines (e.g. one state, either as accept or not)</li>
<li>NFAs are harder than they sound.  I specify a maximum depth (such as 50 rounds) to prevent infinite looping on epsilons.</li>
<li>Turing Machines are relatively easy to code up. What's nice is to give them something to actually code up on them. I've created a little competition, which I've <a href="https://cseducators.stackexchange.com/a/7683/27">earlier outlined here</a>.</li>
</ol>

CC BY-SA 4.0
2023-05-22T11:43:41.693Z
Thanks for sharing. Do you use any automated grading system for the submissions?
Drimades Boy
CC BY-SA 4.0
2023-05-22T12:05:06.490Z
@DrimadesBoy They're console programs, so not really, though I do have both lab writeups and test cases that I wouldn't mind sharing with another instructor if there were a way to reach each other off network.
Ben I.
CC BY-SA 4.0
2023-05-22T17:37:29.340Z
I would love to take a look drimades77(at)gmail.com. Thank you!
Drimades Boy
CC BY-SA 4.0
2023-05-21T19:25:59.713Z
2023-05-22T14:39:19.673Z
2023-05-22T14:39:19.673Z
Ben I.
<p>I am scheduled to teach a &quot;Computer Science Theory&quot; course. Topics include: Turing Machines, Languages, Automata (DFA, NFA), etc. I would like to make it less boring and more practical for students. My idea is to add some coding assignments where students are required to program (Python, Java) some of the machines used in the course. Some hints/suggestions/materials would be very useful and appreciated. Does anyone have such experience or do you know of any course applying similar approach?</p>

<computational-thinking><cs-theory><turing-machines>
Any experience/resources on teaching computer science theory with a practical approach?
# Any experience/resources on teaching computer science theory with a practical approach?

(Asked by: username_0 on 2023-05-21)

I am scheduled to teach a "Computer Science Theory" course. Topics include: Turing Machines, Languages, Automata (DFA, NFA), etc. I would like to make it less boring and more practical for students. My idea is to add some coding assignments where students are required to program (Python, Java) some of the machines used in the course. Some hints/suggestions/materials would be very useful and appreciated. Does anyone have such experience or do you know of any course applying similar approach?

**Tags:** computational-thinking, cs-theory, turing-machines


---

## 1 answers

### Answer by username_1 on 2023-05-21. Score: 3

My course takes this approach. I have the students create a DFA and an NFA runner, and later, a TM runner as well. We skip PDAs - they turned out to be monstrously difficult for the students to deal with. It turns out that implementing nondeterministic stacks is just a bit too abstractly difficult for many of my students.

I will give you warning of a few traps:

1. Many students don't think to test the smallest possible machines (e.g. one state, either as accept or not)
2. NFAs are harder than they sound. I specify a maximum depth (such as 50 rounds) to prevent infinite looping on epsilons.
3. Turing Machines are relatively easy to code up. What's nice is to give them something to actually code up on them. I've created a little competition, which I've [earlier outlined here](https://cseducators.stackexchange.com/a/7683/27).

> **Comments:**
> **username_0**: Thanks for sharing. Do you use any automated grading system for the submissions?  
> **username_1**: @DrimadesBoy They're console programs, so not really, though I do have both lab writeups and test cases that I wouldn't mind sharing with another instructor if there were a way to reach each other off network.  
> **username_0**: I would love to take a look drimades77(at)gmail.com. Thank you!  

---

