The points to the right of point X are closer to X.
So, we are left on finding how many points our closer to point A from 0 to 8. Dividing the segment AX, the middle point will fall at 4.
Point A and point X are equally close to the middle point. But, the points to the left of the middle point including the point A itself is closer to point A. Counting the points on the left of middle point (point at 4), 0, 1, 2, 3. Therefore there are 4 points closer to point A.
Use the formula:
P(event) = (size of successful region)/(size of total region).
We will have:
Probability that a random point on AB will closer to point A than point X is: 4/12 = 1/3.