Recent content by pathfinder

  1. pathfinder

    random intervals

    The totol number ofpossible pairs (i.e the sample set ) :> 2010C2 *2008C2 * 2006C2 ..... 4C2 * 1 If one pair has to intersect all the other intervals (I assume it is (1,2010) ), we can have 1004 other distinct pairs , this can be done in : 2008C2 * 2006C2 .... 4C2 *1 The probability is...
  2. pathfinder

    Markov Chain Question

    @Tstone....draw a binary tree you will get the right answer ;)
  3. pathfinder

    Markov Chain Question

    4/7 is the correct answer 4/9 + 2/9 (4/9) + (2/9)^2 *(4/9) + 4/9 *(2/9)^3 ..... 4/9 ( 1+ 2/9 + (2/9)^2 ....) i.e 4/7
  4. pathfinder

    Bond Pricing

    You can find out the bond price using bootstrapping Let X be the bond price of second Bond and C be the cupon and P the face value of the Bond. Five year forward rate be f5 and spot rate be r5 10 year discount factor is D = ( 1 / ( (1+f5)^5)* ((1+r5)^5) ) X = C( 1/Y1 + 1/Y2^2...
  5. pathfinder

    two twos

    5= sqrt( .2 ^ -2)
  6. pathfinder

    QuantNet Coding Project

    The answer is 997651 which is the sum of 543 consecutive prime numbers from 7,11 to 3931 Here is the code in Perl print "Enter the number(Example:1,000,000):"; chomp($max=<stdin><stdin>); print "\n"; @pr=(); my $index; my $max_sum=0; my $max_num=0; sub isPrime { my $n= shift; if($n eq...
  7. pathfinder

    threading question

    you could check the status of push thread ...before doing the pop and do a forceful notify in thread1 if push has been terminated void pop(Data& popped_value) { boost::mutex::scoped_lock lock(m_mutex); bool qWasEmpty=false; while (m_queue.empty()) //block while queue is empty {...
  8. pathfinder

    best c ++ compiler?

    If you are using Linux then go for VI . I'v been using vi for more than 2 years , no IDE comes close to it
  9. pathfinder

    Webinar:Using MATLAB to Develop Financial Models

    The webinar gives good info on basics of Matlab and development of financial models http://www.mathworks.in/webex/recordings/finmodels_011508/index.html The complete list of recorded webinars on computational finance can be found in the link below...
  10. pathfinder

    QuantNet Coding Project

    Solution for problem 267 ---------- Post added at 11:50 PM ---------- Previous post was at 11:31 PM ---------- Here is the solution : Answer: f=0.13, Probability is 0.999992836187 (I want to play this game :D ) //I've used C++ ===========================================================...
  11. pathfinder

    QuantNet Coding Project

    oops how can I forget problem 3 ;) Solution to problem 3 ====================================== Problem 3 The prime factors of 13195 are 5, 7, 13 and...
  12. pathfinder

    QuantNet Coding Project

    solution for problems 1 ============================================================= Problem 1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the...
  13. pathfinder

    Math Prorgramming Interview Question

    this should solve the problem...this will work for any data type int,float,char ....etc #include<iostream.h> #define SIZE(x) (sizeof(x)/sizeof(x[0])) template <class t> int checkrange(t* a ,int n){ t z=1; for(int i = 0 ; i< n; i++) { z=a[i]*z...
  14. pathfinder

    Few interesting C++ questions

    1) Malloc is a function/ new is an operator, constructors cannot be evoked with malloc 2) memset can be used if a) if is a base class constructor cannot be used a) in derived class constructor ,because the virtual table will be cleared after memset 3) b) data member ...if sizeof is...
  15. pathfinder

    Baruch MFE

Back
Top