Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
RatTail
Crackhead
98 Posts |
Posted - 2002-10-15 : 04:56:55
|
Yesterday one russian dba posted a school's maths problem onwwwsqlru: There's a chesslike board with 5x5 squares!-!-!-!-!-!! ! ! ! ! !!-!-!-!-!-!! ! ! ! ! !!-!-!-!-!-!! !X! !X! !!-!-!-!-!-!! ! ! ! ! !!-!-!-!-!-!! ! ! ! ! !!-!-!-!-!-!Question: how many are there variants to move along a piecefrom left-bottom corner to right-upper corner of the board?Only "up to one square" and "right to one square" moves areallowed. Squares with "X" in them are forbidden to enter!PS Must be solved in mind and quickly enough. PPS Bet: Nazim (as a chess amateur) will win (like me there). |
|
RatTail
Crackhead
98 Posts |
Posted - 2002-10-15 : 05:24:51
|
An amendment:!-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! !X! !X! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! |
 |
|
RatTail
Crackhead
98 Posts |
Posted - 2002-10-15 : 05:27:59
|
Today is my offday !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! !X! !X! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! ! ! ! ! ! ! !-!-!-!-!-! |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-10-15 : 06:40:54
|
I misread this and did 11 rows by 5 cols and got 365.For 5x5 19?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
RatTail
Crackhead
98 Posts |
Posted - 2002-10-15 : 06:56:21
|
2nrCongratulations! Absolutely correct answer!(19)PS But I'm afraid that you used formula:(n + m - 2)!/((n - 1)!*(m - 1)!)I did it with "formula":1 * 5 + 3 * 3 + 5 * 1Anyway, take my respects! |
 |
|
|
|
|