As I understand, the matching dpi and size qualifiers for the device are based not on actual screen properties (physical dpi and size), but instead on what was predefined by
The size data comes from Wikipedia, and for a better understanding of Pixel Density, check out this great post by Teehan+Lax.
Screen Sizes