27. november 2006 - 08:41Der er
3 kommentarer og 1 løsning
Logic-problem
Hello!
This is actuallay a databas problem with triggiers that we are stucked with.
How ever, to find a new approach we try to look at the problem from a different angle.
So now I hope some one could give us some input.
Imagin this.
A blind man guards a door. His mission is to open and close the door for different groups of mute people.
Each group of people can consist of 1 or n number of people.
In each group the first man knocks on the door so the blind man knows when to open.
Each person in a group can only tell if he is the first person to enter the door, by knockin the door, of the group or if he is not the first. No one can tell if he is the last.
An extra problem is that different groups of people can arrive at the same time and then enter mixed with an other group.
How ever each person has some sort of a sign that the connects him to one specific group.
The problem now is how shall the blind man know when to close the door?
If ha waits some time and try to close then he risk to close the door too soon and a just a part of a group manage to get in.
Therfore using the time is not a suitable solution.
As you state it, the problem have no solution. Then again, algoritmically there is no problem. There are clear and definite algorithms for both the blind and the dumbs that allow them to perform their function. The only added stipulation we need is that doorclosing and doorpassing must be 'instantaneous' so it is not possible for a dumb to arriwe while the door is in the process of being closed, and equally impossible for the blind to close the door while somebody is in it.
dumb: 1) arrive at door 2) if closed knock on door 3) if open pass through 4) goto 2.
blind: a1) if open close door a2) if knock open door a3) goto a1
You will notice that the 'grouping' of people arriving is entirely ignored. the only way such grouping can be determined would be through some sort of timed delay, eg: all members in group red go to the red buffer area and are processed together at suitable time intervals.
Yes the gouping is important in a later state that I did not mentioned.
In each group there is only one person that will be allowed see a football game. If one of the persons in a group got a VIP-card, then pick him to see the football game. If nobody in the the group got a VIP-card then pick one person in the group randomly to see the footballgame.
Hope you see the point.
I guess there is no way to then to signal to the blind that this is the last person, as I have state it.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.