NEIGHBOUR DIGITS

Using the digits 0,1,2,3,4 find the number of 10 digit sequences that can be formed with the difference between any two consecutive digits equal to 1. CLARIFICATION:A sequence may start with 0.Look i said sequence not numbers.... Hope u will enjoy solving the problem :)


The answer is 648.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Rajdeep Brahma
Apr 3, 2018

See if u replace x by (4-x) then u get a valid sequence. So let the no. of numbers of length n starting with 0 and 1 be P(n) & Q(n) respectively . So the no. of digits starting with 4 is P(n) and 3 is Q(n) too right??(1st Logic!!).Now a no. beginning with 2 has 1 or 3 as the next neighbour and so no. of such sequences(obviously of length n) is 2Q(n-1).Ok now a no. starting with 0 must have 1 and a no with 4 must have a no. 3 next....So we can claim P(n)=Q(n-1) right?? Ok now total number of such sequences is X(n)= P(n)+Q(n)+(2Q(n-1))+P(n)+Q(n)...(Each no. begins with 0/1/2/3/4...hence their sum).Ok using previous results X(n)=2P(n)+2Q(n-1)+2Q(n)=2Q(n)+4Q(n-1).Ok Look!! Q(n)=n length no. starting with 1=(n-1) lenth no. starting with 0 or 2=2Q(n-2)+P(n)=3Q(n-1)...Ok now it is mostly done....X(n)=2Q(n)+4Q(n-1)=2.3Q(n-2)+4.3Q(n-3)=......Go on reducing...Q(2)=2(10&12)&Q(1)=1....Finally u arrive Q(10)=2X3X3X3X3XQ(2)+4X3X3X3X3XQ(1)=648. ANS :)

Indeed, we can show that P ( 2 n + 1 ) = 2 × 3 n 1 P ( 2 n ) = 3 n 1 Q ( 2 n + 1 ) = 3 n Q ( 2 n ) = 2 × 3 n 1 \begin{array}{rclcrcl} P(2n+1) & = & 2\times3^{n-1} & \hspace{2cm} & P(2n) & = & 3^{n-1} \\ Q(2n+1) & = & 3^n & & Q(2n) & = & 2 \times 3^{n-1} \end{array} and so the total number of sequence of length n n is X ( n ) = 2 P ( n ) + 2 Q ( n ) + 2 Q ( n 1 ) X(n) = 2P(n) + 2Q(n) + 2Q(n-1) , and hence X ( 2 n + 1 ) = 14 × 3 n 1 X ( 2 n ) = 8 × 3 n 1 X(2n+1) \; = \; 14 \times 3^{n-1} \hspace{2cm} X(2n) \; = \; 8 \times 3^{n-1} for any integer n 1 n \ge 1 . Thus X ( 10 ) = 8 × 3 4 = 648 X(10) = 8 \times 3^4 = 648 .

Mark Hennings - 3 years, 2 months ago

Log in to reply

Exactly thats what i meant..!!

rajdeep brahma - 3 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...