Programming & Compilers
Rewrite order cost: smaller peak, unchanged work
An original finite rewriting example separates total unit actions from peak live symbols and proves which quantity ordering can reduce.

Rewrite order cost can stay fixed even when the longest intermediate word changes. Start with the single symbol A. Replace one A with BB, replace one B with CC, or delete one C. Charge one unit for each application to one occurrence. A schedule that expands everything before deleting anything reaches four live symbols. A schedule that deletes earlier reaches only three. Both finish in seven actions. The difference is one symbol at the peak, with no reduction in total unit actions.
This is a finite symbolic example. Its symbols have no assigned byte size, and an action has no assigned duration or price. The comparison answers a precise question inside the stated rules: which quantity can choosing a different order reduce? Keeping the two quantities separate lets us prove the result without treating a shorter row as evidence of less total work.
Fix the rules before comparing schedules
A state is a finite word made from A, B and C, including the empty word. Begin at A. At each action choose one occurrence and apply its rule: A becomes BB, B becomes CC, and C becomes empty. Preserve the order of every other occurrence. A rule changes one selected occurrence even when the word contains several identical letters. For example, applying the B rule to the rightmost B in BB gives BCC. Applying it to the leftmost B gives CCB.
Writing empty at the end means that no symbols remain. It is a state, rather than a fourth kind of symbol. A complete run begins at A and ends at empty. We count the initial state and every later state when measuring the peak live word length. We count rule applications when measuring the total action cost. Eight written states therefore describe seven actions between them.
The unit convention matters. Expanding B to CC counts as one action, even though the displayed word gets longer. Deleting one C also counts as one action. Deleting two C occurrences takes two actions. There is no rule for deleting a whole row at once, and adjacent equal symbols do not merge. Allowing either of those operations would change the problem and invalidate a comparison made under these rules.
For any complete run, record two numbers. Its total cost is the number of arrows between successive states. Its peak is the greatest number of symbols in any state on that run. A state such as CCB has length three, while its next state could be CB, with length two, or CCCC, with length four. The current length alone does not determine how many actions remain.
Expand first and the word reaches four
One complete run is A, BB, CCB, CCCC, CCC, CC, C, empty. The first action expands A. The second expands the left B. Expanding the remaining B before deleting a C produces CCCC at the third action. Four individual deletions then remove those four occurrences. Counting the transitions gives one initial expansion, two B expansions and four C deletions, for seven actions altogether.
The successive lengths are one, two, three, four, three, two, one and zero. The largest is four. This run is legal throughout: every expansion selects an occurrence actually present, and each deletion removes one C. It is useful as an explicit comparison run because the state at the peak is visible. We do not have to estimate an average length or infer the peak from the final empty result.
The three expansions do not create optional C work. Starting with one A creates two B occurrences, and expanding those two occurrences creates four C occurrences. Each of those must eventually be deleted. Expanding them sooner changes when they coexist. It does not create an extra deletion beyond the four already required by the complete expansion.
Delete earlier and the peak falls to three
Now use A, BB, CCB, CB, B, CC, C, empty. After expanding the left B, delete the two C occurrences before expanding the other B. The fourth state CB has two symbols; deleting its C leaves B. Expand that B into CC and delete those two C occurrences separately. The sequence still contains seven arrows, and every arrow applies exactly one of the permitted rules.
The lengths are one, two, three, two, one, two, one and zero. Their maximum is three. Compared with the first run, the peak falls from four to three. The total action count stays at seven. In this example, saying that deleting early saves work would be inaccurate under the unit action convention. The verified saving is one simultaneously live symbol at the peak.
Both runs pass through CCB. That shared state makes the difference especially clear. In the expansion-first run, the next action expands B and raises the length to four. In the deletion-early run, the next action deletes C and lowers the length to two. Neither choice changes the eventual obligation to expand that B once and delete its resulting two C occurrences.
Deleting only one of the two C occurrences before expanding B also keeps the peak at three. From CCB, move to CB and then to CCC. Delete the remaining three C occurrences to finish. This gives another seven-action run. The earlier run supplies a convenient witness for the minimum peak; it does not establish a unique optimal schedule.
A decreasing weight proves every complete cost
Assign A weight seven, B weight three and C weight one. Define a word's weight by adding its symbol weights. Thus BB has weight six, CCB has weight five, and CCCC has weight four. Empty has weight zero. These weights are a proof device for counting remaining rule applications. They are separate from the word length used to measure the peak.
Each rule reduces this weight by exactly one. Replacing A by BB changes seven to three plus three. Replacing B by CC changes three to one plus one. Deleting C changes one to zero. In a longer word, every unselected occurrence keeps the same weight, so the same decrease of one holds wherever the selected occurrence sits.
After t actions, the current weight is seven minus t. This follows directly from the starting weight seven and the exact decrease at every step. Any complete run ends at weight zero, so its action count must be seven. The result covers every legal ordering, including ones absent from the two displayed examples. There cannot be a six-action complete run under this convention.
The weight also proves termination. All symbol weights are positive integers, so a nonempty word has positive weight. Every nonempty word contains A, B or C, and therefore permits an action. A legal run cannot stop at a nonempty word merely because no rule applies. It cannot continue beyond seven actions either, because the weight would become negative. Hence every maximal legal run reaches empty after exactly seven actions.
Notice how length and weight behave during an expansion. At CCB, the length is three and the weight is five. Expanding B produces CCCC, whose length is four and whose weight is four. The word grows while its remaining action count falls. Deleting a C instead produces CB, whose length is two and whose weight is also four. Those two next states have the same remaining unit cost and different live lengths.
Three is the smallest possible peak
The first action is forced: the initial A becomes BB. At that point the word has length two. Neither occurrence is a C, so a deletion is unavailable. A legal second action must expand one of the B occurrences. Whichever B is chosen, the result has two C occurrences and one B, making its length three. Every complete run therefore reaches a state of length at least three.
The deletion-early run already displayed has no state longer than three. It attains the lower bound forced by the first two actions. Together, the lower bound and this explicit witness prove that the minimum achievable peak is exactly three. Showing a run with peak three alone would only establish that three is achievable; the forced expansion argument establishes that two is impossible.
Four is also the largest peak in this particular system. After the initial expansion there are only two B occurrences to expand. They can create at most four C occurrences in total, and C never creates a new symbol. Before both B occurrences expand, a state contains at most one remaining B alongside two C occurrences. The initial A and BB states have lengths one and two. No reachable state can have length five.
Thus all complete schedules have one of two peak lengths, three or four, and all have cost seven. Choosing order has room to improve the peak within that narrow range. The proof gives no corresponding improvement in action count, because the decreasing weight has already fixed that count for every complete schedule.
What the exhaustive check counts
An exhaustive enumeration of this exact rule system finds twelve reachable words. It finds eighty complete action sequences when choices of occurrence position distinguish actions. Thirty-two of those sequences have peak three, and forty-eight have peak four. Every sequence has seven actions. The enumeration agrees with the independent weight proof and the forced lower bound.
Occurrence choices can produce the same visible words. For example, from CC, deleting the left C and deleting the right C both leave C. The two selected positions are different actions in an occurrence-level enumeration. If a record preserves only the successive words, it loses that distinction. Grouping by complete visible word traces gives six traces, rather than eighty.
Those counts do not assign probabilities. No random procedure for choosing a rule or occurrence has been specified. Thirty-two out of eighty is a count of enumerated paths under one explicit distinction, rather than a prediction about how often a person or program will choose the smaller peak. A probability claim would need a separate selection model.
The enumeration is a finite check of A, these three rules and this initial state. It establishes no general scheduling theorem for other rewrite systems. A changed rule could alter the total cost, introduce an endless run or require another lower bound. Even a different starting word would require its own initial weight and peak analysis. The seven-action conclusion belongs to the example as defined.
Two catalogue scenes outside the symbolic proof
The native FashionCha Multicolor Music Snow Globe account describes one Christmas decoration. Its gallery shows an arched glitter scene with a village interior and sleigh figures above. A different scene in a details inset is an illustration, not an additional supplied globe. The catalogue name identifies this source; it does not authenticate a maker or establish lighting, music, power or material performance.
The native FVDPWYE Red Snow Globe account describes one carriage-shaped decoration. The originals show an ornate red and gold body with integral wheels and a Christmas interior. Background lanterns in a staged picture are separate props. Neither physical decoration supplies the symbolic rewrite rules, and neither account proves a timing, storage, energy or financial saving from the seven-action example.
Other exact cost comparisons
The weighted route cost guide compares routes by adding their stated edge costs. Its reader decision concerns unequal action prices. The present example fixes every rule application at one unit, then proves that ordering changes peak length while leaving the full action total equal.
The one-position change puzzle guide studies a fixed-position mismatch bound and an attaining route. Here, rule applications change word length. The lower bound of three concerns a forced intermediate live length, while the decreasing weight fixes every complete run's total cost at seven.
Report the two results separately
For this initial A and these unit-cost rules, a complete report is: seven actions for every complete run; minimum peak three, attained by deleting C occurrences before expanding the remaining B; expansion-first peak four. The lower peak removes one simultaneously live symbol from the largest intermediate word. It removes zero rule applications from the complete run.
Checking a separate Republeq crypto purchase
If you choose to investigate a crypto purchase at republeq.com, treat that transaction as a separate decision from the symbolic example. Check the actual item, selected variant, quantity and current terms presented for the order. A catalogue photograph with several decorations does not establish that every pictured object belongs to the selected offer. Read the order summary for what is being supplied and seek clarification if the description and selected option disagree. If the current checkout presents USDT as an option, check the stated asset and network together before preparing a transfer. Do not infer a network from the token name alone. Compare the destination and required details with the current checkout instructions, and pause if those instructions are missing or inconsistent. Review any displayed fees, total amount, expiry conditions and order reference before deciding whether to proceed. Keep a record of the actual instructions and transaction details if you make a payment, and use the merchant's current support route for an unresolved order question. This article does not establish which payment options are available for a particular order, promise a transfer outcome or replace the checkout terms. The seven abstract actions have no monetary value assigned to them. A lower peak in a word of letters supplies no evidence that a purchase, payment network or physical product costs less. Likewise, the catalogue names are source identifiers here, rather than an endorsement of the decorations or their payment arrangements. Continue only when the current product and transaction details answer your own questions; otherwise leave the purchase undecided while retaining the mathematical result independently.