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
Go To First  |  Previous Question  |  Next Question 
 Quantitative Aptitude  |  Question 25 of 45    Print  
1.If g (0)=g (1)=1
And g (n)= g (n-1) + g (n –2) find g (6);

tell me the solution

  
Total Answers and Comments: 7 Last Update: July 28, 2008     Asked by: shylaja 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 03, 2006 19:56:14   #1  
Kayalvizhi        

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n ...

Given g(0) = g(1) = 1.

To find: g(6)

g(n) = g(n-1) + g(n-2)

g(2) = g(1) + g(0) = 1 + 1 = 2

g(3) = g(2) + g(1) = 2 + 1 = 3

g(4) = g(3) + g(2) = 3 + 2 = 5

g(5) = g(4) + g(3) = 5 + 3 = 8

g(6) = g(5) + g(4) = 8 + 5 = 13.

7


 
Is this answer useful? Yes | No
October 04, 2006 03:24:28   #2  
venkatesh        

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n ...
8
 
Is this answer useful? Yes | No
October 08, 2006 02:32:12   #3  
sreetama dutta        

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n ...
which is the answer ..13 or 7?.if 7 is the answer how do u get that- counting the total steps or else?
 
Is this answer useful? Yes | No
October 17, 2006 23:52:39   #4  
Santosh        

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n ...

Answer is 13 because

g(6)=g(5)+g(4)

=(g(4)+g(3))+(g(3)+g(2))

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

=(((g(2)+g(1))+(g(1)+g(0)))+(g(1)+g(0))+g(1)))+((g(1)+g(0))+g(1)+(g(1)+g(0))

=((((g(1)+g(0))+(g(1)+g(0)))+(g(1)+g(0))+g(1)))+((g(1)+g(0))+g(1)+(g(1)+g(0))


 
Is this answer useful? Yes | No
January 21, 2007 06:28:37   #5  
Ram        

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n ...

The answer is 13.

It is based on method of recursion.


 
Is this answer useful? Yes | No
July 12, 2008 13:38:08   #6  
sai krish Member Since: July 2008   Contribution: 1    

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n –2) find g (6);tell me the solution
thirteen
 
Is this answer useful? Yes | No
July 28, 2008 04:38:58   #7  
su2008 Member Since: July 2008   Contribution: 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      

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape