Pac-man theory
^ Pac-Man Ghost AI Explained ^
Different states
There are 4 different states of what the ghosts can be in. They can be triggered by something that Pac-man is doing or just naturally happens.The exact time the ghosts will spend on their scatter and chase is chosen by the level the player is on, the ghosts will alternate between scatter and chase mode four times per level.


Scatter
Eaten
Frightened
 Chase
Scatter state
During the scatter state every ghost has a different pixel block to follow. They will be looped in a certain corner for this duration and the pixel block will always be the same no matter what during the scatter state.
Frightened & Eaten State
All 4 ghosts will enter frightened mode when Pac-man eats a pellet. This happens from levels 1-16 and 18. Their colour changes to blue to signify their state which would make it obvious for the player to what is happening. This means that Pac-man can now touch them and send them back to the ghost house. Touching them enters them into an "eaten" state. This means that the ghosts will turn 180 degrees from their original way they were facing. This is one exception to make them turn 180 degrees. During the frightened state they don't really follow any turn rule and it uses a random generator to determine where they will turn next. This does not take in consideration even if they do turn right into Pac-man.
During eaten mode their target block will be right outside of the ghost house, meaning that they will find the fastest route to it and then go inside. After they get inside they go back into their chase state and try to get Pac-man.
Chase State
When the ghosts turn into chase mode they will turn 180 degrees. During the chase state each move of the ghost is calculated differently.
Red Ghost - Will always have the target on pac-man no matter where he is and the target is on top of him at all times during the chase state.
Pink Ghost - She will always target 4 tiles in front of Pac-man. The exception is when Pac-man is facing up-wards.
Pac-man facing left = 4 blocks to the left
Pac-man facing down = 4 blocks down-wards
Pac-man facing right = 4 blocks to the right
Pac-man facing up = 4 tiles up-wards and 4 to the left
If Pac-man stays in certain areas, the Pink ghost won't be able to find him.
Cyan Ghost - The target block is very dependant on the red ghost. Usually it is 2 tiles in front of Pac-man unless he is facing up-wards then the target block will be 2 ahead and 2 to the left. Then link the target block to the Red ghost and turn it 180 degrees and thats where his target block will be. It's like they are both trying to flank Pac-man. However, if the Red ghost is close to Pac-man  (within 4 blocks) the Cyan ghost will just behind Pac-man instead.
Orange ghost - If the Orange ghost is far away then the target block is exactly on top of Pac-man. ( 8 or more tiles away) When he is withtin 8 blocks he will choose his direction as if he was to be in Scatter mode. There are only a few areas that the Orange ghost can catch him in and most are located in the bottom left as there is where his Scatter aim block is.
Some pictures from university that was done as a group
In this picture you can see Foad actually making the map of Pac-man with legos!
Some short information about Pac-man.