PDA

View Full Version : B&W preference test

drbean
12-11-2007, 04:57 PM
Here's a little exercise I found interesting. I originally developed it to test whether the computer was calculating preferences correctly, but turn it around and it is a test of how well you know the preference rules, or of whether you can catch it out in a corner case.

Actually, I find it fairly difficult to avoid mistakes determining preferences. This is probably what makes working them out motivating.

I here present devising new color sequences and determining the preferences that result as a challenge to you. I will include your sequences as a test in the next version of Games::Tournament::Swiss.

===
--- input
played: W B W B W B
--- expected
prefer: B W B W B W
degree: S M S M S M

The input section is what a player played in each of the rounds. The expected section is the preference for the following rounds.

In the first block, the color played in the first round was white. (The W in the first column).

So for the second round, the preference is Strong and is for Black. (The B and S in the first column below.)

In the second round Black was played, so the preference for the 3rd round is White and is Mild. (The W and M in the expected section in the second column.

Here are some more:

===
--- input
played: B B W B W W
--- expected
prefer: W W W W W B
degree: S A S A S A

If instead in the last round, B was played the preference would have been for White, not Black, but it would still have been Absolute.

===
--- input
played: B B W B W B
--- expected
prefer: W W W W W W
degree: S A S A S A

Preferences are defined even if a player plays more than 2 games with the same color, something that would only happen in the last round normally.

===
--- input
played: B B B B B B B B B B B B B
--- expected
prefer: W W W W W W W W W W W W W
degree: S A A A A A A A A A A A A

And if a player had a bye and then didn't play any games:

===
--- input
played: - - - - - - - - -
--- expected
prefer: U U U U U U U U U
degree: M M M M M M M M M

U means the preference is undefined.