this post was submitted on
436 points (66% like it)
891 up votes 455 down votes

AdviceAnimals

subscribe1,342,605 readers

4,139 users here now

For any hockey lovers out there check out /r/NHLMemes

Welcome to r/AdviceAnimals

Sound advice from animals anything!

Rules

  • We're here to have a laugh, don't get too serious.

  • Follow the general Advice Animal format. Two line setup or a pinwheel background

  • No reposts, if you didn't make it, don't post it.

  • No verticals or staredad comics. At all.

  • No posting memes you saw in real life.

  • Don't make memes about your friends in real life. Ever.

  • Shortened links (tinyurl, bit.ly, etc.) are not trusted by the spamfilter and will be automatically removed. Please refrain from using them.

Making Memes

Visit:

or use

  1. Please keep the 'advice' relevant to the character. If you're not sure, go to knowyourmeme.com.

  2. If you'd like to use AdviceAnimals in your comments, here's how.

Messaging the mods

  1. We are always happy to help. Please attach a link to the comments of your submission and a description of the question/problem you are having.

  2. If you can't see your submission in the new queue and think it has been filtered as spam, please double check that your new queue is ranked by new and not rising.

  3. If you still think it is in the spam filter, don’t delete your submission, message the mods instead. Deleting it will make the spam filter more likely to filter you next time you post.

  4. click here to message the moderators

  5. click here to request a new flair to be made

You might also enjoy:

Our Family

and Friends

Good Guy Gregs check the new queue


created by mesutima community for

reddit is a source for what's new and popular online. vote on links that you like or dislike and help decide what's popular, or submit your own! learn more ›

all 43 comments

[–]sw17ch 24 points25 points ago*

sorry, this has been archived and can no longer be voted on

Here's the thing, if the function was properly implemented, the recursion would eliminate to a tail call. No matter how much tail your momma has, said function should be able to calculate it.

Now, it might overflow the bounds of a machine word, in which case...

Either way, ಠ_ಠ

Edit: I made an example. Here it is on codepad: http://codepad.org/6SGGSI2d. I haven't verified that the compiler is actually eliminating the tail-call. You'll note that I gave it some dummy values: I tried to use your actual mother, but she broke the array initialization mechanics in C.

#include <stdint.h>
#include <stddef.h>
#include <stdio.h>

#define SO_MANY_FATS 6

typedef uint64_t momma[SO_MANY_FATS];

uint64_t how_fat_is_she_helper(momma a_momma,
                               size_t fat_count,
                               size_t index,
                               uint64_t so_far)
{
  if (index >= fat_count)
  {
    /* As if this branch will ever be reached. */
    return so_far;
  }
  else
  {
    return how_fat_is_she_helper(a_momma,
                                 fat_count,
                                 index + 1,
                                 so_far + a_momma[index]);
  }
}

uint64_t how_fat_is_she(momma a_momma,
                        size_t fat_count)
{
  return how_fat_is_she_helper(a_momma, fat_count, 0, 0);
}

int main(int argc, char * argv[])
{
  momma yo_momma = {1,2,3,4,5,6};

  printf("Yo momma is sooooo fat: %llu!",
    how_fat_is_she(yo_momma, SO_MANY_FATS));
  return 0;
}

[–]Ameisen 13 points14 points ago

sorry, this has been archived and can no longer be voted on

Exactly my thinking. Even past that, most modern compilers will simply eliminate the tail call as it is.

Now, if her mass in grams doesn't fit in a 64-bit unsigned integer... then she officially has more mass than the universe... suffice it to say... she IS the universe.

Dude, we're all in your mom.

[–]lengau 10 points11 points ago

sorry, this has been archived and can no longer be voted on

This is not true. The maximum size of a 64-bit unsigned int is 264, or approximately 1.8*1019. The mass of the universe (according to Wikipedia) is somewhere between 1050 and 1060 kg.

Using the equation 2n = m (where n is the bit width of the word and m is the mass of the universe), we would need a number somewhere between 160 and 200 bits wide to store the mass of the universe in grams as an int.

However, given that both the universe and your mother are so massive that such a precise measurement is all but impossible, it would probably (depending on precision) be reasonable to represent the mass of the universe as a single precision floating point number, given that its exponent can go up to 127.

Your mother would need double.

[–]Ameisen 2 points3 points ago

sorry, this has been archived and can no longer be voted on

This is true. I was using the wrong mass-of-the-universe calculation..

You would be better off using long double on x86 for precision purposes.

[–]Clydeicus 3 points4 points ago

sorry, this has been archived and can no longer be voted on

Your mother's mass is such that it would take a bus the size of a bus to transfer the value in any reasonable timespan.

[–]atorr 2 points3 points ago

sorry, this has been archived and can no longer be voted on

Now that is a geek insult.

[–]gameyharp 1 point2 points ago

sorry, this has been archived and can no longer be voted on

I have no idea what the fucking is going on here.

[–]cybercobra 0 points1 point ago

sorry, this has been archived and can no longer be voted on

That's geek humor in a nutshell for you: Let's laugh at the fact that the plebes don't know what learned/arcane stuff we're talking about.

[–]DannoHung 3 points4 points ago

sorry, this has been archived and can no longer be voted on

Yo mama's so fat, her mass in kilograms cannot be represented using an arbitrary precision integral type on a computer with 4 gigabytes of ram.

[–]mseesquared 5 points6 points ago

sorry, this has been archived and can no longer be voted on

Yo mama's so fat, the probability of her getting a heart attack in the next 10 years is a boolean value greater than 0.

[–]eltommonator 1 point2 points ago

sorry, this has been archived and can no longer be voted on

Can all recursive functions be implemented as tail recursive? Even non-trivial ones with multiple recursive calls in the function or functions that recursively call each other?

[–]david72486 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Tail call elimination takes advantage of the case where you're just returning the result of a recursive call, which means you don't really need all the context of your local variables anymore (and therefore can remove the frame from the stack safely). If you're making multiple recursive calls in a function, then you can't eliminate the one that happens before the return statement, since you might need the local variables.

I would think any function can be converted to a non-recursive method, or to a tail-call function, but not if you preserve the original recursive strategy.

[–]thankyousir 13 points14 points ago

sorry, this has been archived and can no longer be voted on

Rest in Peace.

[–]bheesham 4 points5 points ago

sorry, this has been archived and can no longer be voted on

Thank you sir.

[–]monstereddit 7 points8 points ago

sorry, this has been archived and can no longer be voted on

Your momma must have been written in C, coz she ain't got no class.

[–]cannedmath 3 points4 points ago

sorry, this has been archived and can no longer be voted on

Ouch!!

[–]RagnarIV 2 points3 points ago

sorry, this has been archived and can no longer be voted on

We all know, your mother is so fat that in an infinite 3 dimensional plane, the probability of her occupying any point is 1.

[–]RedRackum 1 point2 points ago

sorry, this has been archived and can no longer be voted on

I giggled

[–][deleted] 1 point2 points ago*

sorry, this has been archived and can no longer be voted on

Dennis is using hosted Inferno on NT in that picture btw. :) He is running http://en.wikipedia.org/wiki/Acme_\(text_editor\) Acme the text editor by Rob Pike.

The screenshot on Wikepedia is my screen :)

[–]glennrosehv 3 points4 points ago

sorry, this has been archived and can no longer be voted on

repost. i caught ya

[–]TaintedSquirrel 0 points1 point ago

sorry, this has been archived and can no longer be voted on

[–]elvinboy 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Definitely showed that guy. He won't even know what hit him!

[–]cybercobra 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Yo mamma so fat, her weight would overflow a long long variable!

[–]helicopterhat 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Why not an intelligent insult?

[–]GFandango 0 points1 point ago

sorry, this has been archived and can no longer be voted on

I'm glad that I can understand and laugh at this joke

[–][deleted] 0 points1 point ago

sorry, this has been archived and can no longer be voted on

He should of uses tail recursion so it doesn't operate on the heap but on the stack. or just use iteration.

[–]ggalitz 0 points1 point ago

sorry, this has been archived and can no longer be voted on

RIP Dennis Ritchie (That's his picture?)

[–]FredL2 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Regardless, R.I.P. A fine man.

[–][deleted] 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Yeah, that's him.

[–]ggalitz 0 points1 point ago

sorry, this has been archived and can no longer be voted on

He was the ultimate geek. He did co-invent the C language. :O

[–][deleted] 0 points1 point ago

sorry, this has been archived and can no longer be voted on

And invented Unix.

[–]ggalitz 0 points1 point ago

sorry, this has been archived and can no longer be voted on

THE ultimate geek. RIP brah

[–]anonzzz 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Why would the function need to be recursive, just use a while condition to determine if her fatness has been calculated while logging the collected buffer to file using a max buffer variable to assure that her fatness is calculated in increments that are less than the amount of available ram.

[–]notbusyatall 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Your mother is so fat, she's too big to fit inside a variable type of double.

[–]hairyassandballs 0 points1 point ago

sorry, this has been archived and can no longer be voted on

oh cool has it been the standard month to repost?

[–]jacolantern 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Why make it recursive at all though? I mean, assuming we have a graph representing the molecules comprising your mom, we could perform any number of non-recursive walks over the graph's components and sum the weights of the molecules.
Sounds like its just a poor implementation to me.

[–]FredL2 0 points1 point ago

sorry, this has been archived and can no longer be voted on

Yes, both the function call overhead and memory usage would go through the roof, assuming it wouldn't overflow the stack first.

[–]New223 -4 points-3 points ago

sorry, this has been archived and can no longer be voted on

This needs to be moved to r/circlejerk.

[–]Kasatka -2 points-1 points ago

sorry, this has been archived and can no longer be voted on

Fucking brilliant

[–]sprinkledwithcheese -2 points-1 points ago

sorry, this has been archived and can no longer be voted on

Repost

[–]GuitarGuru253 -5 points-4 points ago

sorry, this has been archived and can no longer be voted on

The sad thing is, I know exactly what he means

[–]Babkock 2 points3 points ago

sorry, this has been archived and can no longer be voted on

Oh no! You know what recursion and stack overflows are! May God have mercy on your forever alone soul!

[–]eafkuor -1 points0 points ago

sorry, this has been archived and can no longer be voted on

u so smart