The Entity was a being composed of two separate minds bound together. They created their own space, but the two could not agree on what colour it was to be. One wanted white, and the other black. Finally, they agreed upon grey, and so grey space was created. Other than that, the two have rarely ever been able to agree on anything.
For their own amusement, the Entities brought the Doctor to grey space. The Doctor escaped by convincing them to play a game of Monopoly, and then leaving in the TARDIS while the two Entities argued over who would go first. They eventually decided to use the Doctor to determine this, by putting him through a test. They determined how many chances he would get by rolling the Monopoly dice. The number that came up was seven, so they first summoned the Seventh Doctor to take the test, and then went backwards, so that the Doctor couldn't learn from his mistakes.
The test consisted of a small, grey door guarded by a RWR Mark II android. The Doctor had to simply disable the android, open the door, and then avoid the attempt by an imposter taking the place of his companion to push him through the doorway. The Seventh, Sixth, Fifth, Fourth, Third, and Second Doctors all failed the test, not noticing that their companion was an imposter. Only the First Doctor noticed the deception and avoided the trap, saving himself and his future incarnations.