       RE: Horse Race Puzzle

• To: mathgroup at smc.vnet.net
• Subject: [mg9183] RE: [mg9162] Horse Race Puzzle
• Date: Tue, 21 Oct 1997 02:02:56 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Seth J. Chandler wrote:
----------
|N horses enter a race. Given the possibility of ties, how many
different |finishes to the horse race exist. Write a Mathematica
program that |shows all the possibilities.
|
|By way of example: here is the solution (13) by brute force for N=3.
The |horses are creatively named a, b and c. The expression {{b,c},a}
|denotes a finish in which b and c tie for first and a comes in next. |
|{a, b, c}, {a, c, b}, {b, a, c}, {b, c, a}, {c, b, a}, {c, a, b},
|{a,{b,c}}, {{b,c},a}, {b,{a,c}},
|{{a,c},b},{{c,{a,b}},{{a,b},c},{{a,b,c}} |
|

I propose a different convention.  Make a list where we have a list of
those  in first, a list of those in second, and a list of those in
third.  This  gives the following for three horses:

{{a}, {b}, {c}},
{{a}, {c}, {b}},
{{b}, {a}, {c}},
{{b}, {c}, {a}},
{{c}, {b}, {a}},
{{c}, {a}, {b}},
{{a}, {b,c}, {}},
{{b,c}, {a}, {}},
{{b}, {a,c}, {}},
{{a,c}, {b}, {}},
{{c}, {a,b}, {}},
{{a,b}, {c}, {}},
{{a,b,c}, {}, {}}

I don't know but this may be easy to do using some of the 230 commands
in  the package,  DisctreteMath`CombinatorialFunctions`.  See
Mathematica 3.0  Standard Packages (pp 83-102).

Apparently an even better guide  to the package is the following book:
Implementing Discrete Mathematics: Combinatorics and Graph Theory with
Mathematica, by Steven Skiena

On the other hand you could write the code yourself if you want to take
on  the challenge.
However, I don't have the time to pursue this any further right now.

Ted Ersek

```

• Prev by Date: Re: Horse Race Puzzle
• Next by Date: RE: HELP HELP HELP!!!
• Previous by thread: Re: Horse Race Puzzle
• Next by thread: Re: Horse Race Puzzle