r/ProgrammerHumor • • Jul 07 '17

Can't really wrap my head around this one

Post image
32k Upvotes

524 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 07 '17

[deleted] — view deleted comment

92

u/CoinForWares Jul 07 '17 edited Jul 07 '17

O(O(n))

78

u/DiddiZ Jul 07 '17

That's just O(n)

63

u/Cocomorph Jul 07 '17

Whether I stab you depends on if this is a 300 level or a 500 level course.

15

u/captainAwesomePants Jul 07 '17

I'm guessing you stab them if they're in the graduate course, right?

29

u/Clockwork_Octopus Jul 07 '17

Nope. Got to weed out the weak ones early.

19

u/Cocomorph Jul 07 '17

No, I stab them in the 300 level course, where I get to be tediously pedantic to the point of psychopathy if I want to be.

Just kidding; it is beneficial sometimes, though.

18

u/AskMeIfImAReptiloid Jul 07 '17 edited Jul 08 '17
  • O(n) is the set of functions that grow as fast as n
  • O() can be seen as a function that gets formula and returns a set.
  • If we apply this function to every element in the first set [ O(O(n)) ] we should get a set of sets of functions
  • ==> O(O(n)) = {O(s) : s is an element of O(n)}
  • ==> O(O(n)) = {O(s) : s does not 'grow faster' than n}
  • O(O(n)) = {O(n), O(sqrt(n)), O(log(n)), O(1)},O(0),...}
  • O(O(n)) is a subset of the Superset power set of O(n)

Is this correct?

10

u/Cocomorph Jul 08 '17

One should be careful piling abuses of notation on top of each other unless one is clear about what one is doing.

Morally, O(O(n)) is in fact just O(n) here, but it is important to understand just how badly the notation is being abused. It's best to go back to the formal definition, where O() isn't defined in isolation, but rather describes a relationship between two functions, and work from there if one wants to be careful.

→ More replies (10)
→ More replies (22)
→ More replies (1)

32

u/BEST_RAPPER_ALIVE Jul 07 '17
var O = function(n){
    console.log('Hello, world!');
}
var n = 'n';
console.log(O(n));

0

u/[deleted] Jul 08 '17

[deleted] — view deleted comment

13

u/viper4034 Jul 08 '17

That's the most honest thing I've read today

→ More replies (7)
→ More replies (1)

16

u/sldyvf Jul 07 '17

)

16

u/TalenPhillips Jul 07 '17

(

0

u/[deleted] Jul 07 '17

[deleted] — view deleted comment

9

u/[deleted] Jul 07 '17

15

u/TalenPhillips Jul 07 '17

(

{

24

u/xtr0n Jul 07 '17

JFC. Can the mods add a "mismatched parens" trigger warning?

→ More replies (6)

14

u/[deleted] Jul 08 '17

On second thought O(n ↑↑↑ n) might just be better

How about O(n ↑n n)?

9

u/ASAP_PUSHER Jul 07 '17

I need to know more math... just so I can giggle at the mathumor

36

u/Cocomorph Jul 07 '17

Q. What's a polar bear?
A. It's a rectangular bear after a coordinate transform.

Q. What's the value of a contour integral around Western Europe?
A: Zero, because all the Poles are in Eastern Europe.
Addendum: Actually there are some Poles in Western Europe, but they're removable.

Q. Why did the mathematician name their dog Cauchy?
A. Because he left a residue at every pole.

Q. What's purple and commutes?
A. An abelian grape.

Q. What's purple, commutes, and is worshipped by a limited number of people?
A. A finitely venerated abelian grape.


I feel bad, so see also Hiawatha Designs an Experiment, which is genuinely great. See also also Finite Simple Group of Order Two.

13

u/Salanmander Jul 08 '17

It's a rectangular bear after a coordinate transform.

Please. You should clearly start with a cartesian bear.

Edit: also
Q: What do you get when you cross a mosquito with a mountain climber?
A: Nothing. You can't cross a vector with a scalar. (This one works better spoken so that the spelling isn't a problem.)

→ More replies (2)
→ More replies (6)
→ More replies (10)
→ More replies (29)