Theory of Computation was one of the most challenging but also the most fascinating courses I have ever done. It's like a theory on how computer "computes" and what computers can and cannot do.
@@jaydeep-p My Compilers and Assemblers class, along with Data Structures, were what I used the most in a 30 year career in IT. What I used the least, as in never, were Calculus, Differential Equations, Linear Algebra, and Complexity Theory.
@@jaydeep-p Depends what field you go into. If you want to write text parsers, theorise and plan regular expressions or even create programming languages/compilers then all of this is very useful
The first time our computing professor showed this in C literally heaven's door opened for me lol It was magical and it has helped me so many times through the years, writing regular expression parsers at work, simplifying state machines, even in the Advent of Code competence I've solved several problems by building a state machine (like one for a "sokoban"-similar situation). 8:13 Python indentation 🤦♂
@@100c0c Healthcare software, EMR. Back when I started in early 2000 I had to write regular expression parsers to parse different document formats by different companies to import data from other EMR, billing software, healthcare hardware, etc. With time everything standardized into HL7 version 2.x and now C-CDA so parsers are no longer necessary.
Рік тому+29
as a fellow German, I always kind of hoped, if I'd tried just hard enough maybe some day it wouldn't be so obvious, where I am from... guess I can take that off my list of things ever to achieve.
Python can use any Unicode symbols of a written language for variable names, that is to say in general symbols which represent "letters" (for some expanded definition of the term "letters"). Therefore if you use the actual Greek letters in Python, and not some mathematical specific versions of them, it is valid Python, e.g.: class Foo: def __init__(self, Δ): self.Δ = Δ
"b", "bbbb", etc. would also return true. I.e. it doesn't satisfy L={words where as come before bs}. It's more like L={words where 'a's don't come after 'b's}
Logically the same thing. The contrapositive is always true. Your restatement is logically equivalent. Saying "words where as come before bs" does not entail the presence or absence of as, just that if there are as they come before bs.
Learning Automata next? Love seeing some computational theory. Makes me want to dust off my undergrad books. I guess if I wanted an automata review I could knock on my office neighbors door since he worked with Thathachar in the 80's, but there's just something about that Computerphile charm that's kept me hooked from undergrad to faculty :) (well, maybe just Numberphile at the start)
One of his students being taught the module hes literally describing. Very good content if you want to learn how compilers and programming languages work
Finally a computerphile video I can get my hands in!! Your implementation is nice from a pedagogical perspective. No complaints. But I would like to give a more mathematical perspective. Without initial and final states, automata are the same as "transformation semigroups" that are a generalisation,so to say,of permutation groups. So the only thing you need to encode are the letters as functions from Q to Q, the set of states. If you give to each state a natural number (beginning with 0) a function can be encoded in a list F, where F(i) is just the element in the position i of the list. A little word can allow you to compose functions F and G. And voilà! An automaton is just a list of same length lists. Do you want to recognise languages? No problem. Specify the index of q0 and the set of final states and after applying the word (composing the functions) you check if position q0 is in the final states set. Easy and fast. Sorry for 1. The long answer just talking about something tangential to the video. 2. If you knew this. 3. If I didn't explain myself well enough. I hope to all computer scientists who are interested in automata and don't know about semigroups that they find a lot of answers on that wild untamed territory.
> So the only thing you need to encode are the letters as functions from Q to Q, the set of states. I'm fairly sure this is true and well known for deterministic Turing machines, and so for DFAs as well
How do these videos always get timed so we'll? I'm literally working on a class project doing exactly this. With the addition of providing a GUI representation for the FA.
I remember doing my Automatentheorie class online and it was somewhat troublesome. But across a few other classes, I got most fundamentals of formal languages. It does help to have seen most of this, now where I actually get to use lexers and tree parsers etc. I was close to writing a term paper on subsets of DFAs (or even PDA) for example those you can minimize, those with exactly one state, those in some normal form etc. But bailed on that eventually.
Instead of the while loop in the run function, it would be better to just loop over each symbol with a simple for loop. Then, w = w[1:] would not be needed anymore (does an unnecessary copy).
True. Trimming the beginning of w at each iteration is just confusing. And besides occupying more space for the word copy, it also runs in quadratic time instead of linear time..!! Really strange choice of implementation....
@@haibrenner IIRC, Python string slices share memory (which you can't tell because strings are immutable), so it's really just iterating starting locations through the string without copying anything. Still, it's harder to follow than "for s in w", which makes it obvious that the algorithm never looks ahead or back or jumps over anything.
@@haibrenner I'm guessing he just didn't realize that strings are iterable like lists. It's a fairly unusual functionality for a programming language, no?
Probably doesn't matter due to compiler/interpreter optimizations. There's no better if you didn't profile it. Seems like a premature optimization. Also there is probably no copy, just a reference which may already exist. So not even the reference itself may be stored.
In software engineering and computer science, anything that parses input is a finite state automaton. Most importantly, a compiler is a finite state machine for parsing code, turning it into machine code or byte-code. Or even a scientific calculator. In other types of engineering, the finite element models that are used to model aerodynamics and hydrodynamics (for anything that moves), static forces (for anything that doesn’t) or project management (for a surprising amount of the work engineers do) relies on software that was compiled, and often includes their own scripting languages that must be parsed.
That's one really strange way to iterate over the string 😕Why constantly truncate the string and get its 0'th element? Much better and cleaner is: ....for letter in w: ........q = self.delta[(q, letter)]
I enjoyed learning this method much more with a mathematical approach instead of arbitrary languages. The easy one being whether or not a binary number was even. The initial state of 0 was the final state. The input sent to the matching state (so a 0 would send it to state 0, no matter which state it was in, and 1 sent it to state 1, no matter which state it was in).
DFA, is an abstract way of solving a problem without using a full turing machine. For example, instead of needing a computer to run the logic of your toaster, you can design a toaster's logic that is similar to a DFA. Basically reducing the complexity.
In olden golden times state machines was the only way to build large software systems safely. A "process" needs lots of memory and power and has many weird issues. They went to the moon on a state machine.
Regular expressions are equivalent to DFAa. Every time you write an RE, you are really building a DFA. Network protocols are DFAs. Traffic lights are DFAs. ATMs are DFAs. A lot of software applications can be defined as finite sets of states, meaning it would be easy to implement them as simple languages, but because that doesn't pull in thousands of NPM packages from GitHub, it is rarely done.
I think it's much clearer with these variable names. And there's a little less code with the dataclass: @dataclass class DFA: set_of_states: set set_of_symbols: set transition_map: dict initial_state: int set_of_final_states: set def run(self, symbols): current_state = self.initial_state while symbols != "": current_state = self.transition_map[ (current_state, symbols[0]) ] symbols = symbols[1:] return current_state in self.set_of_final_states
I'm taking this class right now and I have my first test in two weeks. I'm scaring of failing. My professor is a very though grader. Any tips on how to prepare as best as I can?
Why not defining the final state, as „own state“ in the graph? I.e., arrow to state 3; end. Also why not stop immediately when reaching state 2, the invalid state?
There is no seperate end state because states 0 and 1 could be ends or transitions. So moving in and out of a state3 would complicate the rules. In this specific case, you could just end when state 2 is reached but I suspect it's there to simplify the evaluation code.
is this an automaton in the sense that it's a set of rules that determine the "evolution" of whether a word is or is not valid? i'm only used to seeing cellular automata like conway's game of life
It determines acceptance of a subset of all the possible words that can be made up by a set of symbols (a language) and in this case proves that that language is "regular", which is one of the language classes in the Chomsky hierarchy, which you can look up a picture of. So this class of automata not only determines the "evolution" of validity for a given word but also provides a process to construct the set of all accepted words.
Also note it is a one-to-many relationship so multiple automata can correspond to the same regular language, which you can visualize by just adding random empty states that have no functionality to your automata.
Question, if the rule is "words where As come before Bs", how can epsilon (empty word) be ok? There's neither an A nor any B so it doesn't satisfy the rule. Not?
@@mad_vegan > When you take the last character out, it becomes an empty string, not the object None It doesn't, though. If w is set to "hello world", then it will still be "hello world" after iteration is finished, it won't "become an empty string" somehow. Same goes for iterating variable c (in "for c in w" line): after the loop is finished, it will hold the value "d" in this case, not an empty string. Try this: ....for c in "hello world": ........pass ....print(c) You'll see "d" printed out after iteration.
@K My comment was referring to the while loop, where you slice the string each loop. If you use the for loop, then you don't need (and shouldn't do) slicing.
@@mad_vegan Yeah, I commented about that too (it's one really strange way to iterate over the string - with a while loop and slicing). Just pointed out some minor detail in your comment.
The elements in a set have no particular order if an order relation is not defined, and sets usually don’t have duplicate elements (otherwise you are looking at “multi-sets” that usually have a specific purpose, for example in combinatorics). A set of symbols is called an alphabet and words are sequences of symbols taken from an alphabet: for example we could have the alphabet (set of symbols) {a,b,c} and a word (sequence of symbols) “cca” that would be different from “acc” even though the characters are the same (so you can see the intuitive difference between set and sequence). Hope it helps, and yeah I was bored :)
@@beatmapgz so when I use a list in Python it's actually a sequence (since order matters) and the set that sequence comes from is all possible values for all possible types in Python?
@@versacebroccoli7238 Yes, a list in Python is a sequence. The list's "alphabet" is every object currently defined in your Python interpreter (a type is also an object). However, you can dynamically extend this alphabet, e.g., through creating new values from the primitive data types (int/float/str). Hence, your alphabet is uncountably infinite.
Thanks for the video. I'd have more explicitly stated the rules for the example dictionary; where -ALL- a's come before -ANY- b's. Otherwise, you could read it like so; where -SOME- a's come before b's, which renders aba a valid word.
Hi, guys! Thanks a lot for the content you are producing. Can you, please, help us understand how Fast-Flux works? I saw the video explanation of this concept is scarce, it might be an interesting security topic. :)
6:00 Please tell this learned professor that PEP-8 is a thing; spaces after commas. Computer languages are a standard, only some of those standards are enforced by the compiler but we're still subject to them because they're a good thing. Also, come on, this is too simple to justify complicated words. Also also, to anyone that has had to write complicated regex expressions and refused to learn any more than they needed for the exact use case, I feel you.
Computer scientists typically don't pay attention to code beauty / readability, so they ignore PEP-8. It's okay though, their main focus is research, they work with *ideas*, not with the code, so code doesn't really concern them as long as it just works.
in the automata described, abb would pass. This is because it satisfies that all a's are before all b's. This works for "a" and {epsilon} too because a is still before all b's even if none exist and epsilon is empty thus there is no scenario where a's come after b's, thus it holds.
I love computerphile but would appreciate if the videos would be more concise. Also the code is very verbose. I would appreciate something like def run(state, delta, final, word): while word: symbol, *word = word state = delta[(state, symbol)] return state in final delta = {(0,"a"):0, (1, "a"):2, (2,"a"):2, (0,"b"):1, (1, "b"):1, (2, "b"):2 } run(0, delta, (0,1), "aab")
Theory of Computation was one of the most challenging but also the most fascinating courses I have ever done. It's like a theory on how computer "computes" and what computers can and cannot do.
Yay a Professor Altenkirch video, by far my favourite.
Studying formal language theory right now in undergrad to prepare for compiler theory. It's a fun subject
It's not very fun considering that you have to learn something that you will probably never need to use in real life applications.
@@jaydeep-p RE's are used everywhere
Fun is one way to put it
@@jaydeep-p My Compilers and Assemblers class, along with Data Structures, were what I used the most in a 30 year career in IT. What I used the least, as in never, were Calculus, Differential Equations, Linear Algebra, and Complexity Theory.
@@jaydeep-p Depends what field you go into. If you want to write text parsers, theorise and plan regular expressions or even create programming languages/compilers then all of this is very useful
The first time our computing professor showed this in C literally heaven's door opened for me lol It was magical and it has helped me so many times through the years, writing regular expression parsers at work, simplifying state machines, even in the Advent of Code competence I've solved several problems by building a state machine (like one for a "sokoban"-similar situation).
8:13 Python indentation 🤦♂
What specific type of programming do you do?
@@100c0c Healthcare software, EMR. Back when I started in early 2000 I had to write regular expression parsers to parse different document formats by different companies to import data from other EMR, billing software, healthcare hardware, etc. With time everything standardized into HL7 version 2.x and now C-CDA so parsers are no longer necessary.
as a fellow German, I always kind of hoped, if I'd tried just hard enough maybe some day it wouldn't be so obvious, where I am from... guess I can take that off my list of things ever to achieve.
We will always be known as "ze Germans" from this point on 🤣
Python can use any Unicode symbols of a written language for variable names, that is to say in general symbols which represent "letters" (for some expanded definition of the term "letters"). Therefore if you use the actual Greek letters in Python, and not some mathematical specific versions of them, it is valid Python, e.g.:
class Foo:
def __init__(self, Δ):
self.Δ = Δ
A better solution is to use words rather than symbols. delta -- transitons, Sigma -- symbols, Q -- states, q0 -- start_state, F -- final_states
Wow had no idea, thanks!
"b", "bbbb", etc. would also return true.
I.e. it doesn't satisfy L={words where as come before bs}.
It's more like L={words where 'a's don't come after 'b's}
Logically the same thing. The contrapositive is always true. Your restatement is logically equivalent. Saying "words where as come before bs" does not entail the presence or absence of as, just that if there are as they come before bs.
@@robertkelleher1850 fine.. natural language is poor for logical statements. Main point was that there were no test cases for "b"s only.
Learning Automata next? Love seeing some computational theory. Makes me want to dust off my undergrad books. I guess if I wanted an automata review I could knock on my office neighbors door since he worked with Thathachar in the 80's, but there's just something about that Computerphile charm that's kept me hooked from undergrad to faculty :) (well, maybe just Numberphile at the start)
Wow I never knew the train driver from Matrix was real
i looked after this comment xD
You'll soon start to believe
He's 100x smarter than your judgmental short sighted narcissistic comment posting pathetic self. 😂
💀
Exactly i was thinking the same !! , he escaped the matrix apparently
Currently working on a query language using NFAs. Funny to see this video pop up! Really enjoyable
Google is always listening, yr search and browsing history likely inform them of your info needs.
5:02 "So I've lost." And then looking at Shawn, as if he sees the mushroom cloud xD
Dammn we missed this man
Study computer science at the university of Nottingham! You'll see him a LOT during your second year
I love finite state automata! Excellent video. Prof Altenkirch is brilliant and perfectly fits comp sci professor archetype.
Perfectly?
@@NewtonMD The archetype, a highly intelligent person with diverse interests and an individualistic, unconventional sense of self.
One of his students being taught the module hes literally describing. Very good content if you want to learn how compilers and programming languages work
Finally a computerphile video I can get my hands in!!
Your implementation is nice from a pedagogical perspective. No complaints.
But I would like to give a more mathematical perspective.
Without initial and final states, automata are the same as "transformation semigroups" that are a generalisation,so to say,of permutation groups. So the only thing you need to encode are the letters as functions from Q to Q, the set of states.
If you give to each state a natural number (beginning with 0) a function can be encoded in a list F, where F(i) is just the element in the position i of the list. A little word can allow you to compose functions F and G. And voilà! An automaton is just a list of same length lists.
Do you want to recognise languages? No problem. Specify the index of q0 and the set of final states and after applying the word (composing the functions) you check if position q0 is in the final states set.
Easy and fast. Sorry for
1. The long answer just talking about something tangential to the video.
2. If you knew this.
3. If I didn't explain myself well enough.
I hope to all computer scientists who are interested in automata and don't know about semigroups that they find a lot of answers on that wild untamed territory.
> So the only thing you need to encode are the letters as functions from Q to Q, the set of states.
I'm fairly sure this is true and well known for deterministic Turing machines, and so for DFAs as well
Can you update his code to do this? That could proof interesting.
nice intro to tokens at the beginning. I'll use that, thanks
How do these videos always get timed so we'll? I'm literally working on a class project doing exactly this. With the addition of providing a GUI representation for the FA.
I remember doing my Automatentheorie class online and it was somewhat troublesome. But across a few other classes, I got most fundamentals of formal languages.
It does help to have seen most of this, now where I actually get to use lexers and tree parsers etc.
I was close to writing a term paper on subsets of DFAs (or even PDA) for example those you can minimize, those with exactly one state, those in some normal form etc.
But bailed on that eventually.
is this Trainman from the matrix?
Instead of the while loop in the run function, it would be better to just loop over each symbol with a simple for loop. Then, w = w[1:] would not be needed anymore (does an unnecessary copy).
True. Trimming the beginning of w at each iteration is just confusing. And besides occupying more space for the word copy, it also runs in quadratic time instead of linear time..!!
Really strange choice of implementation....
@@haibrenner IIRC, Python string slices share memory (which you can't tell because strings are immutable), so it's really just iterating starting locations through the string without copying anything. Still, it's harder to follow than "for s in w", which makes it obvious that the algorithm never looks ahead or back or jumps over anything.
@@haibrenner I'm guessing he just didn't realize that strings are iterable like lists. It's a fairly unusual functionality for a programming language, no?
@@emuccino
String iteration is more abundant in programming languages than string slicing....
Not so rare functionality
Probably doesn't matter due to compiler/interpreter optimizations. There's no better if you didn't profile it. Seems like a premature optimization. Also there is probably no copy, just a reference which may already exist. So not even the reference itself may be stored.
But what's use of automata, especially in engineering problems?
For a nice example, search for the blogpost "Index 1,600,000,000 Keys with Automata and Rust"
In software engineering and computer science, anything that parses input is a finite state automaton. Most importantly, a compiler is a finite state machine for parsing code, turning it into machine code or byte-code. Or even a scientific calculator.
In other types of engineering, the finite element models that are used to model aerodynamics and hydrodynamics (for anything that moves), static forces (for anything that doesn’t) or project management (for a surprising amount of the work engineers do) relies on software that was compiled, and often includes their own scripting languages that must be parsed.
if q == 2, it's not in self.F, does that output False?
2 is not a final state, it will return false
That's one really strange way to iterate over the string 😕Why constantly truncate the string and get its 0'th element? Much better and cleaner is:
....for letter in w:
........q = self.delta[(q, letter)]
Type hinting would be nice e.g.
def my_function(my_string:str) -> str:
return my_string
Wasn't expecting it to cut there. It's like we spent this time defining something, and then didn't do anything with it...
You may need the 'longer video' -Sean
I learned about this in my last week of discrete structures of math class for computer science. I wish I had seen this video earlier
I enjoyed learning this method much more with a mathematical approach instead of arbitrary languages. The easy one being whether or not a binary number was even. The initial state of 0 was the final state. The input sent to the matching state (so a 0 would send it to state 0, no matter which state it was in, and 1 sent it to state 1, no matter which state it was in).
Completely agree, the logic is much more apparent
I like the implementation as a dictionary, makes it very easy to generate new state machines
What’re the practical usages of a DFA beyond compiling - are there any?
Implementing a regex engine
State machines for all kinds of purposes, like parsers or describing processes and behaviours.
DFA, is an abstract way of solving a problem without using a full turing machine.
For example, instead of needing a computer to run the logic of your toaster, you can design a toaster's logic that is similar to a DFA.
Basically reducing the complexity.
In olden golden times state machines was the only way to build large software systems safely. A "process" needs lots of memory and power and has many weird issues. They went to the moon on a state machine.
Regular expressions are equivalent to DFAa. Every time you write an RE, you are really building a DFA.
Network protocols are DFAs.
Traffic lights are DFAs. ATMs are DFAs.
A lot of software applications can be defined as finite sets of states, meaning it would be easy to implement them as simple languages, but because that doesn't pull in thousands of NPM packages from GitHub, it is rarely done.
I think it's much clearer with these variable names. And there's a little less code with the dataclass:
@dataclass
class DFA:
set_of_states: set
set_of_symbols: set
transition_map: dict
initial_state: int
set_of_final_states: set
def run(self, symbols):
current_state = self.initial_state
while symbols != "":
current_state = self.transition_map[
(current_state, symbols[0])
]
symbols = symbols[1:]
return current_state in self.set_of_final_states
very much interested sir. superb explanation
I'm taking this class right now and I have my first test in two weeks. I'm scaring of failing. My professor is a very though grader. Any tips on how to prepare as best as I can?
I clicked on this video so hard I think I broke my mouse.
🎉 reminds me of my CS course unit over 8 years ago😊
Why not defining the final state, as „own state“ in the graph? I.e., arrow to state 3; end.
Also why not stop immediately when reaching state 2, the invalid state?
There is no seperate end state because states 0 and 1 could be ends or transitions. So moving in and out of a state3 would complicate the rules. In this specific case, you could just end when state 2 is reached but I suspect it's there to simplify the evaluation code.
A word is a set of characters … if you’re dyslexic
is this an automaton in the sense that it's a set of rules that determine the "evolution" of whether a word is or is not valid? i'm only used to seeing cellular automata like conway's game of life
It determines acceptance of a subset of all the possible words that can be made up by a set of symbols (a language) and in this case proves that that language is "regular", which is one of the language classes in the Chomsky hierarchy, which you can look up a picture of.
So this class of automata not only determines the "evolution" of validity for a given word but also provides a process to construct the set of all accepted words.
Also note it is a one-to-many relationship so multiple automata can correspond to the same regular language, which you can visualize by just adding random empty states that have no functionality to your automata.
Write a code that accept all such video which contains implementation of automaton in python.
Errrr what about ‘bbbb’?
Not first to notice. Pass ;) lovely vid though. Makes me sad to not have finished university informatics.
3 weeks into my automata theory course and i understand nothing. This video was elixir for me.
Professor Thorsten Altenkirch looks like if Dave Grohl and Taylor Hawkins were 1 person and playing in a band called Foo(x) Pythons.
When I saw Automata I thought of the games for the Sinclair computers - including PIMania.
Question, if the rule is "words where As come before Bs", how can epsilon (empty word) be ok? There's neither an A nor any B so it doesn't satisfy the rule. Not?
The true rule is "no 'a' after 'b'" (or alternatively "word doesn't contain 'ba'") The English description given in the video is indeed misleading.
@@benweieneth1103 Thx for clearing that up ^-^
На 8ой минуте на экране представлен перебор символов строки в цикле, почему он так реализован?
A perfect opportunity to use list comprehension instead of a loop
You could even do this using the reduce function. (Fold in Haskell.)
Did I learn anything? No. Did I like his accent? Yes
yo. wow. I think i know where to start to make my own language and complier now. obv i have a long way to go bot wow this is so cool.
👍
What is that paper called??
You see if we do some math, we need to have some Greek letters.
You can just use "for c in w" instead of a while loop. Also, you don't need to compare with an empty string - "while w:" does the same thing.
shouldn't you use while 'w is not None:'?
@Greden No, because w is always a string. When you take the last character out, it becomes an empty string, not the object None.
@@mad_vegan > When you take the last character out, it becomes an empty string, not the object None
It doesn't, though. If w is set to "hello world", then it will still be "hello world" after iteration is finished, it won't "become an empty string" somehow.
Same goes for iterating variable c (in "for c in w" line): after the loop is finished, it will hold the value "d" in this case, not an empty string.
Try this:
....for c in "hello world":
........pass
....print(c)
You'll see "d" printed out after iteration.
@K My comment was referring to the while loop, where you slice the string each loop. If you use the for loop, then you don't need (and shouldn't do) slicing.
@@mad_vegan Yeah, I commented about that too (it's one really strange way to iterate over the string - with a while loop and slicing). Just pointed out some minor detail in your comment.
What is the difference between a sequence and a set? Why was a set of chars an incorrect answer to what is a word?
A set is unordered
My guess is that a set of characters like "o,d,g" could be sequenced into more than one word... -Sean
The elements in a set have no particular order if an order relation is not defined, and sets usually don’t have duplicate elements (otherwise you are looking at “multi-sets” that usually have a specific purpose, for example in combinatorics). A set of symbols is called an alphabet and words are sequences of symbols taken from an alphabet: for example we could have the alphabet (set of symbols) {a,b,c} and a word (sequence of symbols) “cca” that would be different from “acc” even though the characters are the same (so you can see the intuitive difference between set and sequence). Hope it helps, and yeah I was bored :)
@@beatmapgz so when I use a list in Python it's actually a sequence (since order matters) and the set that sequence comes from is all possible values for all possible types in Python?
@@versacebroccoli7238 Yes, a list in Python is a sequence. The list's "alphabet" is every object currently defined in your Python interpreter (a type is also an object). However, you can dynamically extend this alphabet, e.g., through creating new values from the primitive data types (int/float/str). Hence, your alphabet is uncountably infinite.
Hey, it’s the train man!
I’m thinking about making a similar video but about famous hacks in documentary format
Thanks for the video. I'd have more explicitly stated the rules for the example dictionary; where -ALL- a's come before -ANY- b's. Otherwise, you could read it like so; where -SOME- a's come before b's, which renders aba a valid word.
And bb an invalid one.
why not Σ instead of sigma?
@@dayvie9517 In Python you can use Σ as an identifier😀
Hi, guys! Thanks a lot for the content you are producing. Can you, please, help us understand how Fast-Flux works? I saw the video explanation of this concept is scarce, it might be an interesting security topic. :)
4:59
Nice!
What no 'bb' ? 😢
Its gotta be true right? 😂
👍Thanks.
damn i like this channel videos but i hate the sound of that pen writing on this paper idk why but cant resist it
Why have "sigma" in "init"? Is it ever used in the implementation?
It’s like he’s trying to speak without moving his mouth
Just started that chapter in the dragon book. Must be a sign
You should be in james bond movie
Silly 😅 how calls an alphabet (αβ) Sigma Σ?
This probably makes it a lot less dry for people who dislike math.
Hi
Is this the train guy from matrix 3
6:00 Please tell this learned professor that PEP-8 is a thing; spaces after commas. Computer languages are a standard, only some of those standards are enforced by the compiler but we're still subject to them because they're a good thing.
Also, come on, this is too simple to justify complicated words. Also also, to anyone that has had to write complicated regex expressions and refused to learn any more than they needed for the exact use case, I feel you.
Computer scientists typically don't pay attention to code beauty / readability, so they ignore PEP-8. It's okay though, their main focus is research, they work with *ideas*, not with the code, so code doesn't really concern them as long as it just works.
Can someone have more "Rick" vibes than Thorsten? :D
Scary
nice vid, but my inner pep-8 cries
Yes... learn Automata from this, but please don't learn Python from this.
love me some fellow Germans that are unconventional :)
Would "abb" fail? It seems like it should pass.
It would pass!
in the automata described, abb would pass. This is because it satisfies that all a's are before all b's. This works for "a" and {epsilon} too because a is still before all b's even if none exist and epsilon is empty thus there is no scenario where a's come after b's, thus it holds.
@@thebarnold7234 does b pass, as there's no as before it?
@@azoic6 , yes, "b" will also pass. From the initial state, 'b' will pass to state 1, and that is a final state.
I love computerphile but would appreciate if the videos would be more concise. Also the code is very verbose. I would appreciate something like
def run(state, delta, final, word):
while word:
symbol, *word = word
state = delta[(state, symbol)]
return state in final
delta = {(0,"a"):0, (1, "a"):2, (2,"a"):2, (0,"b"):1, (1, "b"):1, (2, "b"):2 }
run(0, delta, (0,1), "aab")
This video is a little underwhelming. Not gonna lie.
Noice
Excellent video, I didn't think impenting an automaton would be so easy.
MacOS tho ewwww
I love this guy but the lack of pep8 drives me nuts.
"I did something wrong ... Oh ... I set my indentation levels wrong"
That's why I use javascript over python every time.
Only problem with this channel is the atrocious act of using a marker on paper.