Thanks for a record breaking viewership this week…this is the maximum traffic I have had on the site ever since I started the puzzle! Many people sent the correct answer (which is 34 ways to do it). Some people gave a very elegant answer to the puzzle which include Amit Jain, Mohit Khare, Pratik Poddar and Vijay Venkat Raghavan – hats off to all of you! This puzzle was the origination of Fibonacci Series (en.wikipedia.org/wiki/Fibonacci_number) which is named after Fibonacci and documented this in 1202. However, this was originally found with music as its origin in 200 BC, but more formally articulated by Hemachandra in 1150 A.D. A link to the video from famous mathematician Manjul Bhargava, who in his interview with NDTV talked about it. https://www.youtube.com/watch?v=oCpdAPt7UOs Before describing the method with Fibonacci series, I want to outline the method that most people used. The correct answers here included Anirudh Baddepudi, Karan Sharma, Amit Mittal and Pallav Pandey. The logic to arrive at the answer (Using Mohit Khare’s answer): Possible combinations of A and B are in {8,0} , {6,1} , {4,2}, {2,3} and {0,4}. Corresponding to each , following are the number of ways to arrange As and Bs: {8,0} := 1 [ chose 8 from 8 ] {6,1} := 7 [ chose 6 from 7 ] {4,2} := 15 [ chose 4 from 6 ] {2,3} := 10 [ chose 2 from 5 ] {0,4} := 1 [ chose 0 from 4 ] So total is : 34 The more elegant way to solve this is using Fibonacci Series. Lets call F(8) the number of ways to solve the problem. If we think about it, F(8) can be derived from the sum of following: – All the ways in which F(6) can be done with a B appended at the end of it, and – All the ways in which F(7) can be done with an A appended at the end of it. Therefore F(8) = F(7) + F(6), which is essentially the Fibonacci series. We know that F(1) = 1 (only one A) and F(2) = 2 (either two As or 1 B). The series will look as follows: 1, 2, 3, 5, 8, 13, 21, 34…. Hope you all enjoyed the puzzle.

Recent Posts
Recent Comments
Archives
 June 2017
 May 2017
 April 2017
 March 2017
 February 2017
 January 2017
 December 2016
 November 2016
 October 2016
 September 2016
 August 2016
 July 2016
 June 2016
 May 2016
 April 2016
 March 2016
 February 2016
 January 2016
 December 2015
 November 2015
 October 2015
 September 2015
 August 2015
 July 2015
 June 2015
 May 2015
 April 2015
 March 2015
 February 2015
 January 2015
 December 2014
 November 2014
 October 2014
 September 2014
 August 2014
 July 2014
 May 2014
 April 2014
 March 2014
 February 2014
 January 2014
 December 2013
 November 2013
 October 2013
 September 2013
 August 2013
 July 2013
 June 2013
 May 2013
 April 2013
 March 2013
 February 2013
 January 2013
Categories
Meta