Answer on Question #62186 – Programming & Computer Science - MatLAB |Mathematica | MathCAD | Maple
A panel is conducting an interview on six candidates of different heights. If they are to put them in line, in how many ways can they arrange them in line such that no three consecutive candidates are in increasing order of height from front to back?
Solution.
Let xn - number of incorrect ranks of length n. We seek recurrence for xn.
Consider the length of the wrong rank n+1 (n>1). Let Z - the highest candidate in the line. It can stand on anywhere from 1 to n+1 (enumerate candidates left to right).
Assume that Z stands for (k+1)-th place (k=0,1,…,n); ie, to the left of Z are k candidates (which you can choose Cnk ways), and the right of Z are the remaining n−k candidates.
Note that the left of Z is the length of the k rank wrong, but not arbitrary, as such, whose penultimate candidate X above the last candidate Y (otherwise the candidates X, Y and Z will increase on standing). It is clear that these ranks is half (because of penultimate candidate if higher than last; so we need to take not all xk - only with this condition) the total number of irregular ranks of length k; therefore, to the left of Z can build 2xk ranks. To this was true for k=0 and k=1 (one rank in both cases), we assume x0=x1=2.
Similarly, the right from the wrong Z is a row of length n−k, but not arbitrary, and this, in which the second candidate above the first. Such ranks will be 2xn−k.
It remains to note that k candidates left by Z can select Cnk means (and for each method is uniquely selected n−k to the right of candidates Z). Thus, if Z stands for k-th position, the number is still incorrect ranks
Cnk⋅2xk⋅2xn−k=41Cnkxkxn−k.
Summing over k, we find the number of ranks of irregular length n+1:
xn+1=41k=0∑nCnkxkxn−k(n=1,2,…;x0=x1=2).
So, for n=6, there will be incorrect lines:
x6=41k=0∑5C5kxkx5−k=41(2x5+10x4+10x2x3+10x3x2+10x4+2x5)==41(4x5+20x4+20x2x3)=x5+5x4+5x2x3x2=41(4+4)=2x3=41(2x2+8+2x2)=41(4+8+4)=4x4=41(x0x3+3x1x2+3x2x1+x3x0)=41(2x0x3+6x1x2)==41(16+24)=440=10x5=41(x0x4+4x1x3+6x2x2+4x3x1+x4x0)==41(2x0x4+8x1x3+6x22)=41(40+64+24)=4128=32x6=x5+5x4+5x2x3=32+50+40=122
The lines, which are correct for us:
6!−x6=720−122=598.
Answer: 598.
http://www.AssignmentExpert.com