according to wikipedia, the largest number Roman Numeral system can represent is represented like following: (answer below has much bigger number represented)
MMMCMXCIX
why can't it be represented like following?
MMMIM
As a part-time computer scientist, I've tried to come up with different ways of analyzing the Roman numeral system so that the rules can be formulated in as general a way as possible, with no special cases per glyph. The one that satisifes me the most, for the time being, is one in which we analyze the seven glyphs as four sets that each have a multiplier — similar to how each column has a place-value multiplier in the Arabic numeral system.
These sets are I V X ; X L C ; C D M ; M (the Romans did not leave us perfectly symmetrical sets). You can only subtract the first glyph in each set from the second or third in the same set. This precludes IM.
To see this analysis in action, read this simple handout. It includes exercises to practice with and an online tool to verify your answers. For the sake of perpetual Stack Exchange availability, I'll copy a screenshot of the first page here:
x1 symbols. The limit is usually 3, but a common variant of the system allows 4. (I mentioned that in one of the exercises because it greatly increases the upper bound of numbers you can write! The checker tool linked in the handout also lets you write 4 of the same symbol.)
It's because of the grammar of the Roman numerals (It's not the same as natural language grammar, but it's still grammar).
I does not combine with all characters. I combines on the left of V or X to mean -1. (Just like X combines on the left of L or C to mean -10, but combinations like XM does not work).
So the problem with MMMIM is that IM is invalid and cannot mean 999. To subtract anything from M, you can use C.
Maybe because you cannot skip so many slots, mind that 49 is XLIX, not IL, and 99 is XCIX, not IC. Anyhow, you can write much bigger numbers than that MMMCMXCIX (3999). By putting a horizontal line, called vinculum or overline above a Roman numeral, you multiply it by 1,000, so M with an overline is 1,000,000 that is one million. Using the overline, the biggest number that can be written is 3,999,999 (see the image).