Vietnam Quantitative Finance Society

User Name
Password
Reply
10-18-2007, 09:47 AM   #1
Khoa Tran

Core Member
Master Sergeant
 
Khoa Tran's Avatar
 
Join Date: Jun 2007
Posts: 211
Thanks: 28
Thanked 19 Times in 16 Posts




Default Interview Questions Reloaded

Có lẽ sau chiêu sư tử hống n\sin(n) (link) của Kim Mao Sư Vương Ngô Quang Hưng, quần hùng lăn ra giãy đành đạch, không còn ai hứng thú thi triển võ công nữa. Thôi thì chúng ta lại viết tập mới với mấy câu hỏi dễ thương hơn.

1. Let W_t be a Brownian motion. What is \mathbb{E}[W_t^6]?

2. How do you compute \int_0^\infty e^{-3x^2}dx

3. (from YADD) After each second, an insect may: either die, or survive, or split into 2, or split into 3 (each with probability 0.25). Suppose that there's 1 insect at the beginning of the day, what is the probability that the whole population dies at the end of the day?

4. (Programming) Given 2 variables a and b. How do you swap the values of a and b without using any extra memory?

5. (Blog KHMT) Giả sử

(mũ x đến vô cùng). Vậy x bằng bao nhiêu? Ví dụ, ta có thể lý luận như sau. Dễ thấy rằng . Do đó , hay . Nhưng nếu thì, theo lý luận trên, cũng dẫn đến . Sao lạ thế? à?

Last edited by Khoa Tran; 10-18-2007 at 09:53 AM.
Khoa Tran is offline Reply With Quote
10-19-2007, 06:49 AM   #2
YADD

Core Member
Corporal
No Avatar
 
Join Date: Jul 2007
Posts: 97
Thanks: 7
Thanked 15 Times in 13 Posts




Default

1) A cute trick is compute

\int_0^\infty e^{-a\frac{W^2}{2}}dW

then take drivative w.r.t. a thrice.

3) It is a bacterium, Khoa. An insect cannot duplicate that fast. The tougher part of the puzzle is justify the solution (i.e., discarding the probability = 100% answer). A clue is realted to puzle 5) below.

5) Let me repharse the question. Define y = x^{x^{x^{x^{...}}}} (infinite times). For x = \sqrt{2}, find y.

The paradox comes about like this: Rewrite  y = x^y ; then with x=\sqrt{2}, both  y=2 and  y=4 satisfy this equation.

The paradox is resolved as follows: Define  y_n = x^{x^{x^{x^{...}}}} (n times), equivalently  y_{n+1} = x^{y_n}. Plot y_{n+1} against y_n on a two-dimensional axes, the curve (for  x=\sqrt 2) is a monotonically increasing function crossing the 45-degree line at two points A (y=2) and B (y=4). The slope of the curve at A is smaller than unity [one], so A represents an attractive (stable) fixed point. The slope at B point is greater than unity => B is a repulsive (unstable) fixed point. So  y_\infty \rightarrow 2, while point B (y=4) is not attainable.

[y=4 is a spurious root since some "non-linearity" was introduced in rewriting the definition of y.]

An aside observation from the resolution: The maximum value of x such that y = x^{x^{x^{x^{...}}}} (infinite times) is well-defined is  x^\star = e^{\frac{1}{e}}, corresponding to  y = e. Beyond  x^\star, y explodes.
__________________
I did it my way - Frank Sinatra
YADD is offline Reply With Quote
The Following User Says Thank You to YADD For This Useful Post:
Khoa Tran (11-01-2007)
10-19-2007, 03:56 PM   #3
shinichi9htv

Member
Sergeant
No Avatar
 
Join Date: Jul 2007
Posts: 147
Thanks: 13
Thanked 7 Times in 6 Posts




Default

4) a = a+b, b = a -b, a = a -b
shinichi9htv is offline Reply With Quote
10-21-2007, 11:35 PM   #4
YADD

Core Member
Corporal
No Avatar
 
Join Date: Jul 2007
Posts: 97
Thanks: 7
Thanked 15 Times in 13 Posts




Default

Follow-up with question (5)...

The function  f(x) = x^{x^{x^{x^{...}}}} (\infty\ times) is well-defined only in the interval  x \in \[e^{-e},e^{\frac{1}{e}}\] . The lower bound  e^{-e} comes about when the curve previously described crosses the 45-degree line at  -1 slope. Below the lower bound, a bifurcation occurs (no chaos).

Back to the original question, interestingly, for  y>e, e.g.,  y=10, although the equation  y=x^y yields a root  x=10^{\frac{1}{10}}, the root is completely spurious! This value of y is not attainable.
__________________
I did it my way - Frank Sinatra
YADD is offline Reply With Quote
The Following User Says Thank You to YADD For This Useful Post:
Khoa Tran (11-01-2007)
10-25-2007, 09:29 PM   #5
nguyenxuanson

Core Member
Corporal
No Avatar
 
Join Date: Aug 2007
Posts: 58
Thanks: 1
Thanked 1 Time in 1 Post




Default

4/ what happen if a+b is out of range of the data type?
nguyenxuanson is offline Reply With Quote
10-25-2007, 10:03 PM   #6
drew

Member
Corporal
No Avatar
 
Join Date: Jul 2007
Posts: 58
Thanks: 0
Thanked 10 Times in 10 Posts




Default

The answer should be something along the line of:
a = a ^ b
b = a ^ b
a = a ^ b
And oh yes, a hypothetical follow-up question would be "what about signed numbers, ANSI C convention 'n stuff ?", at which point I would stand up, stab the interviewer, hypothetically of course, with my hypothetical pencil, of course !
drew is offline Reply With Quote
10-25-2007, 10:05 PM   #7
drew

Member
Corporal
No Avatar
 
Join Date: Jul 2007
Posts: 58
Thanks: 0
Thanked 10 Times in 10 Posts




Default

Btw hopefully I'll be able to get back next week with a solution to the n sin(n) question, it shouldn't be that hard !
drew is offline Reply With Quote
11-07-2007, 11:48 PM   #8
nguyenxuanson

Core Member
Corporal
No Avatar
 
Join Date: Aug 2007
Posts: 58
Thanks: 1
Thanked 1 Time in 1 Post




Default

in this question, we have a bar and we will break it in three sections by two cuts. What is the probability that the three sections form a triangular:
1/ if we first cut the bar in two sections (the position is uniformly distributed) and then choose the section (normally the longer section) where you will cut it (the position is uniformly distributed).
2/ you cut the bar at two places simultaneously (the positions ảe uniformly distributed).
nguyenxuanson is offline Reply With Quote
11-13-2007, 06:39 AM   #9
shinichi9htv

Member
Sergeant
No Avatar
 
Join Date: Jul 2007
Posts: 147
Thanks: 13
Thanked 7 Times in 6 Posts




Default

Có 1 câu mới nhớ ra, hồi xưa bị thằng bạn đố, khó phết.

Có 124 con bài (gộp 2 bộ bài lại) và 2 nhà toán học. 1 người thứ 3 cầm lấy bộ bài, lấy ra 5 con bất kì, đưa cho 1 nhà toán học. Ông này ngồi xem xem tính toàn một thôi một hồi, đút lại 1 con vào bộ bài và xếp 4 con ngay ngắn trên bàn. Nhà toán học kia đứng lên nhìn 4 con bài, rồi tìm ra con bài thứ 5 còn lại. Hỏi ông ta làm thế nào?
shinichi9htv is offline Reply With Quote
11-13-2007, 06:42 PM   #10
nguyenxuanson

Core Member
Corporal
No Avatar
 
Join Date: Aug 2007
Posts: 58
Thanks: 1
Thanked 1 Time in 1 Post




Default

given a Brownian motion start from 0 W_{t} we define the time change
A(t)=\int_{0}^{t}e^{W_{s}+\nu s} ds
give one presentation of the variable W(A(t)).
nguyenxuanson is offline Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Binomial Pricing Model questions trung55 Student Lounge 0 10-03-2007 11:51 PM
Discrete Math questions Khoa Tran Interview Questions 5 08-17-2007 06:52 AM

Save or bookmark this site with: Del.icio.usStumble It!AddThis.com
All times are GMT +7. The time now is 03:34 AM.
Powered by vBulletin Version 3.7.2