some interview question

User avatar
Martingale
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Martingale »

Consider the following C program for producing Fibonacci numbers



Int Fibonacci(int n)



{ if (n <=011 n==1) return 1;



else  return Fibonacci(n-1)+Fibonacci(n-2);}



If for some large n, it takes 100 seconds to compute Fibonacci(n), how long will it take to compute Fibonacci(n+1), to the nearest second?
mouse's rat year resolution: score more
User avatar
Energetic
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Energetic »

162 seconds.
Quote me as saying I was misquoted.
User avatar
Martingale
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Martingale »

Kinda of (1+sqrt(5))/2 * 100 , right?
mouse's rat year resolution: score more
User avatar
Martingale
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Martingale »

what about this one? Suppose that 2 cylinders each with radius 1 intersect at right angles and their centers also intersect. What is the volume of the intersection ?
mouse's rat year resolution: score more
User avatar
Energetic
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Energetic »

a. You got it.



b. I certainly was able to solve this stuff in high school but now I'm afraid to get a headache in the process. Run a MC simulation Smiley
Quote me as saying I was misquoted.
User avatar
drews
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by drews »

Intersecting cyllinders problem can be solved by a very simple integration, google for 'Steinmetz solid'. Crossections of that object by 3 perpendicular planes are: 2 circles and a square
User avatar
Martingale
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Martingale »

Here is another one, consider X_t = m*t+ B_t where B is a standard Brownian motion, what's the probability of X_t hit 3 before it hit -5?  I know a very nice way of this for m=0, but for m<>0, is there a elegant answer?
mouse's rat year resolution: score more
User avatar
chiral3
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by chiral3 »

Martingale, that one was all you, considering your background.  Is the elegant way doob?
Nonius is Satoshi Nakamoto. 物の哀れ
User avatar
Martingale
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Martingale »

Yes, Doob' way, for m=0 you have a neat answer, but what about for m<>0?
mouse's rat year resolution: score more
User avatar
Energetic
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

some interview question

Post by Energetic »

Now, for the rest of us, doob it out, pls.
Quote me as saying I was misquoted.
Post Reply