Perl: the Markov chain saw  
PerlMonks 
Possible pairings for first knockout round of UEFA champions leagueby LanX (Chancellor) 
on Dec 21, 2012 at 17:16 UTC ( #1009940=perlquestion: print w/ replies, xml )  Need Help?? 
LanX has asked for the
wisdom of the Perl Monks concerning the following question:
The UEFA Champions League is the uber league for European club football¹, combining the best teams of different associations.
Now some conspiracy theories came up after the last drawings for the next round, because an UEFA official predicted the exact pairings at a test screening. ATM a German news paper tried to calculate the likelihood for this to happen and said that the rules are too complicated for a mathematical approach and a computer program counted 5463 possible pairings from http://www.uefa.com/newsfiles/19071.pdf
Now I tried the same, with the following script I counted also 5463 possible pairings.
It's the first time that I used the smart match as an inoperator in arrays, it's not the most efficient way but it clarifies the program logic I came pretty far with pencil and paper, but the edge cases for teams from the same qualification group take too much effort... UPDATE: Anyway I'm not sure that all possible combinations have the same probability to happen...
Cheers Rolf ¹) association football somewhere also known as soccer
Back to
Seekers of Perl Wisdom

