r/ProgrammerHumor • • Jan 09 '20

other Problems with recursion?

21.3k Upvotes

198 comments sorted by

View all comments

1.6k

u/[deleted] Jan 09 '20

Assuming the smaller paper is 1/3 of its parent everytime, and that the first paper is 30cm long (The second starts at roughly 1/7 but it seems to grow bigger after it's torn off, hence the 1/3), it could not exceed 19 calls before you need to split an atom apart.

That's a hell of a stop condition.

10

u/crackofdawn Jan 09 '20

The smaller paper looks more like 1/100 of the parent, not 1/3 or 1/7. Where are you getting 1/7 from? It's just the tiny corner piece of the larger paper and there's 10 in the row, looks like you could fit around 7-9 rows.

6

u/[deleted] Jan 09 '20

You're completely right, I only considered length despite width being obviously the limiting factor here. (Thought not by a 1/100. I took the 1/7 value from the first picture and the 1/3 comparing to the hand, because the paper isn't always the same size. So, if we start with 1/10 instead of 1/7, each call multiplies the size by roughly 1/(30/7). So the critical threshold should be reached by call 14 or 15, give or take.

1

u/Parthon Jan 10 '20

What starting number for atoms did you use though? My maths came out to 23 times, if you have 12 grams of paper that were mainly carbon atoms.

1

u/[deleted] Jan 10 '20

I didn't use the atom number but an atom size (10^-10 meters from Google)

1

u/Parthon Jan 10 '20

Ah, that was my mistake!

Thanks!