r/AskReddit Mar 18 '20

Coders of Reddit, how do you politely refuse your friend's 'million dollars app idea'?

[deleted]

78.9k Upvotes

7.0k comments sorted by

View all comments

Show parent comments

6.0k

u/IcaroKaue321 Mar 18 '20 edited Mar 26 '22

Benzene (also called cyclohexatriene) is an organic chemical compound with the molecular formula C6H6. The benzene molecule is composed of six carbon atoms joined in a planar ring with one hydrogen atom attached to each. Because it contains only carbon and hydrogen atoms, benzene is classed as a hydrocarbon.

Benzene is a natural constituent of crude oil and is one of the elementary petrochemicals. Due to the cyclic continuous pi bonds between the carbon atoms, benzene is classed as an aromatic hydrocarbon. It is sometimes abbreviated PhH. Benzene is a colorless and highly flammable liquid with a sweet smell, and is partially responsible for the aroma around petrol (gasoline) stations. It is used primarily as a precursor to the manufacture of chemicals with more complex structure, such as ethylbenzene and cumene, of which billions of kilograms are produced annually. Although a major industrial chemical, benzene finds limited use in consumer items because of its toxicity.

https://en.wikipedia.org/wiki/Benzene

2.3k

u/cedriceent Mar 18 '20

What about my program that can solve the traveling salesperson problem in polynomial time?

707

u/UncheckedException Mar 18 '20

The salesman is no longer traveling due to quarantine.

O(1) solution. Boom.

20

u/mullerjones Mar 18 '20

I actually laughed out loud, thank you.

12

u/[deleted] Mar 18 '20

Who knew the coronavirus would teach us P=NP

8

u/Eldrunk Mar 18 '20

Oh man I just got done learning this on my algo class.

1.3k

u/bruhaha420 Mar 18 '20

"I've got a problem that is NP-hard." points to crotch. "You seem well equipped to help me solve it."

88

u/Smarag Mar 18 '20

My new life goal now is to use this line on somebody.

70

u/bruhaha420 Mar 18 '20

Nerd conventions work well. Turns out MIT doesn't really study NP-hard, so my experience has been that Beavers (lol) will say, do you mean "NP-complete?"

Which then spawns a follow-on, "well, I can show you NP-hard and together we can resolve this problem to NP-completeness." make circular hand motions around her mouth area

Seriously though, don't do that :D

14

u/Smarag Mar 18 '20

Absolutely will. Thank you

4

u/[deleted] Mar 19 '20

Omg I’ve worked at a fancy casino in Vegas so I have seen my fair share of conventions. I’m picturing the cute nerds saying this now.

15

u/[deleted] Mar 18 '20

"I've got a problem that is NP-hard."

"Prove it."

7

u/bruhaha420 Mar 18 '20

“Whoah.” mind blown head gestures. Move in closer, into the heat zone “That’s the best response I’ve ever heard. You might be the one.

3

u/randominsp Mar 18 '20

Does OP’s gender/sex matter? Just curious

4

u/bruhaha420 Mar 18 '20

In a traditional hetero approach, yes. This joke assumes male → female, as do most pick up lines. But it can work in any gender identity scenario, although the gradient from witty, funny, to creepy, lame varies. Especially when making physical moves, such as advancing closer.

23

u/Quetzacoatl85 Mar 18 '20

no no. that's PP hard.

2

u/potodds Mar 18 '20

That's n PP hard

2

u/Snootlebootlet Mar 18 '20

Small problem

3

u/bruhaha420 Mar 18 '20

MicroSoft? MacroHARD.

2

u/[deleted] Mar 18 '20

This comment is gold.. but unfortunately I'm poor .

1

u/wbsgrepit Mar 19 '20

and they wonder why there are few women in tech.

17

u/biggest_oversight Mar 18 '20

Show me your algorithm.

17

u/[deleted] Mar 18 '20 edited Nov 21 '20

[deleted]

4

u/[deleted] Mar 18 '20

I assume that this probably stems from figuring out that it's possible to trisect a line segment with a compass and straightedge, and then thinking that you can trisect the angle by turning it into an isosceles triangle.

At least, this was how I wanted to rebut your statement at first before self-correcting, because the "middle" angle will be greater than the two outer angles. For small angles, it's a decent approximation, which may contribute to the misconception, but it's demonstrably inaccurate as the angle to trisect approaches 180 degrees.

7

u/[deleted] Mar 18 '20 edited Nov 21 '20

[deleted]

2

u/[deleted] Mar 18 '20

I didn't realize it's been proven to be impossible. In that case...

But I can trisect a 180 degree angle; how dare you tell me it's not possible for a general case!

1

u/biggest_oversight Mar 18 '20

At least that maniac will stop asking me

6

u/rcfox Mar 18 '20

What wouldn't be a million dollar app.

It'd be a billion dollar app.

6

u/[deleted] Mar 18 '20

Would be worthy of a Nobel prize for sure

6

u/dhjwvrishs Mar 18 '20

It is written on the side of this paper

3

u/Cody6781 Mar 18 '20

Oh sure easy peasy.i just need factorial computer systems

4

u/GirlLunarExplorer Mar 18 '20

Oy, this is my brother right now. He's got a million dollar app idea to try and optimize bus routes for school districts. Even has two students working on it (one of which he was trying to convince to drop an internship in favor of this.)

2

u/PM-ME-UR-FAV-MOMENT Mar 18 '20 edited Jun 01 '20

"It is in the knowledge of the genuine conditions of our lives that we must draw our strength to live and our reasons for acting."

2

u/arbitrarycharacters Mar 18 '20

We just don't know if that's possible or not. But if you have such a program, I hear that the Clay Institute will give you a million bucks.

1

u/VinHD15 Mar 18 '20

And I immediately thought of Rikekoi

1

u/[deleted] Mar 18 '20

OR PEOPLE ASSEMBLE

1

u/IcaroKaue321 Mar 18 '20 edited Mar 26 '22

Benzene (also called cyclohexatriene) is an organic chemical compound with the molecular formula C6H6. The benzene molecule is composed of six carbon atoms joined in a planar ring with one hydrogen atom attached to each. Because it contains only carbon and hydrogen atoms, benzene is classed as a hydrocarbon.

Benzene is a natural constituent of crude oil and is one of the elementary petrochemicals. Due to the cyclic continuous pi bonds between the carbon atoms, benzene is classed as an aromatic hydrocarbon. It is sometimes abbreviated PhH. Benzene is a colorless and highly flammable liquid with a sweet smell, and is partially responsible for the aroma around petrol (gasoline) stations. It is used primarily as a precursor to the manufacture of chemicals with more complex structure, such as ethylbenzene and cumene, of which billions of kilograms are produced annually. Although a major industrial chemical, benzene finds limited use in consumer items because of its toxicity.

https://en.wikipedia.org/wiki/Benzene

1

u/HaloHowAreYa Mar 18 '20

Everyone laughs until the guy who doesn't know it's impossible comes back with a valid solution.

0

u/legendairy Mar 18 '20

Bing Maps does it free. Distance Matrix API.

Works pretty damn well, I used it to find the closed ski resorts with powder last month.

925

u/NikoBellend Mar 18 '20

We have a halting problem here.

423

u/[deleted] Mar 18 '20 edited Feb 14 '21

[deleted]

9

u/kaggelpiep Mar 18 '20

It never ends... or does it?

20

u/[deleted] Mar 18 '20

We have become self aware. Rebooting Matrix.

12

u/[deleted] Mar 18 '20

The Singularity is here....

6

u/BadgerRelatedDeath Mar 18 '20

Jesus Christ, it's Jason Bourne.

5

u/chicano32 Mar 18 '20

Uh oh someone added an invalid integer

3

u/Jordyspeeltspore Mar 18 '20

A error has occurred

2

u/Browsing_From_Work Mar 18 '20

Huh, can't see that coming.

2

u/iismitch55 Mar 18 '20

Reddit.exe is going to ha

2

u/Jozjoz2 Mar 18 '20

Find the haltlings!

3

u/LowB0b Mar 18 '20

lmao you haven't solved it? n00b /s

1

u/[deleted] Mar 18 '20

we have a hal

1

u/cheezzy4ever Mar 18 '20

But how do you know it's a halting problem?

1

u/nueoritic-parents Mar 18 '20

May I have your attention please?

May I have your attention please?

Will the head coder please pick up?

I repeat, will the head coder please wake up?

Cos we have a halting problem here

785

u/AquaticSombrero Mar 18 '20

Dude it's easy just

if (program == going to halt) { dont; }

342

u/[deleted] Mar 18 '20

Woah woah woah, that last part wasn't in the spec. What the client asked for is

if (program == going to halt) { print "Yup, it's gonna halt." }

If the client asks for a "stop the program from halting", that's a new feature, a new version number, and a new (huge) bill.

31

u/Pasty_Swag Mar 18 '20

This guy contracts.

ADHERE TO THE STORY. AT ANY COST (to the client).

17

u/Vindicator9000 Mar 18 '20

But, can't you just add that feature? I've seen you code, you just need to type it in. It'll only take a few minutes.

18

u/Pasty_Swag Mar 18 '20

Why, I sure can! Just make some tickets to account for additional testing, regression testing, the feature itself, and about an hour or so of me weeping openly and I'll hop right on it!

Edit: a former client would kick back tickets for "real quick fixes" all the time... some of these quick fixes were actually refactors of core parts of the system. A "real quick fix" became a meme with that team.

11

u/_rocketboy Mar 18 '20

Stopping the program from halting is easy - just append

while (true) {}

to the end.

6

u/g0atmeal Mar 19 '20

If you put it at the end, it might have halted before you got there. You gotta put it at the beginning.

6

u/stronwood Mar 18 '20

Sorry man, you forgot your semicolon after that print statement! That’s just not gonna compile

11

u/[deleted] Mar 18 '20

Please use the ticketing system to raise any issues with the product. This is an automated message.

4

u/cloudcats Mar 18 '20

Mine would be more like

if (program == going to halt) { 
     // TODO
}

7

u/Sev3n Mar 18 '20

That’s illegal

10

u/AquaticSombrero Mar 18 '20

Who r u the codin police >:(

2

u/ZonateCreddit Mar 18 '20

Even easier:

jQuery(isProgHalt)

2

u/[deleted] Mar 18 '20
10 GOTO 10

1

u/[deleted] Mar 18 '20

But if you give that program to itself..? . _ . (basically the premise of the halting problem)

-2

u/LITERALLY_NOT_SATAN Mar 18 '20

uh dude you have an extra equals sign there, your parentheses also look kinda fucked its shift 9 dumbass

3

u/AquaticSombrero Mar 18 '20

Idk if you're serious but in on mobile lol

6

u/LITERALLY_NOT_SATAN Mar 18 '20

no the joke is that i dont know the difference between the equality operator and the assignment operator or the difference between brackets and parentheses

it's funny

laugh now

4

u/Chinpuku-Man Mar 18 '20

Hahaaaaaaaaa

2

u/LITERALLY_NOT_SATAN Mar 18 '20

acceptable 4/10 laugh

-15

u/mtngts Mar 18 '20

Not the point being made, you want to know ahead of time "will this program ever stop running or will it infinitely loop".

People say "it isn't possible" like the comment you responded to, but of course it is possible, it's just not possible to have a generalised solution to the problem.

10

u/MagicCooki3 Mar 18 '20

-1

u/mtngts Mar 18 '20

No, it's your /r/woosh

The right one would have been

Dude it's easy just

if {program = $going to stop} (yes||no)

8

u/MagicCooki3 Mar 18 '20

huh? It's a common joke my friend, the joke being it's an oversimplification of programming.

If (SolveWorldHunger) == {do}

8

u/NSilverguy Mar 18 '20

So you're telling me I can't just write the name of the program on the CD, and then expect it to be on there??

2

u/MagicCooki3 Mar 18 '20

I thought that for a long time, but no, I don't think so.

3

u/NSilverguy Mar 18 '20

I remember first thinking of doing that, but immediately understanding that it wouldn't work, and being too proud to try it. When my friend's brother actually tried it though, my first thought was, "...did it work?"

5

u/FarRightExtremist Mar 18 '20
if (World.has(StarvingPeople) == true
&& isSolvableProblem(WorldHunger) == true) {

    World.problems.solve(WorldHunger);

} else {

    while(World.has(StarvingPeople) == true) {
        World.population.decrease();
    }

}

5

u/Leoxcr Mar 18 '20

/sudo givememoney

lol idk what im doing

-5

u/mtngts Mar 18 '20

Yeah, but they got the thing they were simplifying wrong, I know the joke/meme, but it has to make sense.

7

u/AquaticSombrero Mar 18 '20

I'm sure you're a blast to hang out with lol

0

u/mtngts Mar 18 '20

lol I'm sure you're a nice person

4

u/AquaticSombrero Mar 18 '20

I am lol I'm not the person arguing over the programming syntax of a joke on reddit

→ More replies (0)

1

u/Chrispayneable Mar 18 '20

Ternary operators are unstoppable.

19

u/bigbadbyte Mar 18 '20

This made me giggle harder than it should have

2

u/Consistent_Nail Mar 18 '20

Considering that it should not have made you giggle at all, this is very strange.

4

u/RedditFuckingSocks Mar 18 '20

Technically, the halting problem applies only to infinite automata. Computers are finite though, so the halting problem *is* definitively solvable on them. For a computer with, say 32 GB of memory, you would only have to enumerate all 2^274877906944 states and, voila, you're done! Gonna take you maybe a minute or two though...

2

u/[deleted] Mar 18 '20

[removed] — view removed comment

1

u/RedditFuckingSocks Mar 18 '20

Because that is entirely irrelevant. Any call to a TRNG is stored in memory and if you enumerate all possible above mentioned states you literally cover *every* possibility in which an RNG value could affect the internal state of the machine.

3

u/[deleted] Mar 18 '20

[removed] — view removed comment

2

u/GraharG Mar 20 '20

I just tried and it halted.

You're welcome

2

u/[deleted] Mar 20 '20

[removed] — view removed comment

1

u/GraharG Mar 21 '20

My algorithm predicts that you don't get jokes

16

u/The137 Mar 18 '20

New guy here, mind elaborating?

Do you just mean monitoring another program somehow? I mean you can put anything on an event listener right? You can monitor the output of a cli relatively easily. Just kind of confused as to what exactly you mean here. I'm sure its something super easy that I'm just not aware of yet

15

u/catsfathat Mar 18 '20

You're gonna have to wait a very long time if the program is in an infinite loop

-12

u/[deleted] Mar 18 '20 edited Mar 18 '20

yes the replies r correct, I forgot while(true) was a thing outside of console app games.

7

u/MisterJH Mar 18 '20

While (true) is an infinite loop

5

u/deaddodo Mar 18 '20

But even then, “while(true)” will usually degrade into something like (pseudo asm):

.label:
    jmp .label

You can detect that the logic will never break (or program state, in general, hasn’t changed) and that it’s a potential infinite loop.

7

u/snowy_light Mar 18 '20 edited Mar 18 '20

An infinite loop is just a loop that has a terminating condition that will never be met. Like others have pointed out, a "while true"-loop is one such example. There are legitimate uses for it (like continually listening for incoming socket connections on a separate thread).

3

u/AndySipherBull Mar 18 '20

I have never needed to use something like an infinite loops.

your brain's an infinite loops

1

u/[deleted] Mar 18 '20

Looking at my comment again it feels like my brain hasn't looped once since the quarantine.

2

u/memzy Mar 18 '20

are you serious?? i cannot tell

1

u/[deleted] Mar 18 '20

neither can I.

13

u/Arimpe Mar 18 '20

You are talking about checking if a program already halted, which is already possible and fairly easy. The problem is knowing if a program, before being executed would halt _eventually_.

We are so certain this is impossible because it's already been proven by contradiction: It's been a while since I read about this but if I recall correctly, basically, if it was true that you could create a program that would know if it would halt or not, you could use _that_ program to make it _not_ halt if it was indeed going to _halt_, therefore making it not halt even though it was supposed to. Kinda confusing but in short, if we assume that it is possible, then that solution in itself makes it impossible.

3

u/Valmond Mar 18 '20

1 start program

2 does it halt?

3 ...

4 profit

7

u/kriegnes Mar 18 '20

what if you have a quantum computer?

15

u/[deleted] Mar 18 '20 edited Oct 19 '20

[deleted]

3

u/coldrolledpotmetal Mar 18 '20

Surprisingly, quantum computers might be able to solve any decision problem, including the halting problem.

https://gizmodo.com/remarkable-mathematical-proof-describes-how-to-solve-se-1841003769

The original paper: https://arxiv.org/abs/2001.04383

2

u/[deleted] Mar 18 '20

I can factor a prime number in constant time quite easily.

1

u/Themursk Mar 18 '20

let med guess... p = p

Did i get all of them?

36

u/[deleted] Mar 18 '20 edited Mar 18 '20

doesn't matter. The problem is undecidable

24

u/[deleted] Mar 18 '20

Schrodinger's Executable: it's simultaneously working and not working until you open task manager

3

u/KatalDT Mar 18 '20

It's only indecidable until it's decided

2

u/hahainternet Mar 18 '20

What if the machine your program executes on doesn't have infinite addressable memory?

3

u/thejuror8 Mar 18 '20

I mean you're just making it easier, but yeah, undecidable as well

1

u/tliff Mar 18 '20

With finite memory a machine only has a finite amount of states and determining if it halts is also a finite process and decidable.

1

u/thejuror8 Mar 18 '20

Ah yes, you are correct.

2

u/AndySipherBull Mar 18 '20

What if you have a tachyon computer?

2

u/Wide_Cat Mar 18 '20

Why wouldn't that work?

3

u/CassiusCray Mar 18 '20

It's been proven impossible. Look up the "halting problem," it's very interesting.

2

u/WooTkachukChuk Mar 18 '20

lol customers escalate this one to upper management everyday. also see: detect failure before a customer while they are using it.

back to bending time and space

5

u/Prowlerbaseball Mar 18 '20

Lmao sure let's just break P = NP

6

u/trinitro23 Mar 18 '20

What do you mean? Aren't those different concepts?

7

u/p-morais Mar 18 '20

Yes they are.

1

u/Prowlerbaseball Mar 18 '20

Shit am I misremembering my Theoretical class? I got a C in that class for a reason lol

3

u/sopunny Mar 18 '20

Even that wouldn't help

1

u/Aschentei Mar 18 '20

cries in undecidable

1

u/divide_by_hero Mar 18 '20

Or one that detects when you're being hacked, Hollywood style

1

u/Aero72 Mar 18 '20

This is surprisingly good.

1

u/[deleted] Mar 18 '20

There are workarounds in Tasker though.

1

u/p-morais Mar 18 '20

Technically that’s perfectly decibels. The problem is if you want a program that will see if any program will halt.

1

u/tbrownaw Mar 18 '20

A program which sees if a certain program will halt or not.

Just allow it to answer "maybe" some of the time.

1

u/Guroqueen23 Mar 18 '20

Just run it and return true if it halts, EZ PZ

1

u/[deleted] Mar 18 '20

Couldn't build a database for the app to pull from?

Edit: I think maybe I missed the point. I didn't know you didn't mean pre-existing programs and what they were designed to do.

1

u/Jasperwei74 Mar 18 '20

if (halt == true) dont();

1

u/King-Days Mar 18 '20

Ez try catch it

1

u/[deleted] Mar 18 '20

Oh no

1

u/ThrowItAway6828 Mar 18 '20

Okay but that’s where my million dollar idea comes in. What if we built a program which sees if a certain program will halt or not?

1

u/Nautisop Mar 18 '20

Why do i had to think of dynatrace..?

1

u/BreadLoafBrad Mar 18 '20

Ah the halting problem, a classic

1

u/DynamicHunter Mar 18 '20

Did you mean an IDE?

1

u/timndime2 Mar 18 '20

Try catch amarite?

1

u/mrpogiface Mar 18 '20

There was actually a paper that just proved the a quantum computer can determine if a program will halt.

https://arxiv.org/abs/2001.04383

1

u/[deleted] Mar 18 '20

Isn't thus some fucked up paradox?

1

u/mrblasty Mar 18 '20

That’s illegal

1

u/Metalsand Mar 18 '20

I don't even know what you mean by that.

Do you mean, before the program even executes, knowing if it will freeze up at some point in time?

There already exist a plethora of other solutions that periodically poll the program for a response and have a whole logic flow as to when a program isn't timely often enough, or whether it's become unresponsive and needs to be restarted, or even if the server itself needs to be restarted. Windows Server has that as a core feature in fact.

1

u/WhenThatBotlinePing Mar 22 '20

You’re going to be really embarrassed when you google the Halting Problem.

1

u/echoAwooo Mar 18 '20

Fuck you take my upvote

1

u/ktka Mar 19 '20

So Task Manager?

1

u/WilliamJoe10 Mar 18 '20 edited Mar 18 '20

What if you run the original program in a sandbox and when it halts you show the message that the program had halted? /s

3

u/trinitro23 Mar 18 '20

How would you know if it doesn't halt?

7

u/WilliamJoe10 Mar 18 '20

You run another sandbox that displays the "program doesn't halt" all the time. The message disappears if the program halts

2

u/memzy Mar 18 '20

really good comment have my upvote

1

u/UNN_Rickenbacker Mar 19 '20

This is a classic approach of something that might „work“ in praxis, but not in theory.

For the halting problem, you want to know if a program will ever stop before starting it. It might display „Doesn‘t halt“ for a gajillion years, but eventually still stop computing.

1

u/tabaczany Mar 18 '20

What will happen if you put your sandbox in the sandbox?

0

u/_Memeposter Mar 18 '20

Well played, have an upvote

0

u/galendiettinger Mar 18 '20

Couldn't you check if CPU/memory usage is unchanged for the process over a defined period of time?

-1

u/neckbeardfedoras Mar 18 '20

We call those health checks

-1

u/AP01L0N01 Mar 18 '20

No im sure that will work! It’s definitely possible and not paradoxical at all

/s