8 ms·
It looked like it was a simple L-system to me... V : 1 2 ω : 1 P : (11 -> 21) (2 -> 12) (1 -> 11) I think that matches the information given in the question
by tubs 14y ago
It looked like it was a simple L-system to me...
V : 1 2
ω : 1
P : (11 -> 21) (2 -> 12) (1 -> 11)
I think that matches the information given in the question. Would that be an "incorrect answer"?
- gmt2027 14y agoAccording to wikipedia[1], the sequence goes 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... [1] http://en.wikipedia.org/wiki/Look-and-say_sequence http://en.wikipedia.org/wiki/Look-and-say_sequence
- tubs 14y agoAye, but the L-system still fits given the amount of data shown in the question. So is the L-system incorrect, because there's no way to disambiguate the sequence given the data?
- raverbashing 14y agoI think you're right on the money Your major problem would be finding an interviewer who knows what's an L-System Edit: you should add the rule 111->31, so it may not be an l-system because there are infinite rules? (1111->41), etc Or we limit it up to digit 9
- PeterisP 14y agoThe whole point is that the provided data supports many different completely valid sequences - unless that specific 'look-and-say' is very common in the company problem domain, there are multiple valid answers. That's an issue with any sequence-style problems.