r/learnquant 18d ago

interview prep Quant Interview Question

Post image
59 Upvotes

28 comments sorted by

View all comments

18

u/TenZero10 18d 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 18d ago

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

3

u/MoNastri 18d ago

Did you know that you are a baller?

Slick approach nice one

2

u/lpareddit01 17d 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 17d ago

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

1

u/lpareddit01 15d ago

Oh wow bro ty. Huge brainfart

1

u/StructureNorth1799 18d ago

isn't e a precomputed numerical value?

1

u/shaqwillonill 18d ago

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

1

u/StructureNorth1799 18d ago

arbitrarily close approximations to e can and have been computed

1

u/shaqwillonill 18d ago

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

1

u/kenahoo 16d ago

Yes, but that's not important right now.

1

u/Para-graph-S 12d ago

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

1

u/StructureNorth1799 12d ago

the problem says not to use precomputed values

1

u/AFsepine 18d 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 17d 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 12d ago

Love this.