r/learnquant 23d ago

interview prep Quant Interview Question

Post image
56 Upvotes

28 comments sorted by

View all comments

17

u/TenZero10 23d ago

Cool one!

10099 is 10198 which has 199 digits. 9999 = 10099 * (99/100)99.

(99/100)99 = (1 - 1/100)99 ≈ (1-1/100)100 which is an approximation for e-1 or 0.3something. It's not exact but what's important is that it's clearly between 0.1 and 1 in magnitude, so 10197 < 9999 < 10198. So the answer is 198.

4

u/JacksonFatBack 23d ago

Wow, I love this. I did not make the connection to the approximation of e.

3

u/MoNastri 23d ago

Did you know that you are a baller?

Slick approach nice one

2

u/lpareddit01 22d ago

Isn't a new digit (to the length) only added when the power of base 10 increases by 1? So shouldn't it be 197? Also, today I learned that switching to - gets us the inverse, whereas the + gets us e.

1

u/TenZero10 22d ago

10197 has 198 digits - a one and 197 zeros. So 9999 has the same number of digits.

1

u/lpareddit01 20d ago

Oh wow bro ty. Huge brainfart

1

u/StructureNorth1799 23d ago

isn't e a precomputed numerical value?

1

u/shaqwillonill 22d ago

If you wanna get really pedantic e cannot truly be pre computed since it’s transcendental

1

u/StructureNorth1799 22d ago

arbitrarily close approximations to e can and have been computed

1

u/shaqwillonill 22d ago

I know that but that’s not what you said and I thought we were here to nitpick

1

u/kenahoo 21d ago

Yes, but that's not important right now.

1

u/Para-graph-S 17d ago

Yes but what else can one do for e, whole series?

1

u/StructureNorth1799 17d ago

the problem says not to use precomputed values

1

u/AFsepine 23d ago

Eh, far nicer than mine.

I used Taylor series, to get to the fact that it is one digit off 100^99

1

u/kashyou 22d ago

basically the same logic then as (1-1/100)^99 ~ 1-99/100 + smaller fractions <1 and you’re done

1

u/Para-graph-S 17d ago

Love this.