[Haskell-cafe] finding the right mathematical model

Günther Schmidt gue.schmidt at web.de
Sun Jul 4 09:07:23 EDT 2010


Hi list,

the problem I have stems from the app I had developed. What my app does 
is to split the money a hospital receives for a case to the departments 
involved in a fair way.

An additional requirement however was to allow the users of the app to 
re-map any revenue shares credited to certain departments to other 
departments. Such cases are sometimes due to politics within the 
hospital and also have more legitimate reasons, like saying the 
radiology should not receive shares for surgical procedures but those 
shares should be redirected to the "General surgery" department.

The feature is already implemented, but I'm not pleased with it, 
especially since I did not develop a mathematical model for it.

Details:

It boils down to model mappings, or rather what sort of data structure 
would be suited for this kind of thing.

Dept A is "mapped" to itself
     A -> A

Dept B is mapped to Dept C
     B -> C

Dept C is mapped to Dept C
     C -> C

Dept D is mapped to Dept A
     D -> A

It should not be possible to construct looping mappings, ie.

   1. A -> B
   2. B -> C
   3. C -> A

......


What sort of model would be suitable to describe this, some sort of matrix?

Günther




More information about the Haskell-Cafe mailing list