I want to talk about what is, possibly, the most important question in all of Computer Science: Does P equal NP?
If you have heard of this and want to learn a bit more, read on... π§΅π
Computer Science is all about finding clever ways to solve difficult problems.
We have found clever algorithms for a bunch of them: sorting stuff, finding shortest paths, solving equations, simulating physics...
But some problems seem to be way too hard π
One example is the Travelling Salesman problem.
β Find a cycle starting in your home city to visit all major cities in your country and return home with the least fuel cost.
This is the kind of problem we expect computers to solve easily, right? That's what computers are for!
π Well, very smart people have tried, and no one has come up with an algorithm that is always better than simply trying all possible cycles.
The problem is that the number of cycles grows exponentially faster than the number of cities!
Let's make it even easier, what about if I simply ask:
β Is it possible to visit all cities spending less than X dollars in fuel?
π No one still knows an algorithm to answer that question precisely for any value of X without trying all cycles, which again is exponential.
π¬ So, are we simply dumb, or is this problem so complex that it is impossible to find a clever algorithm to solve it, in the general case?
This is the root of possibly the most important question in all of Computer Science: P vs NP.
Answering this question is way harder than it seems. You see, most questions in CS are about objects: how to sort, how to compare, how to process...
But this is a meta-question:
β Are there questions about objects that are intrinsically very hard to solve?
Stephen Cook tried to answer this question in the early days of Computer Science. He came up with the following definitions:
Suppose we have a question of the form:
β Is there an object X with a given property Q?
π We want to define how hard is this question to answer.
An example of an easy question of this type is the following:
β Given an array of N elements, is there an element smaller than X?
Answering this question is easy. Look at each element, one by one, and compare it with X. It takes at most N steps, for any possible array.
This is an example of a problem in P.
π P here means "Polynomial-Time Complexity".
Intuitively, a problem is in P if there is an algorithm to compute a correct answer in polynomial time.
Now back to the Travelling Salesman, suppose I give you an answer:
π Yes, here, this is a cycle with cost less than X.
How can you verify that answer is correct? You just add the costs of all edges in the cycle. It takes again N steps.
This is an example of a problem in NP.
π NP here means "Non-deterministic Polynomial-Time Complexity".
Intuitively, a problem is in NP if there is an algorithm to verify a correct answer in polynomial time.
P problems are easy to solve. NP problems, we don't know yet, but at least they are easy to verify. That's the key idea.
β οΈ Note that P problems are also NP.
Now, the P vs NP question, formally, is this:
β Are there problems in NP that are not in P?
P vs NP is basically asking if there are problems that are inherently harder to answer than to verify, independently of how smart we become in the future.
π€ Think about what this means for a second, and ask yourself what's your intuition about it.
What's the right answer? We still don't know, but most computer scientists believe that P is not equal to NP.
The reasons are mostly philosophical but there is also evidence that, if P were equal to NP, a lot of weird things would happen.
This question is at the core of Computer Science because it talks about the nature of computation and its inherent limits, regardless of technological improvements.
We'll end here for now, but there is so much left to talk about (like NP-completeness).
So stick around π...
As usual, if you like this topic, reply in this thread or @ me at any time. Feel free to β€οΈ like and π retweet if you think someone else could benefit from knowing this stuff.
There seems to be a recent surge in the "HTML is/isn't a programming language" discussion.
While there are a lot of honest misconceptions and also outright bullshit, I still think if we allow for some nuance there is a meaningful discussion to have about it.
My two cents π
First, to be bluntly clear, if a person is using this argument to make a judgment of character, to imply that someone is lesser because of their knowledge (or lack of) about HTML or other skills of any nature, then that person is an asshole.
With that out the way...
Why is this discussion meaningful at all?
If you are newcomer to the dev world and you have some misconceptions about it, you can find yourself getting into compromises you're not yet ready for, or letting go options you could take.
One of the very interesting questions that really got me thinking yesterday (they all did to an important degree) was from @Jeande_d regarding how to balance between learning foundational/transferable skills vs focusing on specific tools.
@Jeande_d My reasoning was that one should try hard not to learn too much of a tool, because any tool will eventually disappear. But tools are crucial to be productive, so one should still learn enough to really take advantage of the unique features of that tool.
@Jeande_d One way I think you can try to hit that sweet spot is practice some sort of dropout regularization on your common tool set.
In every new project, substitute one of your usual tools for some convenient alternative. It will make you a bit less productive, to be sure...
β Today, I want to start discussing the different types of Machine Learning flavors we can find.
This is a very high-level overview. In later threads, we'll dive deeper into each paradigm... ππ§΅
Last time we talked about how Machine Learning works.
Basically, it's about having some source of experience E for solving a given task T, that allows us to find a program P which is (hopefully) optimal w.r.t. some metric M.
According to the nature of that experience, we can define different formulations, or flavors, of the learning process.
A useful distinction is whether we have an explicit goal or desired output, which gives rise to the definitions of 1οΈβ£ Supervised and 2οΈβ£ Unsupervised Learning π
A big problem with social and political sciences is that they *look* so intuitive and approachable that literally everyone has an opinion.
If I say "this is how quantum entanglement works" almost no one will dare to reply.
But if I say "this is how content moderation works"...
And the thing is, there is huge amount of actual, solid science on almost any socially relevant topic, and most of us are as uninformed in that as we are on any dark corner of particle physics.
We just believe we can have an opinion, because the topic seems less objective.
So we are paying a huge disrespect to social scientists, who have to deal every day with the false notion that what they have been researching for years is something that anyone, thinking for maybe five minutes, can weigh in. This is of course nonsense.