HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Is the language of Roman numerals ambiguous?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
theromanlanguageambiguousnumerals

Problem

An ambiguous Language is a formal language for which there exists a string that can have more than one meaning (several possible meanings or interpretations). Multiple synthesis structures for a string.

[Question]

Are Roman numbers an example of an ambiguous language?

Because there can be more then one representation for some number such as 1999, which
can be written as MDCCCCLXXXXVIIII, MCMXCIX, or MIM.

I am confused. Sometimes I feel not, some time yes!

EDIT

[ANSWER]

Although there can be more than one representation of same magnitude in Roman Number System. That is basically Non-Positional Number System. But its possible to write Unambiguous Grammar for that can generate all possible/valid pattern in Roman Number System.

Here is again a beautiful link that describe symbol table, rule , Grammar for Roman number.

I am not sure about this but some authors says that: "Roman numbers can be recognized by a regular expression, so you don't really need a context-free grammar." and a regular language can't be ambiguous.

Solution

A grammar (not a language!) is ambiguous if there is a word with two "essentially different" parses. Roman numerals are unambiguous - given a roman numeral, it has an unambiguous numerical value. The fact that this correspondence is not one-to-one is beside the point.

Context

StackExchange Computer Science Q#7777, answer score: 19

Revisions (0)

No revisions yet.