It is quite common to find people confused by the notion of DPI and its influence in media size. DPI is nothing else than the relation between virtual dimension (pixels) and real dimension (inches/centimeters).
To ease this understanding and everyday calculations, I created this simple spreadsheet in Google Docs accessible to anyone. You just need to change the values in black and the table will return the numbers needed.