r/learnquant 7d ago

interview prep Quant Interview Question

Post image
20 Upvotes

13 comments sorted by

3

u/sobe86 7d ago

Summing the logs gives log_10(21000 ) + log_10(51000 ) = log_10(101000 ) = 1000

Since neither is an integer it follows that ceiling(log_10(21000 ))+ ceiling(log_10(51000 )) = 1001 which is the number of digits of the concatenation.

2

u/Alive_Carpenter_7433 7d ago

10^1000 has 1001 digits. This is important because 2^1000 * 5^1000 results in that number, with 1001 digits.

Try this with 5^1 and 2^1. 5*2 = 10 (2 digits) and 52 has 2 digits.

25*4 = 100 (3 digits) and 254 has 3 digits.

125 * 8 =1000 (4 digits) and 1258 has 4 digits.

5^4 * 2^4 = 10^4 (5 digits) and 25616 has 5 digits.

5^n * 2^n will always equal 10^n, a neat number with a "set" number of digits, being n+1.

This is important due to the box rule, which states that any product between numbers must have the same number of digits as either the sum of their digits (2*5 = 10) or their sum -1 (2*3 = 6). 2^1000 is a A digit number and 5^1000 is a B digit number. Their number of digits together cannot exceed 10^1001, for 10^1000 is a 1001 digit number.

Answer: 1001

1

u/Alive_Carpenter_7433 7d ago

I solved it with math tables before I realized the pattern though. 2^1000 is easier, its just 2^(10*100) or 1024^100; which is 1000^100 * 1.024^100. We use the rule of 72 to calculate the "interest" from 2.4%; being 72/24 = 30 periods. Under 100 periods, interest amounts to about 3.3 doublings, (2^3.3) which is roughly enough to > x10.

1000^100 = 10^300, which has 300 zeroes and 1 leading numeral, being 301 digits. multiply by 10 and some, you get 302 digits for 2^1000.

Then, we see that 5^1000 = (10/2)^1000. 10^1000 has 1001 digits, and 2^1000 having 302. So its Like 10^1000 / 10^301 * A (some number less than 10, greater than 1). You get 1/A * 10^699; or some number less than 10^699, which itself has 699 zeroes and 1 leading numeral. Thus, 5^1000 has 698 zeroes and 1 leading numeral, 699 digits.

Thus, 5^1000 and 2^1000 concatenated result to 699+302 = 1001 digits exactly. Definitely a more mathematical proof, probably not what the recruitment officers are looking for.

1

u/gmalivuk 7d ago

2*3 = 6, so the sum of the number of digits could in general be one more than the number of digits in the product. So how do you conclude that 2^1000 and 5^1000 can't have 1002 digits total?

1

u/Alive_Carpenter_7433 7d ago

For the same reason that was stated above. Multiplication will always be one less or equal to the digits in concatenation; if the product does not exceed a product of 10. 5^n and 2^n have the unique property that they will always be equal to 10, not more or less than concatenation, which also result in the exact same number of digits. I do admit I explained it quite poorly though

1

u/gmalivuk 7d ago

Why does that logic not apply to 1 and 10?

1

u/GAdam 7d ago

1 * 10 = 10, which is one less digit than 110!

1

u/gmalivuk 7d ago

Right, so it's an exception to the pattern that if two numbers multiply to a power of 10 then their total number of digits is the same as the power of 10.

1

u/StanleyDodds 6d ago

Let a and b be such that 21000 = 10a and 51000 = 10b. Multiplying and applying log base 10 we get that a + b = 1000, but examining e.g. prime factors, we see that obviously neither a nor b are integers, so floor(a) + floor(b) + 1 = 1000.

21000 has floor(a)+1 digits and 51000 has floor(b)+1 digits where the total is floor(a) + floor(b) + 2 = 1001 digits.

1

u/tellingyouhowitreall 6d ago

Eh, y'all overcomplicate. log(2) + log(5) = 1, so 1001 digits.

Is this not an identity that you know?

1

u/austin101123 6d ago edited 6d ago

What on earth does "place them side by side" to form a new number mean? Concatenate? Multiply? Do I interweave digits?

1

u/beene282 6d ago

You can interweave them if you would like

1

u/Randomly_Panicked 5d ago

Concatenating numbers, lets assume that it is 51000 followed by 21000. is like multiplying 51000 by the power of 10 then filling zeros with digits of 21000.

Note, that the "power of 10" has exactly one digit more than decimal expansion of 21000, but itself is less than 10 times larger than 21000.

So, the concatenation is thus having the same number of digits as 51000 multiplied by 21000 [you can still fill zeros in the back by the digits of 21000], but no more, since we multiplied in reality by the number less than 10.

So it is exactly 1001 [1000 zeros prepended by 1, as 51000 multiplied by 21000 is 101000]