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.

 All Forums
 Site Related Forums
 The Yak Corral
 A maths recreation

Author  Topic 

RatTail
Crackhead

98 Posts

Posted - 2002-10-15 : 04:56:55
Yesterday one russian dba posted a school's maths problem on
wwwsqlru: There's a chesslike board with 5x5 squares

!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! !X! !X! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!

Question: how many are there variants to move along a piece
from left-bottom corner to right-upper corner of the board?
Only "up to one square" and "right to one square" moves are
allowed. 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! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!


Go to Top of Page

RatTail
Crackhead

98 Posts

Posted - 2002-10-15 : 05:27:59
Today is my offday



!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! !X! !X! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!
! ! ! ! ! !
!-!-!-!-!-!



Go to Top of Page

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.
Go to Top of Page

RatTail
Crackhead

98 Posts

Posted - 2002-10-15 : 06:56:21
2nr
Congratulations!
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 * 1
Anyway, take my respects!


Go to Top of Page
   

- Advertisement -