This is a huge topic - one of the major subfields of theoretical computer science : Formal Langauges and the Theory of Computation

What is a "formal language"?

- a math definition of what an "algorithm" means
- and what sort of abstract can do different sorts of problems
- and how fast ; its O()

The big ideas are :

Formal expression of the notion of "algorithm"

- each "problem" is reduced to a "set of strings" questions, defining a "formal language"
- so addition for example is reduced to all strings like "1+2=3"
- ... and a computer program that can "do" addition is one that can say "yes" or "no" to whether or not such a string represents a true arithmetic addition expression.

Formal notion of "machine" (i.e. computer)

- mathy description of what it can do ... to a string of symbols, ending with "yes" or "no"
- simple so that the proofs about it can be manageable

For some categories there is 1-to-1 relationship between classes of languages and machines (the "template" link above)

- and how hard they are to describe
- and what sorts of abstract machines can solve them
- and how fast, i.e. what O() those machines take

A few "machines" :

- finite state machine
- which is powerful enough to handle regular expressions
- my old finite automata simulator

- turing machine | ... realized
- conway's game of life has the power of a turing machine
- ... which like any turing computer can run itself
- "game of life" youtube explanation

An open question : P vs NP

- P : polynomial time for a turing machine
- NP : nondeterministic polynomial (i.e. polynomial for parallel turing machine, also turns out to be "quickly verifiable")
- Broadly speaking, problems in P are "easy" (i.e. computers can solve big N versions), problems in NP are "hard" (i.e. big N can't be done fast enough).
- NP-complete : it turns out that many problems that seem to be in NP can be turned into each other, so if one can be solved fast, then all of those can.

But note that there are problems provably "harder" than NP ... and even some that no turing machine can solve in bounded finite time

- wikipedia: regular expression
- wikipedia: regular language : set of strings defined by a regular language
- wikipedia: finite automata : abstract machine that can recognize (i.e. compute) a regular language
- regex crossword
- in javascript
- in python

Note that in most programming languages, their library for "regular expressions" includes some syntax that is more powerful than the formal mathy definition of "regular expression". The "grouping" constructs, in particular, are not part of the formal mathy notion of a regular expression, but are often used in practical programming code.

This regex_ab.py is an example of the difference. And here's the finite state machine for the first pattern.

One related deep question is how people fit into all this. In other words is (intelligence, consciousness, sentience) computable? What do those things even mean.

- AGI - artificial general intelligence
- turing test
- "the hard problem" of consciousness
- my marlboro philsophy of mind links

What do you think?

And another related topic is the concept of "information", which has to do with patterns in data, randomness, and compressibility. Yet another course sized topic.

https://cs.bennington.college /courses /spring2021 /algorithms /notes /complexity2

last modified Wed May 12 2021 9:28 am

last modified Wed May 12 2021 9:28 am