r/badcomputerscience • • Dec 21 '17

The Mandel effect is the precursor to quantum computing and some say the Mandela effect is caused by quantum computers.... A fractal inside a recursive loop within an enigma. language and collective consciousness.

Thumbnail
reddit.com
14 Upvotes

r/badcomputerscience • • Mar 30 '18

This entire thread (no, chatbots are not intelligent beings)

Thumbnail np.reddit.com
13 Upvotes

r/badcomputerscience • • Dec 08 '15

"TIL that more than 1,000 experts, including Stephen Hawking, Elon Musk and Steve Wozniak, have signed an open letter urging a global ban on AI weapons systems"

Thumbnail
reddit.com
13 Upvotes

r/badcomputerscience • • Aug 02 '15

"AI researcher" does an AMA

Thumbnail
np.reddit.com
13 Upvotes

r/badcomputerscience • • Jul 09 '15

Most upvoted post on /r/badMathematics: Building a super-computer for finding the last digit of pi

Thumbnail
kickstarter.com
13 Upvotes

r/badcomputerscience • • Jul 05 '15

A failed attempt to empirically prove that P=NP, using magic.

13 Upvotes

So /r/badcomputerscience is finally a thing, huh?

To celebrate the occasion, I'd like to explore a somewhat old and flawed attempt to empirically prove that P = NP, using magic. Since there seems to be no "official" way to do things yet (at least, there are no rules in the sidebar), I'll try to copy the /r/badhistory style, but without 19th century weather.

Without further ado, here is the experiment.

For those unfamiliar, Harry Potter and the Methods of Rationality is a fanfic written by Eliezer Yudkowsky, from LessWrong. In it, a rational Harry James Potter-Evans-Verres attempts to explore and conquer-I-mean-advance the world of magic using the powers of logic and science. Today, we'll focus on Chapter 17: "Locating the Hypothesis".

Harry Potter has access to a sort of time machine device called a "Time-Turner". He begins to suspect that this device has certain properties that can be exploited to his advantage. According to him, this would be huge:

If this worked, Harry could use it to recover any sort of answer that was easy to check but hard to find. He wouldn't have just shown that P=NP once you had a Time-Turner, this trick was more general than that.

The key part here is "just shown". It is implied that although his trick would prove other things, P=NP is on the set of stuff that is proved. If a Time-Turner existed, it would be a huge game changer. However, I disagree that it would prove that P = NP.

The Time-Turner is a device that can be used twice a day, to go back up to 6 hours in the past. With it, Harry can go back in time and leave messages for his past self to read.

Harry Potter receives a message from his future self in a piece of paper (called Paper-2). He would take a piece of paper from his pad and call that Paper-1. Paper-2 and Paper-1 are the same, only from different "times". Harry wants to use these two pieces of paper and his time machine to factorize "181,429", a product of two primes (both with three digits).

Harry reviewed in his mind the algorithm that he would follow.

If Harry opened up Paper-2 and it was blank, then he would write "101 x 101" down on Paper-1, fold it up, study for an hour, go back in time, drop off Paper-1 (which would thereby become Paper-2), and head on up out of the cavern level to join his dorm mates for breakfast.

If Harry opened up Paper-2 and it had two numbers written on it, Harry would multiply those numbers together.

If their product equaled 181,429, Harry would write down those two numbers on Paper-1 and send Paper-1 back in time.

Otherwise Harry would add 2 to the number on the right and write down the new pair of numbers on Paper-1. Unless that made the number on the right greater than 997, in which case Harry would add 2 to the number on the left and write down 101 on the right.

And if Paper-2 said 997 x 997, Harry would leave Paper-1 blank.

The algorithm is solid. Since the primes (x and y) have three digits, we know that x >= 100, x <= 999, y >= 100, y <= 999. Additionally, 100, 999 and 998 aren't primes. 100 and 998 are multiple of 2 and 999 is a multiple of 3. So Harry just needs to go from 101 to 997.

Harry doesn't know for sure how the Universe works, but he has some clues (from Chapter 14).

"So..." Harry said slowly. "People just find that the universe... happens to be self-consistent, somehow, even though it has time-travel in it. If I and my future self interact then I'll see the same thing as both of me, even though, on my own first run through, my future self is already acting in full knowledge of things that, from my own perspective, haven't happened yet..." Harry's voice trailed off into the inadequacy of English.

And he has an hypothesis.

"Turning into a cat doesn't even BEGIN to compare to this. You know right up until this moment I had this awful suppressed thought somewhere in the back of my mind that the only remaining answer was that my whole universe was a computer simulation like in the book Simulacron 3 but now even that is ruled out because this little toy ISN'T TURING COMPUTABLE! A Turing machine could simulate going back into a defined moment of the past and computing a different future from there, an oracle machine could rely on the halting behavior of lower-order machines, but what you're saying is that reality somehow self-consistently computes in one sweep using information that hasn't... happened... yet..."

Realisation struck Harry a pile-driver blow.

It all made sense now. It all finally made sense.

"SO THAT'S HOW THE COMED-TEA WORKS! Of course! The spell doesn't force funny events to happen, it just makes you feel an impulse to drink right before funny things are going to happen anyway! I'm such a fool, I should have realised when I felt the impulse to drink the Comed-Tea before Dumbledore's second speech, didn't drink it, and then choked on my own saliva instead - drinking the Comed-Tea doesn't cause the comedy, the comedy causes you to drink the Comed-Tea! I saw the two events were correlated and assumed the Comed-Tea had to be the cause and the comedy had to be the effect because I thought temporal order restrained causation and causal graphs had to be acyclic BUT IT ALL MAKES SENSE ONCE YOU DRAW THE CAUSAL ARROWS GOING BACKWARDS IN TIME! "

In short, the Universe forces its own consistency. And the only way for this experiment to yield a consistent result (or so Harry thinks) is to give him the correct result.

Let's see then:

  • If Paper-2 is empty, then Harry writes something in Paper-1. The Universe is inconsistent.

  • If Paper-2 has the wrong values of (x,y), Harry writes (x', y') in Paper-1 to try a different solution. The Universe is inconsistent.

  • If Paper-2 has the correct values of (x,y), then Harry writes those same numbers in Paper-1. Therefore, the Universe is consistent.

I have no clue what is supposed to happen if the algorithm does not halt, and neither does the protagonist.

This is similar to an iterative algorithm trying all possible solutions until it finds the correct one. Except that due to time travel, it gives results instantly!

So why doesn't it prove that P = NP?

To be clear, the experiment does let us solve NP problems very efficiently. Let's see what Wikipedia has to say about the subject:

Intuitively, NP is the set of all decision problems for which the instances where the answer is "yes" have efficiently verifiable proofs of the fact that the answer is indeed "yes". More precisely, these proofs have to be verifiable in polynomial time by a deterministic Turing machine.

Yes, thank you, Wikipedia. If we have a way to efficiently solve P problems, we can use Time-Turners to efficiently solve NP problems.

It can even be extended to solve the travelling salesman problem, which is NP-hard. Just keep trying each possible solution and keep track of the "best solution so far". Once you tried all possible solutions, the best solution so far would be the solution to the travelling salesman problem.

But it does so by using time travel shenanigans. "Time Travel Shenanigans" is not a valid Turing Machine operation. Harry would have solved NP problems, but from a P=NP point of view he would have done so by cheating. If he wants to do it properly, he would have to solve NP problems in an ordinary Deterministic Turing Machine. But he has done no such thing.

There is another problem that prevents him from truly solving every NP problem. His time turner has a limit: it can only travel up to 6 hours in the past. This means that he has to compute results in up to 6 hours. If not, his machine fails. So if the problem is verifiable in polynomial time by a turing machine but doing so takes longer than 6 hours, then it fails.

P = NP has no such restriction.

And, anyway, all this is rendered moot because the experiment fails. The Universe has to be consistent, but does not have to follow an iterative method to reach the solution.

Paper-2 said in slightly shaky handwriting:

DO NOT MESS WITH TIME

Clearly, Harry should have added another condition to his algorithm.

  • If Paper-2 contains an invalid message, then Harry leaves Paper-1 empty.

Then the "DO NOT MESS WITH TIME" message would be an inconsistent result.

Thank you for your attention.


r/badcomputerscience • • Aug 13 '20

Computing exponentially faster: implementing a non-deterministic universal Turing machine using DNA

Thumbnail
royalsocietypublishing.org
12 Upvotes

r/badcomputerscience • • Dec 01 '17

"if someone solves NP-Complete in a meaningful way our society just changes like blamb. so i don't expect that it has."

Thumbnail np.reddit.com
12 Upvotes

r/badcomputerscience • • Jun 28 '17

When consumers become cybersecurity experts

Post image
12 Upvotes

r/badcomputerscience • • Aug 21 '15

Dynamic typing advocates fight against the religion of static typing

12 Upvotes

So I found this post on /r/programming:

https://medium.com/@richardeng/what-do-we-know-about-dynamic-vs-static-typing-8a973933e0b7

It's a fairly short document in defense of dynamic typing, based on a JavaZone video. Unfortunately, it also gets some stuff wrong and triggered a reddit discussion that further gets things wrong.

Let's start with the video itself, which has a number of oddities but for the most part makes some good points in favor of dynamic typing.

The good parts:

It presents actual studies on the topic and analyses those studies to conclude that dynamic languages are often a good choice. Also good is that it takes the opportunity to show how C# is better than Java, which is always a good thing.

Now the bad parts:

The worst part is probably the recording quality: It includes constant breathing sounds and it's difficult to hear the audience. But this is not /r/badsound, so let's move on.

First of all, believing that statically typed programs are more reliable than dynamically typed ones is religion because we have no evidence for that. Seems like a very loose definition of "religion", seeing as static typing makes no statements about the existence of God and such, but whatever. I suppose his main point is that we should do more studies on the topic, which is a valid position to have.

One of the slides is named "Is there more than one type?", saying that "anything more is in the mind of the programmer". This is, uh, a weird statement to make. What point is he trying to make? That the fact that we don't specify the type of assembly registers this implies that types don't "really" exist? How are the two things even correlated?

He also claims that there is nothing that static typing can do for you that can’t be done with testing.

This is just wrong. Tests are statements that follow the format "in this case, this should happen" (existential quantification). Types, in contrast, are universal statements. There are some ways to mitigate the problems with testing (by checking coverage, for instance), but testing itself has costs.

Even if testing finds everything "eventually", at what cost does this come? What about zero days vulnerabilities? An attacker finds a bug and exploits it. This is technically testing... done by the attacker. Testing is great and all, but it's not the only tool around. Ideally, you'd use a combination of many to get the best of all worlds.

The video describes some small studies but then mixes this with some personal experience to get some grandiose claims. Having more studies would indeed be helpful, but to go from "2% of all Python GitHub issues are type errors" and "productivity is worse in verbose languages and C++ is verbose" to "static types are useless" is not justified. You need way more than that to reach that conclusion.

The text post is also problematic, since it takes some of the worst parts of the video and oversimplifies the rest:

static typing can only fix a tiny percentage of the software defects in your program (around 2 per cent)

This is a reference to the video, that claims that around that percentage for GitHub issues. GitHub issues do not include bugs that were found before the code was pushed to the main repository. It also tells us nothing about the severity of those issues. However, I suppose it's not that big a mistake, just a simple oversimplification of the video.

The claim that

Second, statically typed software is no more reliable than dynamically typed software.

is also problematic. This might happen on average, but there's another perspective this ignores. And that is, if I want to make a program as reliable as possible, should I use a statically typed language? Perhaps on average statically typed programs are just as reliable, but static typing might enable other tools (e.g. static analysis tools) that are not sufficiently used to have a significant impact on averages but nevertheless do have a significant correlation with program defects. The talk at least acknowledges that some use-cases are better suited by good type systems (it just claims that such use-cases are rare), the text post does no such thing.

It also inherits the bad part of the video about testing doing all that types do and treats the nuanced "you should consider cost-benefit trade-offs of typing systems" as "the small benefits of static typing are not worth giving up the tremendous benefits of dynamic languages". Again, the talk (mainly the final questions) at least acknowledges that implementations of statically typed languages can be faster than ones of dynamic languages.

The reddit discussion also has some very low-hanging fruit, such as "static analysis of source code cannot help you here" (uncovering software defects). Again, this is a strong statement. It's not even about static typing anymore, but static analysis in general.

Moving on:

I change my code much more than I read or write or navigate around it. Guess what kind of code resists changes the least?

Well, do you have any evidence for that? Wouldn't want to be a... religion, would we?

It goes on the basis that the development cycle is: "write the program, compile, run". But it doesn't seem as informative once you realize that it's a cycle: write, compile, run, test, modify, compile, run, test, modify, compile, run, test...

The idea that after completing all steps of a process we go back to the first is pretty clear in the word "cycle". When we talk about development cycle, we know that it's a cycle.

Sure, you also detect type errors from the rarely used code paths in every point of the development, but how useful is that?

If the rarely used code path is a massive security vulnerability, then it seems pretty important to detect it early.

"programming in statically typed language" is an illusion. You're using all kinds of programmable tools that certainly aren't purely statically typed while programming in your statically typed language. make, bash, vim, emacs, eclipse..

The existence of make and eclipse in no way invalidate the existence of statically typed languages.

On the bright side, nobody used the word "reLIEgion" yet so that's a plus.

going to theorem proving so heavily that the proof becomes equivalent to the test

If your proofs are equivalent to your tests, then you're doing proofs wrong.

So conclusions:

  • Everybody should love scientific studies.

  • People should do more studies on languages and language paradigms.

  • The existence of assembly does not disprove the existence of types.

  • You should not extrapolate from a few studies to massive claims.

  • C# has type inference, which is neat.

  • Oversimplifications can result in errors.

  • A code-path being rarely used in no way implies that it is unimportant.

  • The existence of makefiles does not disprove the existence of statically typed languages.

That all I have to say about this subject for now.


r/badcomputerscience • • Aug 06 '15

Why PHP function names are so inconsistent: Strlen was used as a hash function

Thumbnail
news.php.net
12 Upvotes

r/badcomputerscience • • Jul 27 '15

Stephen Hawking does an AMA about AI. Yeah, i'd expect a lot of badCS, really soon.

Thumbnail
np.reddit.com
12 Upvotes

r/badcomputerscience • • Jul 27 '15

Go to language to create any program!

Thumbnail
np.reddit.com
12 Upvotes

r/badcomputerscience • • Jul 26 '15

apparently bits are just used to look nerdy [x-post /r/badmathematics]

Thumbnail
np.reddit.com
12 Upvotes

r/badcomputerscience • • Jul 19 '15

Thesis Statement: The I Ching is Nature's Programming Language. (or stuff that I remove from /r/Metaphysics)

Thumbnail
reddit.com
12 Upvotes

r/badcomputerscience • • Jul 25 '17

AI brings out the crazies

11 Upvotes

Sightings of ghost cars are probably because of early self driving cars tests.

Sightings of ghost cars goes back about as far as cars being a common thing. And this doesn't explain any of the other phantom vehicles people reportedly see, some of which are older than digital computers.

Counterfactual Quantum Communication is responsible for the Mandela effect, aka "I forgot how to spell Berenstain bears"

I'm at the point in my life where I fully embrace the fact that I do not understand how quantum computing and communication works. At this point if you told me it was literally just magic, I would probably agree with you and move on my day. Having said that, I kind of doubt this powerful magic is able to cause everyone everywhere to forget that New Zealand is south of Australia, send you and a bunch of random people on reddit to a new dimension where some movie called Shazaam was never made, or put you in a timeline where Nelson Mandela died in prison.

The black cube in the article is not a reference to 'black box' programming (vis-a-vi "we don't understand how this AI works, so it's like a black box"), instead, it's an example of how we all worship Saturn

Just, please, get mental help.

Here's an archive link to that forum post. The premise is that ancient Jews worshiped the Roman god Saturn as "El" (but no, not really, a bunch of random English words include "el" in them, El was represented by a black box (???), and there are a bunch of random places with large black boxes.

Demon's literally exist, and AI is a perfect way of holding them

OK, "AI" is a program, which means that it's a series of instructions. I guess you could say that the demon will, like, port itself as a module in the AI's code, or something? Maybe they're using "AI" as a term including hardware, but then you'd just be saying that "you could overwrite the program's code and replace it with a demon", but then... why would you need the AI?

What I'm saying is that I have questions you guys.

they can barely program a computer opearting system that's half decent and not riddled with exploits and now we're opening this can of worms. lol humans.

Incompetence isn't the reason for shoddy operating systems; money is.

Yeah, OK, modern operating systems have 45-85 millions of lines of code, but sure, sure buddy.

Sorry, but there's just nothing else to say about this.


r/badcomputerscience • • Jul 21 '15

Sanskrit is an Object Oriented Programming Language! [X-Post /r/badlinguistics]

Thumbnail
uttishthabharata.wordpress.com
11 Upvotes

r/badcomputerscience • • Jul 20 '15

Futurology Discusses Artificial Intelligence (again)

Thumbnail
np.reddit.com
11 Upvotes

r/badcomputerscience • • Oct 04 '22

Happy Cakeday, r/badcomputerscience! Today you're 8

10 Upvotes

Let's look back at some memorable moments and interesting insights from last year.

Your top 1 posts:


r/badcomputerscience • • Nov 29 '16

It seems like every time a functional language is posted, people are upset that a non-Algol syntax exists.

Thumbnail
reddit.com
10 Upvotes

r/badcomputerscience • • Feb 12 '16

People with inverted qualia experience the encryption key as the decryption key, and experience a long time as a short time

Thumbnail np.reddit.com
10 Upvotes

r/badcomputerscience • • Sep 26 '15

Manifolds make you a better programmer.

Thumbnail
np.reddit.com
10 Upvotes

r/badcomputerscience • • Jul 31 '15

[Meta] Custom flairs. Have fun.

10 Upvotes

I think I managed to enable these things. Seems like my fellow mod colleagues had merely set it for themselves.

Have fun, and please make better jokes than I do with them.


r/badcomputerscience • • Sep 18 '16

[+1000] The Internet is the colloquial term for Interconnected Networks. ... TL;DR The Internet is a collection of networks and your can start your own any time; that's how this thing actually works.

Thumbnail np.reddit.com
9 Upvotes

r/badcomputerscience • • Jul 05 '15

You need infinite energy mass to compensate for irrational numbers, duh [x-post from /r/badmathematics]

Post image
9 Upvotes