GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  TCS  >  Quantitative Aptitude

 Print  |  
Question:  1.If g (0)=g (1)=1
And g (n)= g (n-1) + g (n –2) find g (6);

tell me the solution




July 07, 2008 04:38:58 #7
 su2008   Member Since: July 2008    Total Comments: 3 

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n –2) find g (6);tell me the solution
 
g(5)=g(4)-g(3)
           = -1-(-1)
          =  -1+1
          =  0
 

g(4)=g(3)-g(2)
           = -1-0
           = -1        

g(3)=g(2)-g(1)
          = 0-1
          = -1       

g(2)=g(1)-g(0)
          =1- 1
          =0


g(6)=g(5)-g(4)
         =0 -  (-1 )
        =0+1
         =1      
     

 

Back To Question