home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5682 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.NetVision.net.il!news
  2. From: Jack <avilev@netvision.net.il>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Fixture List Algorithms?!
  5. Date: Sat, 16 Mar 1996 21:04:17 -0800
  6. Organization: NetVision LTD.
  7. Message-ID: <314B9D51.7481@netvision.net.il>
  8. References: <Do7JKq.Dot@cf.ac.uk>
  9. NNTP-Posting-Host: ts010p8.pop4a.netvision.net.il
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (Win16; I)
  14.  
  15. M Wood wrote:
  16. > I am considering writer (yet another...) football management simulation, one of the stumbling blocks being how to generate the set of fixtures. There must be a
  17. > Say, for example, there were 8 teams in a division, first week would be:
  18. > (Home team no. v Away team no.)
  19. > 1 v 2
  20. > 3 v 4
  21. > 5 v 6
  22. > 7 v 8
  23. > 2nd week:
  24. > 1 v 3
  25. > 2 v 4
  26. > 5 v 7
  27. > 6 v 8
  28. > but where from now? with 8 teams i could simply work out by hand how to achieve this, but with
  29. > Anyone encountered this problem before?
  30. > Martin
  31.  
  32. there's a math formula from combinatorial analysis theory which computes the number combination 
  33. of A (in this case 2, since only 2 teams play against each other) objects out of N (in this case 
  34. it's 20). this gives you all possible combinations possible for all teams, that means that each 
  35. team plays against all other teams exactly once. then you could simply choose at random a group 
  36. of these fixtures to play at a certain week.
  37. the formula if memory serves is: C = N!/A!*(N-A)! where ! stands for the factorial function.
  38. good luck.
  39.  
  40. Jack.
  41.