Page 3 of 4
Please add clarification to "About Roman Numerals" page...
Posted: Fri Mar 14, 2014 9:49 pm
by AnzaPower
Hi, In
Problem 89 there's a misunderstanding in the
About Roman Numerals page, it was not apparent to me that you cannot use the same subtractive pair twice in a row, for example 18, my code generated IXIX (9+9), but you seem to expect XVIII, there was no way for me to know that...
Funny thing, I wrote the code in August last year, been coming back to it once every few months trying to find the bug, feels so good to finally have that problem solved...
EDIT by mpiotte:
I merged your topic with an already existing one.
Please check in the future if there already exists a topic for a problem.
Re: Problem 089
Posted: Sat Apr 12, 2014 7:57 am
by RJCunningham
Hello,
I'm having issues with this problem and I figured I would ask here for some advice/help. From reading this thread, I've gathered that I think I understand the numerals correctly (and that MMMMCM is a valid way of writing 4900). In addition, I am getting the same number of characters saved for the first 30 as I should be getting, but my answer is not correct. Should I PM someone a list of savings for each case so I can see where my code is going wrong? I believe I am handling the end of file correctly, as I can see the savings from the last case, so I'm really not sure what could be wrong and don't really want to check every case to find the error.
EDIT: I used a smarter algorithm and caught my error in the one case that has just one numeral. Silly dumb me writing lazy code as usual.
Roman numerals / problem 89
Posted: Fri Aug 29, 2014 3:30 pm
by gelatine1
Hi, I was wondering what happens with numbers above 5000 ? How should they be written ? Do they occur in problem 89 ? It would require to write more than 4 M's next to each other so I'm a little confused
Re: Roman numerals / problem 89
Posted: Fri Aug 29, 2014 3:42 pm
by nicolas.patrois
There is already a
thread for this problem.
Note: You can assume that all the Roman numerals in the file contain no more than four consecutive identical units.
Re: Roman numerals / problem 89
Posted: Fri Aug 29, 2014 5:22 pm
by mpiotte
nicolas.patrois wrote:There is already a
thread for this problem...
Merged threads.
Re: Problem 089
Posted: Fri Sep 05, 2014 4:08 pm
by angzhiping
cottonvibes wrote:Guys I want to report what some other people were saying, which makes the answer to problem 89 on the site wrong.
By following the rules euler wrote in the FAQ:
http://projecteuler.net/index.php?secti ... n_numerals
Numerals must be arranged in descending order of size.
1. Only I, X, and C can be used as the leading numeral in part of a subtractive pair.
2. I can only be placed before V and X.
3. X can only be placed before L and C.
4. C can only be placed before D and M.
The following numbers should be valid:
IXIX = 9 + 9 = 18
XCXC = 90 + 90 = 180
CMCM = 900 + 900 = 1800
There is no rule these numbers break from above.
Therefore, either the rules on the FAQ need to be changed to explicitly say "no repeats of same subtractive-pair numbers", or the answer needs to be changed on the site.
For anyone wondering, the answer to the question currently does not allow repeats.
Therefor, for the above numbers it wants:
XVIII = 10 + 5 + 1 + 1 + 1 = 18
CLXXX = 100 + 50 + 10 + 10 + 10 = 180
MDCCC = 1000 + 500 + 100 + 100 + 100 = 1800
Second this. Can the problem setter for PE89 look into this?
Re: Problem 089
Posted: Fri Sep 05, 2014 10:04 pm
by euler
angzhiping wrote:Can the problem setter for PE89 look into this?
That would be me - nearly ten years ago!
I know this isn't the example given, but if XLI (41) is valid and IXI is invalid, can you see why?
In addition, if you use I before X to indicate then 1 is being subtracted from 10 then you are declaring that the "total" must less than 10. Remember, the Roman numeral system is fundamentally an additive system: something plus something plus something..., where subtractive combinations, if used correctly, are permitted to be used for brevity. So any number beginning IX indicates already that the total value of the number is below 10. Placing anything after IX makes the total equal to or greater than ten which is a nonsense.
Anyway I take the points about the problem not being clear so I have updated the problem statement and expanded the information on the "About... Roman Numerals" page to make, I hope, everything clearer.
Problem 89 (
View Problem)
Re: Problem 089
Posted: Sun Feb 22, 2015 1:51 am
by solarmew
this problem sucks ... =_______= ... i literally don't even know where to begin ... maybe i'm just tired
Re: Problem 089
Posted: Fri Feb 26, 2016 5:53 pm
by jason.levy
euler wrote:Anyway I take the points about the problem not being clear so I have updated the problem statement and expanded the information on the "About... Roman Numerals" page to make, I hope, everything clearer.
Reading through the rules, I didn't realize at first that rule 2 applies even to X's that don't appear. Perhaps that could be emphasized.
Re: Problem 089
Posted: Fri Feb 26, 2016 9:32 pm
by jaap
jason.levy wrote:euler wrote:Anyway I take the points about the problem not being clear so I have updated the problem statement and expanded the information on the "About... Roman Numerals" page to make, I hope, everything clearer.
Reading through the rules, I didn't realize at first that rule 2 applies even to X's that don't appear. Perhaps that could be emphasized.
It has as an example:
We could not write IIIIIIIIIIIIIIII because we are making X (ten) from smaller denominations.
Is that not clear enough?
Re: Problem 089
Posted: Sun Feb 28, 2016 5:23 pm
by jason.levy
jaap wrote:jason.levy wrote:Reading through the rules, I didn't realize at first that rule 2 applies even to X's that don't appear. Perhaps that could be emphasized.
It has as an example:
We could not write IIIIIIIIIIIIIIII because we are making X (ten) from smaller denominations.
Is that not clear enough?
Sure, the explanation makes it unambiguous. I'm only suggesting that the rule itself would be clearer with a couple of words distinguishing X's that need not appear and smaller denominations that do. It's not really a big deal.
Re: Problem 089
Posted: Fri Jul 15, 2016 4:35 am
by square1001
I think $5000 = \bar{V}$. It's written in
this page.
So, $4900 = MMMMCM = C \bar{V}$.
Is this problem says 4900 can represent only 2 characters?
Re: Problem 089
Posted: Fri Jul 15, 2016 4:55 am
by dawghaus4
square1001 wrote:I think $5000 = \bar{V}$. It's written in
this page.
So, $4900 = MMMMCM = C \bar{V}$.
Is this problem says 4900 can represent only 2 characters?
I've never seen a roman numeral character for 5000, not even on the page you linked to. On that page, when I enter 5000 into the pages converter, I'm told that 5000 is an invalid number.
Regardless, the problem links to a page
About...Roman Numerals, which has "the definitive rules for this problem."
Tom
Re: Problem 089
Posted: Fri Jul 15, 2016 9:05 am
by square1001
You said "I entered 5000 into the roman numeral converter, so it was an invalid number".
But, It is written under the converter, in the list of roman numerals.
This page written: $5000 = \bar{V}$, $10000 = \bar{X}$, $50000 = \bar{L}$, $100000 = \bar{C}$, $500000 = \bar{D}$, and $1000000 = \bar{M}$.
Thank you for reading.
Re: Problem 089
Posted: Fri Jul 15, 2016 12:07 pm
by v6ph1
The use of numerals beyond 1000 (M) was not common.
Just write the larger numbers with M only.
Re: Problem 089
Posted: Fri Jul 15, 2016 2:19 pm
by dawghaus4
square1001 wrote:You said "I entered 5000 into the roman numeral converter, so it was an invalid number".
But, It is written under the converter, in the list of roman numerals.
This page written: $5000 = \bar{V}$, $10000 = \bar{X}$, $50000 = \bar{L}$, $100000 = \bar{C}$, $500000 = \bar{D}$, and $1000000 = \bar{M}$.
Thank you for reading.
Regardless, the problem links to a page
About...Roman Numerals, which has "the definitive rules for this problem."
Re: Problem 089
Posted: Wed Feb 22, 2017 10:39 pm
by vjcinjr
Still confused about the rules. Is LD a valid representation of 450? If not, what rule does it violate?
Re: Problem 089
Posted: Thu Feb 23, 2017 12:46 am
by v6ph1
Rule i: "Only one I, X, and C can be used as the leading numeral in part of a subtractive pair."
Re: Problem 089
Posted: Thu Feb 23, 2017 1:22 am
by vjcinjr
v6ph1 wrote: Thu Feb 23, 2017 12:46 am
Rule i: "Only one I, X, and C can be used as the leading numeral in part of a subtractive pair."
Ah - but that rule could be interpreted as giving restrictions on I, X and C because it says nothing about V, L or D.
I assume from your response that the rule means 'only I, X OR C can be used as a leading numeral in part of a subtractive pair AND when used in that way only one of those (not two or three) can be used in that way'. In other words, in the phrase 'subtractive pair' the word 'pair' means only two characters (i.e., IIX would be invalid because it is more than a 'pair' of 2 numerals.).
Thanks much for the quick response.
Re: Problem 089
Posted: Fri Feb 07, 2020 5:09 pm
by Junglemath
I think this entire problem needs to be rewritten, judging by the number of people who are utterly at sea regarding the rules to be followed in writing Roman numerals. For example, after giving the three basic rules in bold, it then discusses subtractive combinations, which immediately violates the first rule about numbers having to be written in descending size. An exception that is allowed to break the first basic rule should be highlighted as such.
Considering all this, it is very surprising that so many people actually managed to solve it.