GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  Quantitative Aptitude
Go To First  |  Previous Question  |  Next Question 
 Quantitative Aptitude  |  Question 25 of 49    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: 10 Last Update: June 12, 2009     Asked by: shylaja 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Kayalvizhi
 

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



Above answer was rated as good by the following members:
Prashant202185
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 | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
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 | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
September 18, 2008 00:02:37   #8  
renesha Member Since: September 2008   Contribution: 2    

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

g(3) g(3-1) + g(3-2) g(2) + g (1) 2 + 1 3

g(4) g(4-1) + g(4-2) g(3) + g (2) 3 + 2 5

g(5) g(5-1) + g(5-2) g(4) + g (3) 5 + 3 8

g(6) g(6-1) + g(6-2) g(5) + g (4) 8 + 5 13

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 24, 2008 04:41:11   #9  
Prashant202185 Member Since: September 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
answer will be 13

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

g3 g2+g1 2+1 3

g4 g3+g2 3+2 5

g5 g4+g3 5+3 8

g6 g5+g4 8+5 13 ans

 
Is this answer useful? Yes | No
June 12, 2009 12:16:37   #10  
yogeswari.km Member Since: June 2009   Contribution: 5    

RE: 1.If g (0)=g (1)=1And g (n)= g (n-1) + g (n –2) find g (6);tell me the solution
g(6) g(5)+g(4) similarly g(5) g(4)+g(3) 13
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape