Because he is in total darkness, the narrator must use other means to determine the nature of his prison. It must have been terrifying to not know where he was, or how big the prison was, or anything about it; such disorientation would be completely horrifying. However, he gathers strength, and decides to explore. He does so first of all through feel--he steps forward, arms outstretched, until he hits a wall. He realizes that if he follows the wall, he could go in a complete circle and not realize where he had begun. So, he tears part of the robe that he was put in, and makes a sort of rope that he puts on the ground; that way, he will step on it after he makes one round of the prison, and know that he has come full circle. He walks around the edges, counting his footsteps, concluding "the dungeon to be fifty yards in circuit." So, that is how he figures out the size of his prison. However, the entire time that he did this, he was along the edges of the walls; this didn't factor in the great pit looming ominously at the center. He starts to walk across the prison, and fortunately for him, trips on his robe before he gets to the pit. He falls, and notices
"my chin rested upon the floor of the prison, but my lips and the upper portion of my head, although seemingly at a less elevation than the chin, touched nothing."
This is how he discovers the pit, and he was very lucky to not have plunged right in; tripping saved him from the mistake of confidently striding across a prison in the dark. His tormentors, thwarted in their original plan to have him fall, then had to come up with a different plan of torture.
I hope that those thoughts helped; good luck!
The narrator attempts to to determine the size by walking along the perimeter of his "prison", feeling along the walls with his hands. He mistakenly determined that the room was at least fifty yards in total area; however he later determined that the room was half that size after he almost fell into the pit that was at the center of the room.