Firstly imagine the pole falls and hits the centre of the wall so it's tilting.
Therefore now imagine the TRIANGLE that is made by the pole (4) the bottom of the pole and the corner of the wall (also 4) and the new length from centre of wall to the corner (x). using pythagora's theorem, x is found.
Now, with x found, imagine the OTHER triangle that is made from x, the corner of the wall to the point on the ground BELOW the pole's tip, and then the verticle from the ground to the tip of the pole. You assume that this length along the ground is half of the full length, because it is the highest point that this pole could lean, and so it is 3. Then with 3, and x, you again you pythagora's to find the final length (the height) which is the answer.
Sorry I didn't do the actual working I find it hard to work algebra on the computer haha.