As all the possible probabilities summed up add up to 1, that's how you get the constant 1. In terms of the diagram, it's just finding the area under the graph. As it's a triangle, you just go bh/2 (where b = base = 4, h = height = 1/2), then you just sub it in