You are confusing several concepts of ambiguity, and using your own
There is the concept of semantic ambiguity: is it possible to have
different meanings for the same string. In your case: is it possible
that 2 different numbers are written in the same way in Roman numerals.
The answer is clearly no, because there is a simple deterministic
algorithm to compute the value represented by a Roman numeral.
However, when you talk of formal language, you are considering only
syntactic structures (usually tree structure) associated to string
in accordance with the way these strings can be generated by a
grammar. Identifying a tree associated with a string is called
Then there is the concept of syntactic ambiguity. Are there two
different ways to parse some numerals into a structure. I cannot answer
that since you do not give a formal definition of the structure of
But let us assume that you are only considering structure defined by a
context-free (CF) grammar. Then you may wonder whether the Roman numerals
can be generated by an unambiguous CF grammar (they can, though I did
not check the grammar on the site you discovered). But there are CF
languages that will not have an unambigous grammar. Such CF languages are
said to be inherently ambiguous.
Does syntactic ambiguity really matter? Not necessarily if you are
only interested in the meaning of sentences, here in the integer values
represented by Roman numerals. Syntactic structure is normaly used to define
semantic, that is, meaning. If the same sentence has two structure
because of grammatical ambiguity, that could be a problem. But it
could also be that the way meaning is associated with the structure of
a sentence (the parse tree) is such that it produces the same meaning
for all strucures corresponding to a same sentence. Syntactic
ambiguity does not necessarily result in semantic ambiguity.
The Romans numerals can be defined as a formal language, for example
with a CF grammar. But you are also associating a meaning with each
string, which means that you are considering more than a formal language.
Hence you should be clear whether you talk of syntactic ambiguity, or
of semantic ambiguity.
Now, you may have two distinct Roman numerals
that represent the same number, as you show in your question, and which is
confirmed by wikipedia. For
example VIIII and IX. That is not ambiguity. It is a very common
situation when a given meaning can be expressed syntactically by
different strings. While you stated correctly that (semantic)
ambiguity is when a string can have more than one meaning.
To take it with natural language, the sentence "John sees a man with a
telescope" is ambiguous because you cannot determine whether John is
using a telescope, or whether the man is carrying one.
But the fact that both sentences "the dog eats the bone" and "the bone
is eaten by the dog" mean the same thing is not a problem for anyone.
From what I read in wikipedia, there is a finite number of Roman
numerals. Hence they can be trivially represented by a regular
grammar. And a regular grammar is an unambiguous CF grammar.
But that is a trivial argument that provides no insight.
What you want is a CF grammar that will identify as a tree the
organization of a Roman numeral so that it will be easier to
compute its meaning: the associated integer. This is possible in various