TOPICS
Search

Sequential Substitution System


SequentialSubstitutionSystem1

A sequential substitution system is a substitution system that applies one replacement at each step. In the rule-priority convention used here, the whole string is scanned from left to right for a match to the first rule. If it has no match, the whole string is scanned for the second rule, and so on. The leftmost match of the first applicable rule is replaced. If no rule applies, the string repeats indefinitely for all subsequent steps (Wolfram 2002, p. 90). For example, consider the single rule A->B and the initial string ABA, illustrated above. The first step yields BBA, the second step yields BBB, and from there on the system repeats since there are no more matches of the pattern rule.

SequentialSubstitutionSystem2

A more interesting sequential substitution system is illustrated above (Wolfram 2002, p. 90). This system has two rules (ABA->AAB,A->ABA) and the initial condition BABA. It builds increasingly long runs of sequential As followed by sequential Bs by repeatedly applying ABA->AAB to move a B past an A, then applying A->ABA whenever the first rule has no match.

SequentialSubstitutionSystem3

The system illustrated above uses rules (AB->BA,B->AB) and initial string ABAB. Under rule priority, its first steps are BAAB, BABA, and BBAA. In particular, the original rightmost AB is replaced at the second step.

An alternative position-priority convention scans the string from left to right for the first position where any rule matches, then applies the first matching rule there. For these same rules and initial string, it instead gives BAAB, ABAAB, and BAAAB. Under this alternative convention, the rightmost AB is never replaced because an earlier B or AB always supplies a match.

Even under rule priority, some parts of a string can remain unchanged indefinitely. For example, the rules (A->AA,B->A) starting from AB give AAB, AAAB, AAAAB, .... The first rule always applies, so the B is never replaced.


See also

Multiway System, Substitution System

Portions of this entry contributed by Todd Rowland

Explore with Wolfram|Alpha

References

Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, pp. 88-92 and 893, 2002.

Referenced on Wolfram|Alpha

Sequential Substitution System

Cite this as:

Weisstein, Eric W., with contributions by Todd Rowland. "Sequential Substitution System." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/SequentialSubstitutionSystem.html

Subject classifications