#A72 INTEGERS 6 (26) ALIE AND BOB GO TO DINNER: A VARIATION ON MÉNAGE Vladmr Shevelev Department of Mathematcs, Ben-Guron Unversty of the Negev, Beer-Sheva, Israel shevelev@bgu.ac.l Peter J.. Moses Moparmatc ompany, Astwood Bank, Nr. Reddtch, Worcestershre, England mows@mopar.freeserve.co.uk Receved: 2/23/5, Revsed: 6/2/6, Accepted: /2/6, Publshed: //6 Abstract We gve a soluton to a varaton of the classc ménage problem where a fxed couple Alce and Bob are already seated.. Introducton In 89, Lucas [2] formulated the followng ménage problem : Problem. To fnd the number M n of ways of seatng n 2 male-female couples at a crcular table, lades and gentlemen n alternate postons, so that no husband sts next to hs wfe. After seatng the lades n 2n! ways we have M n = 2n!U n, () where U n s the number of ways of seatng the gentlemen. Earler, Mur [4] solved a problem posed by Tat (cf. [4]): to fnd the number H n of permutatons of {,..., n} for whch () 6= and () 6= + (mod n), =,..., n. Smplfyng Mur s soluton, ayley [] found a recurson for H n : H 2 =, H 3 =, and for n 4, (n 2)H n = n(n 2)H n + nh n 2 + 4( ) n+. (2) Thrteen years later, Lucas [2] gave the same formula for U n. So, [] and [2] mply H n = U n (3)
INTEGERS: 6 (26) 2 whch became well known after the development of rook theory [5]. In Secton 2 we also gve a one-to-one correspondence between H n and U n. In 934, the explct formula nx U n = ( ) k 2n 2n k (n k)! (4) 2n k k k= was found by Touchard [8]. One can fnd a beautful proof of (4) wth the help of the rook technque n [5]. The frst terms of the sequence {U n }, for n 2, are ([2], A79 n [7]),, 2, 3, 8, 579, 4738, 43387, 439792, 48974, 5926642,... (5) Note that formulas for U n n other forms are gven by Wayman and Moser [9] and Shevelev [6]. In the present paper we study the followng problem. Problem 2. Wth no gentleman seated next to hs wfe, n male-female couples, ncludng Alce and her husband Bob, are to be seated at 2n chars around a crcular table. After the lades are seated at every other char, Bob s the frst gentleman to choose one of the remanng chars. If Bob chooses to st d seats clockwse from Alce, how many seatng arrangements are there for the remanng gentlemen? 2. Equvalence of Tat s Problem wth the Ménage Problem Let A be an n n (, )-matrx. For every permutaton = {,..., n } of the numbers {,..., n} there s a set of elements {(, ),..., (n, n )}, called a dagonal of A. Thus, A has n! dstnct dagonals. The number of dagonals of s of A s the permanent of A, denoted by pera. Ths s also the number of dstnct ways of puttng n non-attackng rooks n place of the s of A. Let J = J n be an n n matrx whch conssts of s only, let I = I n be the dentty matrx, and let P = P n be an n n matrx wth ths dagonal of s: (, 2),..., (n, n), (n, ) and all other entres. In Tat s problem, we should fnd the number of permutatons wth the prohbted postons (, ),..., (n, n) and (, 2),..., (n, n), (n, ). Therefore, Tat s problem s the problem of calculatng H n = per(j n I P ). onsder now the ménage problem. Denote the 2n chars at a crcular table by the symbols,, 2, 2,..., n, n (6) gong clockwse. Suppose the lades occupy chars {,..., n}. Number a gentleman, f hs wfe occupes char. Now the th gentleman, for =,..., n, can occupy every char except for chars and +, whle the nth gentleman cannot occupy chars n and. If, n the correspondng n n ncdence matrx, the prohbted
INTEGERS: 6 (26) 3 postons are s and the other postons are s, we agan obtan the matrx J n I P. Every seatng of the gentlemen corresponds to a dagonal of s n ths matrx. Ths means that (cf. [3]) U n = per(j n I P ), (7) and (3) follows. In partcular, for n = 2, 3, 4, 5,..., we have the followng matrces, (J n I P ):, @ A, B @ A B @ A wth permanents,, 2, 3,.... There s a one-to-one correspondence between the dagonals of s of the matrx J n I P and arrangements of n male-female couples around a crcular table, by the rules of the ménage problem, after the lades w, w 2,..., w n have taken the chars numbered 2n, 2, 4,..., 2n 2 (8) respectvely. Suppose we consder a dagonal of s of the matrx J n I P : (, j ), (2, j 2 ),..., (n, j n ). (9) Then the gentlemen m, m 2,..., m n took chars numbered 2j 3 (mod 2n), =, 2,..., n, () where the resdues are chosen from the nterval [, 2n]. Snce {j } s a permutaton of,..., n, then {2j 3} (mod 2n) s a permutaton of the odd postve ntegers not greater than 2n. The dstance between the places of m () and w (8) cannot be, ndeed the equalty 2(j ) = (mod 2n) s possble f and only f ether j = or j = + (mod n), correspondng to the postons of the s n J n I P. For example, n the case of n = 5 and j = 3, j 2 =, j 3 = 5, j 4 = 2, j 5 = 4 n (9), then by (8) and (), the chars, 2,..., are taken by m 4, w 2, m, w 3, m 5, w 4, m 3, w 5, m 2, w, respectvely. 3. Equvalent Form of Problem 2 The one-to-one correspondence above suggests a soluton to Problem 2. Let (J n I P )[ r] be the matrx obtaned by removng the frst row and the rth column of J n I P. Then, by expandng the permanent (7) over the frst row, we have nx U n = per((j n I P )[ r]). () r=3
INTEGERS: 6 (26) 4 In vew of symmetry, the soluton s nvarant wth respect to w, the char that Alce occupes. Suppose Alce occupes char 2n (or (mod 2n)). Then, by (), n () the values of the dstances correspondng to r = 3, 4, 5, 6,... are d = 3, 5, 7, 9,... clockwse,.e., the dstance d = 2r 3, r 3, (2) clockwse between Alce and Bob. Thus for the soluton of Problem 2 we should fnd the summands of (). We can do ths by the representaton of the rook polynomals of each matrx A r = (J n I P )[ r], 3 apple r apple n, as a product of rook polynomals of smpler matrces. 4. Lemmas Let M be a rectangular (, )-matrx. Defnton. The polynomal R M (x) = nx j (M)x j (3) j= where = and j s the number of ways of puttng j non-attackng rooks on the postons of the s n M, s called a rook polynomal. In partcular, f M s an n n-matrx, then n (M) = perm. Now we formulate several results of the classc Kaplansky Rordan rook theory (cf. [5], chaps. 7 8). Lemma. If M s a (, )-matrx wth rook polynomal (3), then per(j n M) = nx ( ) j j (M)(n j)! (4) j= Defnton 2. Two submatrces M and M 2 of a (, )-matrx M are called dsjunct f no s of M are n the same row or column as those of M 2. From Defnton, the followng lemma s evdent. Lemma 2. If a (, )-matrx M conssts of two dsjunct submatrces M and M 2, then R M (x) = R M (x)r M2 (x). (5) onsder the poston (, j) of a n M. Denote by M ((,j)) the matrx obtaned from M after replacng t by a. Denote by M (,j) the matrx obtaned from M by removng the th row and jth column.
INTEGERS: 6 (26) 5 Lemma 3. We have R M (x) = xr M (,j) + R M ((,j)). (6) onsder a starcase (, )-matrx. A (, )-matrx s called starcase f all ts s form the endponts of a polylne wth alternate vertcal and horzontal lnks of length. Every lne (row or column) can have a maxmum of 2 consecutve s. If a starcase matrx contans k s, then t s called a k-starcase matrx. For example, the followng matrces are 5-starcase: @ A, @ A, B @ A, @ A and the followng matrces are 6-starcase: @ A, B @ A, B @ A, @ A., all k-starcase matrces M have the same rook poly- Lemma 4. For every k nomal R M (x) = b k+ 2 c X = k + x. (7) Proof. Note that snce all polylnes wth k alternate vertcal and horzontal lnks of length are congruent fgures, then all k-starcase (, )-matrces have the same rook polynomal. So we consder the followng k-starcase (, )-matrx wth the confguraton of the s of the form...................... The last on the rght s absent for odd k and s present for even k. In both cases, by Lemma 3, for the rook polynomal R k (x) we have R (x) =, R (x) = x +, R k (x) = R k (x) + xr k 2 (x), k >= 2. Ths equaton has soluton (7) of Lemma 4 (see [5], chap. 7, eq. (27)).
INTEGERS: 6 (26) 6 For example, let M = B @ A. M contans two dsjont starcase matrces: M = and M 2 =. So, by Lemmas 2 and 4, 2X 5 R M (x) = R M (x)r M2 (x) = = x 2X 4 j j= j x j = (3x 2 + 4x + )(x 2 + 3x + ) = 3x 4 + 3x 3 + 6x 2 + 7x +. 5. Soluton of Problem 2 Accordng to Lemma, n order to calculate the permanent of the matrx (J n I P )[ r], we can fnd the rook polynomal of the matrx J n (J n I P )[ r]. We use the equaton J n (J n I P )[ r] = (I n + P )[ r], (8) whch follows from (A + B)[ r] = A[ r] + B[ r] and the equalty J n = J n [ r]. Transformng from matrx (I n + P ) to the matrx (I n + P )[ r], we have (n ths example, n = and r = 5)!. (9) B B @ @ A A Now let us use Lemma 3 on the latter matrx n the case = n, j =. Wrte A = ((I n + P )[ r]) (n,), B = ((I n + P )[ r]) ((n,)). (2)
INTEGERS: 6 (26) 7 Accordng to (6), we have R (In+P )[ r](x) = xr A (x) + R B (x). (2) Note that A has the form (followng the example, n = and r = 5) A = B @ A (22) whch s an (n 2) (n 2) matrx wth (2n 6) s. Ths matrx conssts of two dsjunct matrces: an (r 2) (r 2) matrx A of the form (here r = 5) A = @ A (23) whch s a (2r 5)-starcase matrx, and an (n r) (n r) matrx (agan n = and r = 5) A 2 = B (24) @ A whch s a 2(n r) -starcase matrx. Thus, by Lemmas 2 and 4, we have Xr 2 2r 4 R A (x) = = It s convenent to put k = j : Xr 2 2r 4 R A (x) = = x n r x n r+ X j= X 2(n r) k x k. k k= 2(n r) j + x j. (25) j n Note that, snce =, we can wrte the lower lmt n the sum over j as j =. Furthermore, the (n ) (n ) matrx B = B(r) (2) has the form (here n = and r = 5)
INTEGERS: 6 (26) 8 B = B @ A and contans (2n 5) s. Ths matrx conssts of two dsjunct matrces: an (r 2) (r ) matrx B of the form (here r = 5) B = @ A (27) whch s a (2r 5)-starcase matrx, and an (n r +) (n r) matrx (here n = and r = 5) B 2 = B (28) @ A whch s a 2(n r)-starcase matrx. Thus, by Lemmas 2 and 4, we have Xr 2 2r 4 R B (x) = n r = x n r+ X j= (26) 2(n r) j + x j. (29) j Note that, snce n r+ =, we can wrte the upper lmt n the second sum as j = n r +. Now from (2), (25) and (29) we fnd Xr 2 2r 4 R (In+P )[ r](x) = = x n r+ X j= 2(n r) j + 2 x j. j Set + j = k. Then k <= r 2 + n r + = n ; besdes <= k and snce we have 2r 4, then 2r 4 >=, <= r 2. Thus n mn(k, r 2) X X 2r 4 2(n r) k + + 2 R (In+P )[ r](x) = x k. (3) k k= =
INTEGERS: 6 (26) 9 Note that for the nteror sum of (3), t s su cent to take the summaton over nterval [max(r + k n, ), mn(k, r 2)]. Thus, by Lemma and (8), we have nx ( ) k (n k )! k= per((j n I P )[ r]) = 2r 4 2(n r) k + + 2 mn(k, r 2) X =max(r+k n, ) k. (3) Formula (3) solves Problem 2 for r = (d + 3)/2 3 (by 2) and naturally n > (d + )/2. For sequences correspondng to d = 3, 5, 7, 9 and, see A258664 A258667 and A258673 n [7]. Remark. The prohbted values d = and d = 2n correspond to the case when Alce and Bob are seated at neghborng chars. Let us calculate the number of ways of seatng the remanng gentlemen after all the lades have occuped ther chars, so that lades and gentlemen are n alternate chars, but Alce and Bob are the only couple seated next to each other. Thus we have a classc ménage problem for n couples for a one-sded lnear table, after the lades have already occuped ther chars. So, by [5], chap. 8, Thm., t =, the soluton V n of ths problem s nx 2n k 2 V n = ( ) k (n k )!, n >. (32) k k= One can verfy that ths result can be obtaned from (3) for both r = 2 and r = n +. It could also be proved ndependently. f. also A25922 n [7]. 6. Enumeraton of Arrangements A smple method of fndng the arrangements s to cycle through the permutatons of the n remanng gentlemen and weed out the ones that do not follow the no gentleman next to hs wfe rule. Ths Mathematca (verson 7) snppet works n that manner. enumerateseatngs[couples_,d_]:= If[d== d>=2 couples- EvenQ[d],{},Map[#[[]]&, Deleteases[Map[{#,Dfferences[#]}&, Flatten[Map[{Rffle[Range[couples], RotateRght[Insert[#,,],(d-)/2]]}&, Permutatons[Range[couples-],{couples-}]+],]], {{ },{,, }}]]];
INTEGERS: 6 (26) Also, we can code for (3) by numberofseatngs[couples_,d_]:= If[couples<=#- EvenQ[d] d==,, Sum[((-)^k)*Factoral[(couples-k-)]Sum[Bnomal[2#-j-4,j]* Bnomal[2(couples-#)-k+j+2,k-j], {j,max[#+k-couples-,],mn[k,#-2]}],{k,,couples-}]]&[(d+3)/2]; For 6 couples wth Bob sttng 3 seats clockwse from Alce, who s n char, to fnd how many possble possble seatng arrangements there are, the command numberofseatngs[6,3] wll return 2. Smlarly, to enumerate those possble seatngs, enumerateseatngs[6,3] wll gve {, 3, 2,, 3, 2, 4, 6, 5, 4, 6, 5} {, 3, 2,, 3, 5, 4, 6, 5, 2, 6, 4} {, 3, 2,, 3, 5, 4, 6, 5, 4, 6, 2} {, 3, 2,, 3, 6, 4, 2, 5, 4, 6, 5} {, 4, 2,, 3, 2, 4, 6, 5, 3, 6, 5} {, 4, 2,, 3, 5, 4, 6, 5, 2, 6, 3} {, 4, 2,, 3, 5, 4, 6, 5, 3, 6, 2} {, 4, 2,, 3, 6, 4, 2, 5, 3, 6, 5} {, 4, 2,, 3, 6, 4, 3, 5, 2, 6, 5} {, 5, 2,, 3, 2, 4, 6, 5, 3, 6, 4} {, 5, 2,, 3, 2, 4, 6, 5, 4, 6, 3} {, 5, 2,, 3, 6, 4, 2, 5, 3, 6, 4} {, 5, 2,, 3, 6, 4, 2, 5, 4, 6, 3} {, 5, 2,, 3, 6, 4, 3, 5, 2, 6, 4} {, 5, 2,, 3, 6, 4, 3, 5, 4, 6, 2} {, 6, 2,, 3, 2, 4, 3, 5, 4, 6, 5} {, 6, 2,, 3, 5, 4, 2, 5, 3, 6, 4} {, 6, 2,, 3, 5, 4, 2, 5, 4, 6, 3} {, 6, 2,, 3, 5, 4, 3, 5, 2, 6, 4} {, 6, 2,, 3, 5, 4, 3, 5, 4, 6, 2}. Symbolzng Alce by and Bob by, the nth lady by and her husband by, we can show ths n a graphcal manner as n Fgure, below. Also, Table shows a trangular table of the number of seatngs as gven by (3). The rows of Table appear to be unmodal for whch we have no proof. The row sums,, 2, 3, 8,..., n Table are equal to the solutons to the classc ménage problem.
INTEGERS: 6 (26) Fgure : The 2 possble seatngs of the 5 remanng gentlemen f Bob sts 3 seats clockwse from Alce. n 3 4 5 4 5 4 6 2 2 2 2 7 5 6 7 6 5 8 787 79 79 79 79 787 9 684 623 624 625 624 623 684 54888 55 554 554 554 554 55 54888 3 5 7 9 3 5 7 d Table : Number of arrangements for n couples wth Bob seated d seats clockwse from Alce.
INTEGERS: 6 (26) 2 Acknowledgment The authors thank Govann Resta and Jon E. Schoenfeld for useful dscussons and the anonymous referee for a number of helpful suggestons. References [] A. ayley, Note on Mr. Mur s soluton of a problem of arrangements, Proc. Royal Soc. Ednburg, 9 (878), 388 39. [2] E. Lucas, Théore des nombres, Pars, 89. pp. 49 5 [3] H. Mnc, Permanents. Addson-Wesley, 978. [4] T. Mur, On Professor Tat s problem of arrangements, Proc. Royal Soc. Ednburg, 9 (878), 382 387. [5] J. Rordan, An Introducton to ombnatoral Analyss, Wley, 967. [6] V. S. Shevelev, On a method of constructng of rook polynomals and some ts applcatons, ombn. Analyss, MSU, 8 (989), 24 38 (n Russan). [7] N. J. A. Sloane, The On-Lne Encyclopeda of Integer Sequences http://oes.org. [8] J. Touchard, Sur un probléme de permutatons,. R. Acad. Sc. Pars, 98 (934), 63 633. [9] M. Wayman, L. Moser, On the probléme des ménages, anad. J. of Math.,, (958), no. 3, 468 48.