Same Story, Different Notation - Computerphile

  Рет қаралды 79,234

Computerphile

Computerphile

Күн бұрын

Пікірлер: 129
@MorRobots
@MorRobots 8 жыл бұрын
Professor Brailsford is by far my favorite Computerphile presenter.
@sourcecode6467
@sourcecode6467 8 жыл бұрын
+MorRobots Yes, I totally agree. I always look forward to each one of his videos.
@SUCACU
@SUCACU 8 жыл бұрын
+MorRobots What about Rob Miles, he's on my top list to be honest :D
@sourcecode6467
@sourcecode6467 8 жыл бұрын
Yes, he's a bright young guy. Personally not my favourite, but great nonetheless. I like them all.
@Zaurthur
@Zaurthur 8 жыл бұрын
definitely in my top ten
@MorRobots
@MorRobots 8 жыл бұрын
Rob Miles is like the "Im not saying its Ai, but AI!" of computerphile lol love his work on AI
@braydentidwell
@braydentidwell 8 жыл бұрын
Brings me back. Automaton, Grammars, and Languages was one of my favorite college courses. It really gives you a different perspective on the world of computer science.
@AntonAdelson
@AntonAdelson 8 жыл бұрын
+Brayden Tidwell My uni forgot them completely :(
@fuelofmil0
@fuelofmil0 8 жыл бұрын
+Brayden Tidwell Going to start my first automata course in some weeks. It's gonna be so much fun!
@Triantalex
@Triantalex Күн бұрын
ok?
@Luketg8
@Luketg8 8 жыл бұрын
Only recently had to cancel my place at the University of Nottingham for MSc Computer Science by Study as I had gotten a very attractive job offer, after discovering these videos I have realised that it will be a huge shame that I won't get to learn from great professors like Brailsford, I absolutely love these videos!
@mheermance
@mheermance 8 жыл бұрын
I wish this professor taught my Automata class as he's engaging and very clear in his explanations.
@dariokartal9453
@dariokartal9453 3 жыл бұрын
Yeah. Mine was overbearing (every time in class, he'd pick a student and dress him down in front of the hundred-strong audience - happened to me once) and was notorious for, as the rumor had it, having invented the Internet. I flunked his class twice. Don't matter, still probably the best class I ever took. The third time was the charm.
@Triantalex
@Triantalex Күн бұрын
ok?
@chrissteward5435
@chrissteward5435 8 жыл бұрын
I don't believe it, A KZbin vid just gave me homework....
@AmeshaSpentaArmaiti
@AmeshaSpentaArmaiti 8 жыл бұрын
+Chris Steward don't forget to do your chores, and TAKE OUT THE TRASH!!
@AntonAdelson
@AntonAdelson 8 жыл бұрын
+Chris Steward Haha, yeah! I'm confused, a little bit excited, and unsure. Like going out on a first date ever.
@KilgoreOnDrugs
@KilgoreOnDrugs 8 жыл бұрын
+Chris Steward ahh ... Compilers course :)
@KainusGulch
@KainusGulch 8 жыл бұрын
+Chris Steward Fortunately, we don't have to turn it in if we don't want to. I want to make a KZbin channel some time, but not about computer thingies specifically. Unless it's gaming, maybe.
@Triantalex
@Triantalex Күн бұрын
ok?
@datboi_gee
@datboi_gee 5 жыл бұрын
"In order to get to sentence, we first must take an 'L.'" Everybody has to take an L sometimes, professor. I feel you.
@WfrArcPol
@WfrArcPol 6 жыл бұрын
Me in class learning about FSA: I don't know WHAT the hell I'm doing, this is so boring Me at 2AM watching video about said FSA: I don't need sleep, it is Time To Learn™
@Triantalex
@Triantalex Күн бұрын
ok?
@realraven2000
@realraven2000 8 жыл бұрын
and obviously we need to accept commas as end markers so we can declare a list of identifiers. In Javascript this is also a performance optimisation.
@2Cerealbox
@2Cerealbox 8 жыл бұрын
I absolutely love this series! I hope you continue with this for a long time.
@oafkad
@oafkad 8 жыл бұрын
I'm genuinely annoyed I didn't grow up in the UK just for the off chance that I'd get to take a class from Professor Brailsford.
@umchoyka
@umchoyka 8 жыл бұрын
Quite a switch-up on the film style for this one. I think I like this way better than the constant out-of-focus thing, but the lighting was a bit off. Interesting though, keep experimenting! :D
@DrRChandra
@DrRChandra 8 жыл бұрын
In C, identifiers (EDIT: or at least their declarations) can be terminated by "[" (array), "," (list of identifiers of the same type), whitespace, or ";", maybe others I can't think of at the moment. But as Prof. points out, most commonly, it's a ";", for readability/understandability.
@ShanaTsunTsunLove
@ShanaTsunTsunLove 8 жыл бұрын
+rchandraonline Well, putting thing like left square bracket as "[" is not complete because it wouldn't be C if you didn't have many decades of legacy cruft to ruin everything, see en.wikipedia.org/wiki/Digraphs_and_trigraphs#C
@kalleguld
@kalleguld 8 жыл бұрын
+rchandraonline It is terminated by any character that's not a letter or number (or underscore). "int a=b+c;" contains 3 identifiers, terminated by '=', '+' and ';'
@DrRChandra
@DrRChandra 8 жыл бұрын
Kasper Guldmann, oh, hmmm...I was thinking about declarations, not their references, but that's valid too.
@kalleguld
@kalleguld 8 жыл бұрын
Oops, I misspoke. There are 4 identifiers, "int" is an identifier too.
@DrRChandra
@DrRChandra 8 жыл бұрын
+ShanaTsunTsunLove, "[" can terminate the C identifier's name, but additionally that does not completely describe the _type_ of the identifier. In other words, at "[" you know its name and that it's an array, but not how big, which in order for the compiler to accept it, you need the size (which can be null to specify an unknown size) plus "]". It begs the question, what is an identifier? I was thinking of just a name, which is separate from its characteristics such as its type and therefore its C legality.
@paperclips1306
@paperclips1306 10 ай бұрын
I can hear this guy for eternity
@ToeCutter454
@ToeCutter454 8 жыл бұрын
was I the only one impressed by the use of old dot matrix printer paper as scrap paper?
@vcothur7
@vcothur7 8 жыл бұрын
Chomsky is everywhere
@EtrielDevyt
@EtrielDevyt 8 жыл бұрын
Chomsky is Love, Chomsky is Life.
@joshuawade1495
@joshuawade1495 8 жыл бұрын
+EtrielDevyt Praise Chomsky.
@fuppetti
@fuppetti 8 жыл бұрын
+Vikram Cothur Is it the same Chomsky who comments on politics and stuff?
@wierdalien1
@wierdalien1 8 жыл бұрын
+Deltaexio yes
@SecretRaginMan
@SecretRaginMan 8 жыл бұрын
+Vikram Cothur He's the Walpole of computer science.
@pascalfragnoud2846
@pascalfragnoud2846 4 жыл бұрын
Wait, am I missing something ? Semicolons don't end identifiers in C (and any language that I know of, for that matter), things that are not valid identifiers characters do (including the semicolon): spaces, operator symbols...
@harrisonharris6988
@harrisonharris6988 8 жыл бұрын
I thought a key characteristic with state machines is that they never know how they got into that state, but in the identifier example it must know how it got into that state as it must be able to work it out from the string it stored as it iterated through each character (i.e. to save the identifier name is must have concatenated a digit or a letter onto some memory string so it knows the name, however to do that it would need to have a memory to store it and so would know what caused it to reach that state, you could play it perfectly in reverse).
@Theraot
@Theraot 8 жыл бұрын
+Harrison Harris The actual constraint is that the ammount of memory used to represent the state doesn't grow - that implies that the number of possible states is finite - hence the name "finite state machine". And that disallows things as concatenating, or keeping track of the path to get to the current state. Yet there is no need to concatenate. Not with this state machine. --- The state machine is used by passing all the characters of the string to it, until: A) you reach the end state, meaning that the string is valid. B) you reach the end of the string, in which case the string is invalid. So, no it is not concatenating the string. --- But how do you take some source code and get what is what? Notice that this grammar is useless to implement a programming language - since it only defines an indentifier. While you may try to implement a language with a set regular expressions[1] and some inference rules[2]... In practice, what is actually done is to create a single (context free) grammar for the whole language - this is easier to maintain. [1]: One for each part of the language. [2]: A backtracking algorithm to choose state machines that represents parts of the language. The backtracking algorithms "knows" how it got into the current state - it is adding it to a stack. This means that it is not a finite state machine, and it also means that regular expressions alone are not sufficient to parse a programming language. You may have been warned to not use regular expressions to parse C, XML, Java, C# or anything like that, now you have an insight of why. Note: all regular expressions are context free grammar, the inverse doesn't hold. --- Once we go beyond regular expressions, - I hope - we will see that you can mark some parts of the grammar to emit tokens. That is done by cutting the string by the current position and emitting an object "token" with that string and tagged with the part of the grammar that produced it. In that case, you only need to keep track of you current position in the string, which can arguably be considered part of the state. The tag is what state it was when the token is emitted. That way you can have a grammar that takes "foo + bar" and emits {"identifier" token "foo", "operator" token "+", "identifier" token "bar"} - further processing is needed to interpret the token sequence, this is often done by building a tree, in this case it will have "foo" and "bar" as childs of the addition. Then you can walk the tree, doing the operations as needed to execute the code [or to emit the code in another language, such as machine language]. It is worth noting that if you use only postfix notation (ie, "foo bar +") you don't need to build the tree (you would use the stack instead), meaning that is easier to implement the interpreter / compiler. --- Also note that modern compilers - even if they are parsing a context free language - may add rules that are not from the grammar itself. These rules are used to emmit warnings and other code analysis - such as cheking if you are not using a variable. Describing such rules can't be done using context free grammars only - if warnings were to be emitted as tokens, the grammar would be context sensitive (see Ogden's lemma).
@MrSlowestD16
@MrSlowestD16 8 жыл бұрын
0:45 I think it's important to note that recursion is ONE answer when the length isn't determinant. I simply bring this up is because recursion is a good way to solve some problems while it's a pain in the ass to solve others using it.
@squirrelbrains2197
@squirrelbrains2197 8 жыл бұрын
i wish all my professors, were that good at explaining things.
@TrimutiusToo
@TrimutiusToo 8 жыл бұрын
End marker can be semicolon, comma or whitespace (space, tab or newline)... in C that is... Lets not include arrays, as it should be a bit different parsing...
@linkVIII
@linkVIII 8 жыл бұрын
This was posted during my lecture about this today. Wasn't in the mood to watch right after lecture.
@kurtslagle797
@kurtslagle797 8 жыл бұрын
I wish my CS professors explained things this clearly.
@konstantinrebrov675
@konstantinrebrov675 6 жыл бұрын
int _; is also a valid variable name in many programming languages, including C.
@ariebrons7976
@ariebrons7976 8 жыл бұрын
if i understand this correctly: 1. detect a variable 2. get into a loop to definte the length of the variable 3. if you don't detect any more signals (letters) then get out of the loop.
@vicplichota
@vicplichota 8 жыл бұрын
Looking forward to the next vid in this topic... :-)
@D12golden
@D12golden 8 жыл бұрын
I am graduated in Computer Science and I am still getting handouts from a professor.
@AlejandroMartinez4
@AlejandroMartinez4 8 жыл бұрын
I'm liking this series ^^
@dmacmcmanus95
@dmacmcmanus95 8 жыл бұрын
Are there any other KZbin channels similar to this one?
@QuantumFluxable
@QuantumFluxable 8 жыл бұрын
+Dillon McManus Sixty Symbols and Periodic Videos for physics and chemistry, respectively. Steve Mould also does some interesting science videos from time to time. Applied Science is kinda similar, but for engineering and general mad sciencing.
@josevillegas5243
@josevillegas5243 8 жыл бұрын
+Dillon McManus I'll add to the list Vsauce 3Blue1Brown Physics Girl Mathologer Mindyourdecisions standupmaths
@josevillegas5243
@josevillegas5243 8 жыл бұрын
+Jose Villegas Frame of Essence Looking Glass Universe
@josevillegas5243
@josevillegas5243 8 жыл бұрын
tggt00 are there any channels that you reccomend that are not on the lists? Also, just found another one: PhDComics
@Zaurthur
@Zaurthur 8 жыл бұрын
I have a test on this sort of thing in my theory of computation class on Friday.
@AmeerFazal
@AmeerFazal 8 жыл бұрын
You are my Bro! :)
@PixelOutlaw
@PixelOutlaw 8 жыл бұрын
People wanting to break away from the norm C++ family and try recursion should do it in a tail call safe language like Scheme. You can learn most of it in an afternoon. :) It is in the Lisp family but Common Lisp (what people currently mean when they say Lisp) prefers looping and iteration or even better, applying functions to entire collections.
@paperclips1306
@paperclips1306 10 ай бұрын
😅😅😅
@RpattoYT
@RpattoYT 8 жыл бұрын
I'm sorry to bring this up but I can't not mention this. Did anyone else notice that the Professor just said something to the effect of, "cumming back into to one's self" whilst poking at a phallic shape sketch he'd just drawn on some paper. Maybe it's just immature of me to pick up on such things but I couldn't help but nearly choke on my coffee.
@CatnamedMittens
@CatnamedMittens 8 жыл бұрын
Perverted minds.
@RpattoYT
@RpattoYT 8 жыл бұрын
CatnamedMittens :P
@TheWeepingCorpse
@TheWeepingCorpse 8 жыл бұрын
+rpatto92 I'm proud to consider myself a raging pervert. If the authorities knew what I get up to I'd be behind bars years ago. In fact I watch most of these videos naked, but that never even entered my dirty sordid mind. P.s masturbating is a form of recursion and like the prof said it can't go on for ever.
@U014B
@U014B 8 жыл бұрын
Which begs the question: how does he expect that to be done? 😕
@Triantalex
@Triantalex Күн бұрын
ok?
@midnightrizer
@midnightrizer 6 жыл бұрын
Syntax is everything.
@karlkastor
@karlkastor 8 жыл бұрын
This reminds me of the Haskell programming language.
@firstnamelastname-oy7es
@firstnamelastname-oy7es 8 жыл бұрын
Interesting video!
@mmxbass
@mmxbass 8 жыл бұрын
"Any string of symbols A and B where there are equal numbers of A and B." It's funny how simple of a problem requires so much power. (Cannot be solved in the general case without an infinite stack machine.)
@SixB0w
@SixB0w 2 жыл бұрын
Really interesting! Was always wondering why the semicolon was necessary. Why is it not needed in Python?
@TheWyrdSmythe
@TheWyrdSmythe 8 жыл бұрын
I always loved State Engines! So handy for any kind of serial input. Are you taking this series all the way to recursive descent parsing? :)
@73h73373r357
@73h73373r357 8 жыл бұрын
This raises the question, how does the compiler/interpreter know that there isn't an escape character? For example, "int i = 0;" will generate an integer called "i" with value "0" without errors. However, "int i = 0" throws a compiler error. How does the compiler know to throw the error?
@tehlolzfactor
@tehlolzfactor 8 жыл бұрын
I assume the only way the compiler knows that is because when you write int i = 0, the compiler sees that there is no termination character and assuming you wrote more code, it sees that a new statement has been made without a comma or other valid notation for having two statements. therefore the compiler resolves that you haven't placed a termination character. if there isn't more code after your initial statement. it's possible the compiler checks recursively through spaces and newlines in your code after that statement and at a certain point decides you haven't put a termination character
@menachemsalomon
@menachemsalomon 8 жыл бұрын
The C standard comes with a grammar for the language, in a format similar to, but somewhat more compact than, the grammar given by Professor B. In your scenario, with the missing semicolon, the code does not become a "sentence" (to use Chomsky's terminology).
@73h73373r357
@73h73373r357 8 жыл бұрын
+Menachem Salomon I understand that. But that's too abstract. I'm looking for an indepth-view of how a compiler works. (yes i've read a bit online about that) but it's generally difficult to understand and an explanation would be quite nice.
@Arganoid
@Arganoid 8 жыл бұрын
This refers to a previous 'car park video', but where is that video?
@ropersonline
@ropersonline 3 жыл бұрын
It's a little annoying that the computerphile video titles, such as appear at 0:50 here, are generally different from the actual KZbin video titles.
@philomath6190
@philomath6190 5 жыл бұрын
"You can't keep recurring forever. You will crash. You will run out of memory." Wait a second. State machines don't need memory.
@ArnimSommer
@ArnimSommer 8 жыл бұрын
So, with Chomsky notation I can only combine two elements? E.g. S -> LTE would not be valid?
@peppybocan
@peppybocan 8 жыл бұрын
1:03 '"... and those of you who are from electronics engineering department" ... and those from Mathematics dept. and from Computer Science dept. have no power here. :D
@moatl6945
@moatl6945 8 жыл бұрын
Am I wrong, or doesn't »T->DT« violate the first rule that a »sentence« must _start_ with a letter (L)? On the other hand you won't get the semicolon on the last position, otherwise. Or is this just a »notation-problem«?
@domagojpolancec6552
@domagojpolancec6552 8 жыл бұрын
+Martin Steindl The S -> LT production covers the "identifier must start with a letter" rule because L will always be resolved into a letter and it precedes T. The T part can be resolved either in a letter followed by another T part, a digit followed by another T part or an E part which in this case resolves into a semi colon which marks the end of the sentence. What's important to note is that S is the starting point of a sentence, i.e., we can not begin constructing a sentence from T, L, D or E.
@kalleguld
@kalleguld 8 жыл бұрын
+Martin Steindl You must start the sentence at S. And since the only rule with S on the left side is S => LT, there's no problem.
@moatl6945
@moatl6945 8 жыл бұрын
+Martin Steindl OK, I was wrong: I just overlooked, that T isn't the start of the »sentence«.
@TechXSoftware
@TechXSoftware 8 жыл бұрын
When UNI taught me how to draw state machine diagrams, that wasn't it, lol
@MrCrayfishMinecraft
@MrCrayfishMinecraft 8 жыл бұрын
+TechXSoftware What Uni did you go to? Mine taught it exactly like in the video.
@TechXSoftware
@TechXSoftware 8 жыл бұрын
MrCrayfish UWS, There is no start and end circles, arrows.
@juggernaut93
@juggernaut93 8 жыл бұрын
+TechXSoftware It's only about notation. I was taught to draw the accept state as in this video, but the start state as a circle and an entering arrow.
@12tone
@12tone 8 жыл бұрын
I'm a little confused. Is this still considered a finite state automaton? The tail piece can in theory be arbitrarily long, so it has an infinite number of states it could potentially be in. Is this just a weird artifact of etymology?
@DS127
@DS127 8 жыл бұрын
+12tone The *output* can be arbitrarily long, but here "state" is refering to what's going on "inside" the machine. The state machine only has one state at a time.
@12tone
@12tone 8 жыл бұрын
Makes sense. Thanks!
@SimGunther
@SimGunther 4 жыл бұрын
Spotted a wild popular youtuber! :D
@joga_bonito_aro
@joga_bonito_aro 8 жыл бұрын
Funny. Just one week ago i wrote an exam about this stuff in my university
@Oldiesyoungies
@Oldiesyoungies 8 жыл бұрын
start up the entomology channel again :(
@DirtyRobot
@DirtyRobot 8 жыл бұрын
Haveaniceday;
@sabriath
@sabriath 8 жыл бұрын
EBNF is so much better though.
@GegoXaren
@GegoXaren 8 жыл бұрын
HAI 1.3 IM IN YR loop UPPIN YR var TIL BOTH SAEM var AN 10 VISIBLE SMOOSH "HAI! " AN var AN " AN SUCH!" MKAY IM OUTTA YR loop KTHXBYE
@RussellTeapot
@RussellTeapot 8 жыл бұрын
+Gego/XAREN ゲゴザレン DAFUQ
@GegoXaren
@GegoXaren 8 жыл бұрын
Russell Teapot That is LOLCODE. It prints HAI! 0 AN SUCH! HAI! 1 AN SUCH! HAI! 2 AN SUCH! .... HAI! 9 AN SUCH!
@samarthchaturvedi3926
@samarthchaturvedi3926 8 жыл бұрын
Why is he saying semicolon so much?
@joshuajurgensmeier4534
@joshuajurgensmeier4534 8 жыл бұрын
7th!
@GtaRockt
@GtaRockt 8 жыл бұрын
+Joshua Jurgensmeier Congratulations you won 1, I repeat, *1* Internet
@commanderlake7997
@commanderlake7997 7 жыл бұрын
His thumb is creepy!
A number NOBODY has thought of - Numberphile
16:38
Numberphile
Рет қаралды 450 М.
Angle Brackets - Computerphile
5:48
Computerphile
Рет қаралды 172 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 12 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 16 МЛН
Regular Expressions - Computerphile
17:19
Computerphile
Рет қаралды 246 М.
Computers Without Memory - Computerphile
8:52
Computerphile
Рет қаралды 338 М.
The Most Difficult Program to Compute? - Computerphile
14:55
Computerphile
Рет қаралды 1,4 МЛН
The Journey to 3264 - Numberphile
19:38
Numberphile
Рет қаралды 193 М.
Busy Beaver Turing Machines - Computerphile
17:56
Computerphile
Рет қаралды 418 М.
Problems with Powers of Two - Numberphile
10:57
Numberphile
Рет қаралды 330 М.
Turing's Enigma Problem (Part 1) - Computerphile
19:00
Computerphile
Рет қаралды 1,3 МЛН
The mystery of 0.577 - Numberphile
10:03
Numberphile
Рет қаралды 2 МЛН
Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
1:47:13
Lex Fridman
Рет қаралды 1 МЛН
Creating Your Own Programming Language - Computerphile
21:15
Computerphile
Рет қаралды 115 М.