Talk:Execute a Markov algorithm: Difference between revisions

m
Line 98:
:I guess, on reflection, the logic in the ''replace'' function of the Python example is not straight-forward, but at the time, I just took the spec as being correct, I have no reason to question it? --[[User:Paddy3118|Paddy3118]] 05:03, 16 December 2009 (UTC)
:: So did I, until I re-read the WP page, and in particular Physis' "Example" section on the Talk page. The primary surprise (for me) is that you may only do one replacement at a time, then you must start all over from the beginning, until you hit a terminating rule or you stop doing replacements (i.e. the output is stable).
::So, e.g., if you have the rules <code>abaa->bdef, baaa->defb</code>, then applied to the input <code>aaa</code> your result must be <code>def</code>. This was an eye-opener for me, because I would expect the result <code>bbb</code>. But then, J is an array-oriented language and likes to do things "all at once" or "in bulk", so maybe this single-match iterative approach is natural to scalar languages. --[[User:DanBron|DanBron]] 12:48, 16 December 2009 (UTC)
 
===Markov a specific form of Rewriting scheme?===
Anonymous user