CSCD 420 Oct 21 2026
Overview
Chris Cain reports a 54% average on Exam 1, with about two-thirds of the class earning an F, and proposes more exam points based on class engagement while offering flexible office-hour support. He then works through the CYK membership algorithm on the string aabbb, showing how a Chomsky normal form grammar fills a substring table, and previews a project implementing the algorithm with cubic-time complexity.
Key takeaways
- Exam 1 averaged 54%, with about two-thirds of the class earning an F; Chris Cain plans to add future exam points in proportion to class engagement rather than change the assessed material.
- CYK requires a grammar in Chomsky normal form and decides membership by recording, for every substring, the nonterminals that can derive it.
- For substrings longer than two characters, CYK tests every possible split, combines the corresponding nonterminal sets, and unions the production matches.
- A CYK table entry is a set, so duplicate derivations do not affect the result, and the table need not store the derivation sequence when the goal is only membership testing.
- A string is accepted exactly when the start symbol appears in the cell for the entire string; in Cain's aabbb example, S appears in the final cell.
- CYK uses a quadratic-size table and checks split points for each substring, yielding cubic-time complexity and forming the basis of the course's first project.
Chapters
- Chris Cain reports a 54% class average on Exam 1, with roughly two-thirds of students receiving an F and three perfect scores, including extra credit.
- Exam scores are available during office visits, but will not be posted until the remaining student has taken the exam.
- Cain plans to increase the points available on future exams in proportion to class effort, without changing what the exams assess.
- Cain says the mismatch between submitted homework quality and Exam 1 performance suggests that homework may not be producing durable, independent problem-solving skills.
- Students can email Cain their schedules to arrange afternoon or early-morning help, or meet with Akiba when available.
- The course is moving from about six larger assignments toward roughly eight assignments, with more regular feedback before exams.
- The Cocke–Younger–Kasami (CYK) algorithm is a dynamic-programming method that tests whether a context-free grammar can produce a query string.
- Each table entry records the nonterminals that can derive the substring from position i through position j, inclusive.
- CYK requires productions in Chomsky normal form (CNF); a grammar must be converted to CNF before applying the algorithm.
- Cain uses the five-character string aabbb and arranges its substrings in a triangular table indexed from 1 to 5.
- The base row handles length-one substrings: positions 1 and 2 contain a, while positions 3 through 5 contain b.
- Each cell stores a set of nonterminals, so it can represent multiple ways for the grammar to derive the same substring.
- For each length-two substring, CYK combines the nonterminal sets for its two single-character parts and checks the resulting pairs against grammar productions.
- The substring aa has no matching production pair in Cain's example, so its table entry is empty.
- For ab, the pair AB matches productions with left-hand sides S and B; for bb, the pair BB yields A.
- A length-three substring has two possible split points, so CYK tests both a + ab and aa + b for the first three characters.
- For each split, the algorithm takes the Cartesian product of the two referenced table sets, then unions the results across split points.
- For the substring aab, the matching pair AB contributes the nonterminals S and B, while an empty component contributes no candidates.
- For a length-four substring, CYK checks three split points, including partitions of lengths 1+3, 2+2, and 3+1.
- The previously computed entries for shorter substrings are reused, avoiding repeated derivation work.
- Cain's example produces A for the substring aabb after candidate pairs from the splits are checked against the grammar.
- An entry such as N₁,₃ records which nonterminals can derive the substring in positions 1 through 3, not the specific production sequence used.
- For the full query, acceptance depends only on whether the grammar's start symbol S appears in the final table cell.
- Duplicate candidate pairs do not change an entry because CYK stores results as sets.
- The full five-character substring has four possible split points, each combining two entries already computed for shorter substrings.
- Cain finds an AB pair that matches the production for S, so S appears in the final cell and the grammar generates aabbb.
- Once S is found, the acceptance decision is established; completing every remaining candidate calculation is unnecessary.
- Cain's first project asks students to read a grammar in a specified format and a query string, build the CYK table, and report whether the grammar generates the string.
- The table has quadratic size in the string length, while considering split points adds another factor, giving CYK cubic-time complexity.
- Cain invites students to revisit the worked aabbb example and use office hours for help with indexing or table construction.
Transcript excerpt
0:02 I'm getting started. How's everybody doing? >> We'll start with a few announcements. There's homework for due tonight. And the big announcement is that exams are graded. Unfortunately, there's still one person to take the exam for extenduating circumstantial reasons. However, all right, maybe I should start with this. Should I start with the good news or the bad news? >> What do we what kind of what kind of students are we often? >> Bad news first.
0:51 >> Okay. Well, that's good because the good news is going to be a no pointer exception. the the exams were very bad. I Yeah, it's it's kind of scary just how how poorly this turned out. It's the the worst exam one I've ever had in compilers despite the fact that not a significant amount on that exam has changed over over too much time. So my my concern with that is that I can't I can't have the results that I've had stake for a long time. Like it's it's it's not it's not in a place that I can easily move forward from. So, I've come up with what I what I want
1:43 to do about it in the last day or so, which is that so I can't go over them today for that reason, but I will let you come see your score in my office. I don't want to post them on Canvas quite yet just in case there are changes that require me to go back and and do that. But the yeah, the scores will be available if you come see me. that will help you to figure out where my office is if you haven't been there before. And the the second piece of news of how I'm going to help recover from this
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Chris Cain.