
Professor solves 240 computer science exam problems in 4 hours [video] - ryandougherty
https://www.youtube.com/watch?v=g_ZdcHSFGv0&t=10s
======
bollu
I need to defend theory of computer science here, it seems. Please note that
this computer _science_ , not computer _engineering_. The idea of automata,
regular languages, turing machines, and whatnot inform some of the most
fundamental results of computer _science_.

At least in the fields where I work [compilers, formal verification], all of
the above theory is common parlance. Everyone working on this stuff knows all
of the above theory, since it forms the bedrock of a large part of what we do
and how we think about the world. Knowing the complexity of the algorithms we
use, the languages we parse, issues of decidability, etc. all crop up. That's
because it's _science_ , not _engineering_. GATE is meant as an entrance exam
to pursue a graduate degree in computer _science_.

The fact that one does not need this during their day job is, dare I say it,
irrelevant. This feels to me like people complaining that number theory is
completely useless in the 19th century; Indeed it was... until it wasn't, and
we needed cryptography.

This stuff is useful _right now_ in a 'how to think about the world' kind of
way. Knowing the power differences between automata, transducers, push down
automata, and turing machines is critical in disparate applications involving
formal verification. The difference in power of these different
representations impacts what we can "do" with them. The knowledge of this
hierarchy fundamentally shapes how I view the world.

~~~
dazhbog
Some people are more inclined to theoretical concepts, some people are more
practical. Both have an understanding on how things work and/or an intuition,
either by studying theoretical concepts or via practical, hands on experience.

My issue with this, and this is mostly my own personal opinion, is not whether
or not this subject is important and that we need to defend it, but whether
teaching it to students of that level is the 'right' thing.

Imagine a student that doesnt even know how to program yet, doesn't know any
algorithms, or higher level paradigms, heck doesnt even know any computer
architecture stuff yet, but has to go through this block of theory and get
examined on it.. Is it the right move to motivate more people into this field?

~~~
cycrutchfield
Yeah! And why come we gots to teach kid how to plus and minus if theys just
gonna be a plummer?

~~~
zelphirkalt
I think you are not addressing the point, which the GP tried to make. It's not
about teaching or not teaching, but about the time when stuff is taught.
Surely all these things have their time and place. Perhaps there are gentler
introductions to some of these topics available?

~~~
Jtsummers
If you can't teach theoretical computer science to undergraduate computer
science students, you will have to shift it to the graduate level. Which means
you won't really every have anyone earning a true masters in computer science
because they'll need so much grounding to be able to complete the work they
won't have time to do anything novel.

------
jacquesm
Interesting how so many of these problems are probably hard for a fraction of
the people that want to pass this exam simply because of the language in which
they are expressed.

For example, and I've noticed this pattern with some regularity: large and
complex expression in a paper or some other document. Actual implementation:
one or more for loops with an add or a multiply in the body of the loop with
some initialization. I get it that mathematical notation is nice and compact
and a quick way to communicate an idea but pseudo code would quite often be
more clear.

The same for a lot of the other terminology used in the questions. How much of
studying in order to pass an exam like this is simply to cram the definition
for a large number of terms?

~~~
Kalium
That's an excellent question!

It may be worth considering that the answer may not be as significant as some
might guess. GATE is an exam that tests if you're ready for graduate school.
Part of being ready for a specialized field is being fluent in the vocabulary
and parlance used in that field, as this enables rapid learning and smooths
communication. That you can understand the ideas if they are restated and re-
expressed in a form more familiar to you is not as helpful as it sounds if you
cannot engage with your peers without laborious translations. Have you ever
tried to discuss imperative programming with someone who only knows functional
programming, or the converse?

Medical, legal, chemical, and other fields have evolved conventions of
specialized vocabulary for the same reasons. They make it possible to have
very detailed communications in dense, rapid ways.

Agian, you raise an excellent and wise point. There is definitely a great deal
of learning vocabulary in something like this.

~~~
jacquesm
But do those fields have a similar split between the language used by the
theoretical and the practical side of things?

~~~
Kalium
Generally no, because they do not have large populations of self-taught
professional practitioners who never learned theory.

Least common denominator writing is very useful for a great many things. It is
wonderful and ideally suited for items aimed at a popular audience. It just
may not always be ideal for efficient and precise technical communication.

~~~
bcrosby95
I don't really buy this. You're framing this as if people don't use this
notation because they are self taught. But I've worked in companies full of
fresh out of college people and we didn't use this notation when working on
projects. And when working on group projects in college, we didn't use it
either when discussing possible solutions. We used pseudocode.

Beyond that, I think you're selling an ideal here in these other professions
that doesn't necessarily exist. There certainly is some vocabulary overlap but
a huge problem in e.g. medicine is practicing doctors not being able to
understand the science behind medicines and procedures that biased 3rd parties
are recommending they offer to patients.

~~~
Kalium
Please accept my apologies. I can see I have been unclear.

It's been my experience that when attempting to communicate, people use the
vocabulary they expect will do the job efficiently for the task at hand. As
you say, for _many_ things this is absolutely pseudocode! But I've also been
in situations where mathematics, or the many Greek letter transformations of
Haskell, or something else was the vocabulary of choice. As the projects I've
worked on have grown more complex and occasionally abstract, pseudocode has
increasingly not been the go-to answer.

Again, you're completely right. It's a major issue that medical professionals
often lack a real understanding of how a given pharmaceutical works. It's one
that is in dire need of addressing!

I also think medical professionals have this shared assumption that they can
talk about anatomy and physical processes with one another to communicate
effectively and precisely, rather than "the bone next to the other bone next
to the chompy thing". Especially when on a chart and the other professional
isn't nearby to ask. That's shared vocabulary at work. I've certainly
struggled to have architectural discussions with people with whom I shared
little vocabulary. I'm sure the failing was entirely mine.

You're completely right. There's a lot here and pseudocode is incredibly
powerful! I find it worth considering that there might be value to be gained
in shared vocabulary beyond that one tool. Your mileage may of course vary.

Thank you kindly for the opportunity to better explain my points.

------
120bits
GATE: (Graduate Aptitude Test in Engineering. Its an entrance exam in India
for Post-Graduate admissions. Considered to be one of the toughest exams)

This bring back memories. I was preparing for GATE in 2006 after getting my
bachelors. Actually started preparing from 2004. I was so bad at Automata
Theory and discreet maths. I never got admitted to the prestigious IITs, but
that preparation and learning was helpful later in my career when I got
admitted to MS program in a US university.

------
atum47
I admit that I struggled with regular languages, I didn't fail the class or
anything, but as soon as I was done with it, never looked back.

I thought about doing a Turing machine in JavaScript but I never actually did
it.

I wonder if people that retains all that information use it everyday, that's
why they retain it. Thing I don't use in real life, like propositional logic,
regular languages, automatas... I can barely remember. It's kinda sad thought,
but I fill I cannot dedicate time and resources to keep this things fresh in
my head.

~~~
kevmo314
But despite not using it every day, you'd probably be able to refresh on it
pretty quickly.

I've found that to be the real value for a lot of the courses I took. Sure, I
don't _actively_ remember the content or use it daily, but occasionally
something reminds me of something I learned. Then, it's a quick wiki page away
from me understanding and using it. Contrast that with some devs I've worked
with who haven't seen such things before and end up reinventing a less elegant
solution to the problem.

~~~
atum47
on the interview for the job I have right now, they asked me a lot about
design patterns. I took a class on that and implemented a lot of them in Java.
Factory, Facade, Visitor, Singleton... Never used them again after college,
ask me about it, I think I would be able to explain Factory and Singleton from
the top of my head, the rest... gone!!!

I guess what I'm trying to say is that I would love to be that guy with a lot
of information in the head, that can casually drop statics formulas and math
concepts in a conversation, but that's not the case for my. At least for a lot
of topics.

Watching the videos made me think about that. Starting a live video and
answering 240 questions on several topics likes it's no big deal. Haha

~~~
valuearb
You never use a Factory or Singleton? That’s weird to me cause I use them
daily. But certainly Singletons can also be problematic, especially if you do
automated testing, which I do not.

~~~
btilly
The use case for a Singleton is that you want to use a global variable but
don't want to admit that you are using a global variable.

~~~
AnimalMuppet
Here's an embedded system. It has a hardware resource. There's only one such
hardware resource. A singleton to manage it is a natural.

I suppose you could argue that it's still a global variable, but I think it's
more fundamental than that. You use a singleton when there should be exactly
one of something. _Why_ is there exactly one? "Because there's only one in the
hardware" is a fundamentally different answer than "because it's a global
variable".

~~~
btilly
A singleton only seems natural to you because you are used to using them.

Other programmers might reach for a global variable or a static variable for
the same purpose in the same situation. The tradeoffs are pretty subtle.

However, as I said, the main reason that I have seen singletons used is
programmers who heard lectures about how bad global variables are, heard about
global variables, and didn't understand that every argument against a global
variable also applies to a singleton.

~~~
dodobirdlord
Not entirely true, because a singleton can implement defensive logic and
maintain coordination state that is difficult with a global variable. For
something like a unique hardware resource a singleton that administrates the
resource can do things like enforce queueing on components that want to
communicate with the hardware resource, and make decisions about which
components to notify when the resource responds.

~~~
btilly
I said subtle, not non-existent.

For example you tout the advantages of enforced access rules. And indeed
enforcement is good for avoiding bugs from accidental concurrent access. But
said enforcement also means that bugs in releasing access at the proper time
are harder to recover from. I've seen systems fail both ways, and it is
unclear to me which one is better. (For example I've had more problems with
Windows enforcing locking in its filesystem than with bugs in Unix's advisory
only locking policy.)

------
LockAndLol
My CS exams in Europe and Australia involved calculations, proving stuff and
applying knowledge to find the solution without a list of possible answers.
Multiple choice questions at this level have always confused me and seemed
like a really inept way of testing understanding (if they test understanding
at all).

I was fully expecting to see an implementation of a red-black tree, the use of
software patterns, questions of why a certain solution was picked or what
algorithm to pick and why, creating a circuit with logic gates that fulfill a
certain function, etc.

This all seems more like a test of memory. "Do you remember exercise XXX on
page YYY? Great, now pick the correct solution!". Him saying "I remember the
solution to this from one of my earlier videos" even confirmed my bias against
these things.

~~~
crote
Yeah, but that's much harder to grade.

The main benefit of multiple-choice is that grading is instant. There is no
ambiguity, no half points.

I completely agree that tests like this should not exist, but sadly they do.
Even in Europe bachelor's courses seem to be slowly shifting towards this.

------
ksj2114
This is an awesome video and I'd love to see more content like this. I love
watching experts explain how they think

~~~
ComputerGuru
I don’t see how anyone can both solve _and_ explain their solutions in such
record time. I can’t imagine there is much explaining happening.

~~~
freyr
Why guess about the content here? It’s freely available to watch, so we don’t
need to speculate.

He briefly explains his reasoning for each answer.

------
ianbooker
We had a quite strong formal / theoretical community in our cs department, and
besides really enjoying automaton theory in my later studies, it kind of
formed an understanding of the practical side of researching algorithmic
questions like "how to fit multiple circles into one bigger circle to maximize
their combined diameter", as a reservoir of solutions you could later abstract
your less abstract cs problems to.

------
unixhero
Great effort by the professor and a very helpful thing that he published it
all to YouTube. But to me all the content was garbled snafu.

------
forgotpwd16
That kinda answers the question many students have whether the professors can
solve the problems they put on exams in the allocated time.

~~~
btilly
The usual rule of thumb is that if the professor can do the test in 20
minutes, it is probably appropriate for an hour for the kids.

As a graduate student I found that to be true.

~~~
euler_angles
Seems like a lot of people have converged around that.

I had a professor in my undergraduate mechanical engineering classes who used
a 4x rule for his exams -- he had to be able to do it in 15 minutes, we had an
hour.

------
beefcubebrush
This man was an INCREDIBLE BOON to me when I was studying Theoretical Computer
Science just last semester. Awesome resource. Thank you Easy Theory!

He has another channel where he posts things that mainly pertain to Sipser's
Computation. You can find it here:
[https://www.youtube.com/c/RyanDougherty/videos](https://www.youtube.com/c/RyanDougherty/videos)

------
sabujp
You don't have to pass GATE in order to write a compiler, parser, etc. In fact
I'd venture to guess that many of the most famous programmers of compilers and
creators of new languages (e.g. Larry Wall) couldn't pass the GATE exam. So
don't feel bad if you don't understand any of the math, I'd rather learn by
programming and then learn the math to explain it as I go along.

~~~
danielscrubs
I’d argue that if PhDs in CS where the only ones creating compilers you’d see
less bugs and way more theoretical work being done before starting a project.
Now it’s scrum galore and everything goes.

~~~
cultofmetatron
I'd venture you'd see less bugs because there would be drastically less code
out there.

~~~
danielscrubs
Yeah, that too.

------
Syzygies
As a math professor, I'm amazed that our students learn to answer exam
questions about damped, driven systems without internalizing anything about
the idea. Now, our pandemic is a damped, driven system and no one gets it.

I love multiple choice. I aced Regents exams in high school by borrowing old
study guides to memorize the missing half of the corpus. I recently had a
great time taking the Triplebyte quiz inebriated. So I was gearing up to
trying to keep up with this guy.

Question 1, bam! B. Needs infinite memory, regularity is a finiteness
condition. I read it first because it was shortest, didn't even look at the
other choices. Show me question 2! What? He's still talking?

I understand the pumping lemma, but here it's a technical way to solve the
problem under general anesthesia. I guess math isn't alone at failing to teach
what things really mean.

I never got to question 2, I got bored.

~~~
hoten
A bit unfair to treat it as a race. He's talking through the problem for the
benefit of the audience. If he was just thinking like you were (not speaking)
I'm sure he'd go faster.

------
tazedsoul
Academia was not initially tasked with the purpose of preparing students for
careers in industry. Academic interests are purely that: academic. They serve
no intended purpose necessarily beyond their contribution to knowledge,
understanding, and often the enjoyment of academics. In some cases, there is
overlap between concepts of interest to academics and those in industry.
However, to expect an undergraduate degree in an academic discipline, such as
computer science, to prepare you for the needs of modern industry is to
confuse the priorities and values of academia and industry. You can raise the
question of, 'should this be the case?' and of course the answer will vary
across fields, academics within fields, and students too. However, I would
suggest that it may be an error to value the profit-driven needs of the
industrial world to those of the academic world, which veer closer to having a
value derived from the intrinsic nature of knowledge itself. If you want a
school to teach you how to solve problems for Google or Facebook, I don't
believe such a school should come at the cost of replacing the function and
values of academia itself; perhaps some fields/departments in academia should
extend study and degrees in the direction of industry-motivated study or new
schools should open with such a focus. But don't be confused with your
expectations that academic study should provide any tangible value in a
capitalistic world.

~~~
orange3xchicken
This is a good comment, but I suggest you make some paragraphs! It's a bit
hard to parse atm.

To add on to what you said, many academics pursue knowledge for its own sake.
In many cases, especially in theory, the value of new knowledge may not be
known at the time of its discovery.

For example, the multi armed bandit problem was formalized by Herbert Robbins
in the 50s. It was almost universal declared a negative result. Now, bandit
algorithms are classified as some of the most commercially succesful
applications of machine learning algorithms (ad placement, recommendation,
experimental design), and the corresponding techniques used in the formal
analysis of bandit algorithms are widely used in 'non-bandit' settings (see
ICML's test of time award this year).

It always saddens me to see negative comments about academics & ignorance
about 'the point' of academia.

------
kdtop
As a non-computer science person, I feel very dumb right now. :-(

~~~
racl101
As a guy who graduated in comp sci I feel even dumber right now. :(

edit: cause I don't remember much of this stuff.

~~~
hinkley
There are two big reasons you have trouble recalling a piece of information
about your craft:

You use it so much that it is down to intuition, or _you never use it at all_.

For example, my relationship to Orders of Complexity has been reduced to
sorting options in my head, and picking the first one that is simple enough to
keep working, and fast enough to satisfy the current and estimated future
scope of the problem (which is also intuitive Capacity Planning).

If you make me explain the decision it might sound like I picked one at
random.

~~~
HashBasher
You actually have sorted in your career?

~~~
hinkley
Quite a bit. Lots of data has ranks/priorities, lots of UI has to be
organized.

Are you asking if I have _written_ (shipped) a sort implementation? Only once,
ages ago. No built-in stable sort, and none of the dozen articles I found had
examples that scaled past 20 elements (which I found quite upsetting). I did
my own port of mergesort that was almost 2 orders of magnitude faster.
Constant complexity kills.

It's good to build a few on your own to become an informed consumer. Just
don't 1) ship it or 2) use it as an interview question. If you want NIH
people, you get them by asking NIH questions during the interview process.

------
_wldu
An exam was three problems, three hours, 33% of your final grade. That was my
experience in CS algorithms. Lots of students switched majors because of that
class.

------
hardwaregeek
These...don't seem that hard? I mean I just took a class on Theory of
Computation but I did pretty poorly in it and stopped paying attention when we
switched to online. Most of these seem to be CFG/RE questions with fairly
simple answers. I'd expect some more challenging stuff with constructions from
a graduate entrance exam.

~~~
hoten
I only went through the first ten or so questions so far (will do more later
cuz it's neat stuff) but yeah, all if this was covered in a single semester of
automata in my undergraduate. Although, maybe a graduate entrance exam isn't
supposed to test much more than what you learn during the course of
undergraduate classes.

------
mv4
Seeing how the top 2 comments present completely opposing views, now I just
HAVE to watch this.

------
nickysielicki
I don't mean to toot my own horn too much here but I'm ecstatic to see how
much of my cramming and memorization in college seems to have actually
crystallized. I'm doing better than I thought I would have on these as I
follow along.

------
jimhefferon
Anyone know if these questions are freely available?

~~~
har33sh
[https://gateoverflow.in/categories](https://gateoverflow.in/categories)

Questions are categorized based on the subjects, I used this while preparing
for GATE in 2015/2016.

~~~
jimhefferon
Thank you. I was unclear. I meant licensed under some Free license. (I'm
writing a _Theory of Computation_ book that is Free and incorporating some of
this material is attractive.)

The web site for IIT Delhi didn't say, that I could find.

------
juskrey
Skimming through the pages on the video, it shows vividly how far away
academia is from real life problems.

~~~
globular-toast
I guess this is a bit like the Someone Else's Problem phenomenon. Nobody needs
to know about compilers, operating systems or analysis of algorithms because
Somebody Else will deal with those things.

~~~
crote
Are they really, though?

I've followed a few courses on this, and they all focus on the mathematical
background of it. Sure, it's neat to be able to prove some stuff about a toy
language, but what does it really teach you?

"Regular expressions" in most programming languages are not regular. A lot of
programming languages aren't even context-free. Heck, C++ templates are Turing
complete! Does anyone care? Not really. It works, and unless you intentionally
abuse it, it's not even that painful to use.

Meanwhile in academia, the parser is automatically generated from its EBNF
definition using an algorithm proven to be optimal, but when you try to
compile anything containing syntax errors it's either crash, infinite loop, or
dump a completely gibberish error message.

I really get the feeling that a large part of academia is busy inventing their
own problems to solve. From my experience, they are extremely bad at teaching
how to solve real problems.

~~~
qppo
Academic research and education is normally focused on silo'd content and not
holistic system design. To use your example, a parser that gracefully handles
bad input is a completely different region of study than simple
parsing/grammars. It's outside the context.

That does not mean that academia does not cover the topic, you just probably
wouldn't get to it in an undergraduate course on (frankly trivial) compilers
and parsers. If you read into research on things like semantic fuzzing, the
slow death of batch compilers, and the various error propagation mechanisms
out there from PL researchers you'd see those topics bring up lively academic
discussions.

Academia lags in many ways behind practical designs because they aren't
governed by deadlines and market realities, but they lead in many others
precisely because ideas aren't constrained and they can focus on things that
don't have immediate value to markets. It's not wise to discount an entire
domain of expertise and culture of development just because it exists in a
different context than professional engineering, particularly when we owe our
entire industry to the efforts of academics in the first place.

------
pinacarlos90
Learning/building compilers was the most fun part of CS curriculum.

------
hawk_
what is GATE computer science?

~~~
reubenmorais
[https://en.wikipedia.org/wiki/Graduate_Aptitude_Test_in_Engi...](https://en.wikipedia.org/wiki/Graduate_Aptitude_Test_in_Engineering)

------
dazhbog
Watched a bit as I never came across these terms.. Staring at the wikipedia
page of "Regular language" and I still dont get what is the purpose of this.

Anyone, not in academia preferably, using this for practical applications?
What ARE the practical applications?

~~~
bo1024
I don't think there are a lot of direct practical applications, outside of
regular expressions for string search as others have mentioned. This is a
building block to more advanced topics, some of which have practical
applications. Theory of designing programming languages, and computational
complexity theory. For instance, these are like baby steps toward P vs NP.

~~~
dependenttypes
DFAs are used on all kind of things, including on protocol design and
implementation.

------
coderthrow
I am impressed by this, however.. is this not a case of a Human training to
act like a computer, and then doing it really well? There is something off
about that part.

~~~
yters
I haven't checked the questions carefully, but in general classifying the kind
of language I believe is undecideable, so the video could be showing a human
doing something computers in general cannot do.

~~~
jacb
It seems like a common misconception that humans have some secret power to
solve undecidable problems that computers lack. But "this problem is
undecidable in general" doesn't mean "computers cannot solve small instances
of the problem", it means "there's no single algorithm that will correctly
solve all instances of this problem". Typically undecidability results in
language theory rely on embedding a Turing machine in the language and going
"Turing machines halting is undecidable, therefore this is undecidable in
general". But this only tells you that _some_ problem instances are
undecidable (at least those that correspond to Turing machine embeddings, and
probably many more). Smaller problems (that aren't big enough to be disguised
Turing machines) can still be decidable, and I suspect that any problem simple
enough to happen in an exam is decidable.

Another example of this: theorem-proving is undecidable, yet automated thoerem
provers are definitely capable of solving simple problems. The undecidability
result means that any given automated theorem provers isn't capable of proving
the truth/falsity of all statements. But this isn't some crazy limitation -
this is true of humans as well. You can solve some math problems, but if
someone showed up with an exabyte-long statement about how a problem-solver-
who-is-identical-to-you-in-every-capability solves problems and asked you to
prove it, obviously you wouldn't be able to do that.

~~~
yters
What I said is compatible with what you say.

------
kylebenzle
Not true, he skipped a few after giving up. Title should be, Professor TRIES
to solve 240 computer science exam problems.

~~~
elygre
Didn’t watch far, but got to the point where he said there were 247 questions.
So maybe he skipped seven?

