L 系统可生成象鼻虫、比萨配料和母系世系。
L-systems generate weevils, pizza toppings, and matriarchal lineages

原始链接: https://blog.plover.com/2026/09/25/

这篇文章介绍了斐波那契 L 系统。这是一组替换规则——\(b \rightarrow a\) 和 \(a \rightarrow ab\)——用它生成的字符串中,各符号的出现次数遵循斐波那契数列。文章从经典的兔子繁殖问题谈起:幼兔经过一个月成熟,成年兔子此后每个月都会生下新的幼兔。 这些简单的规则还能生成有趣的模式,例如越来越复杂的象鼻虫名称,如“Zyzzyzyva”;披萨配料名称,如“peppepeppeppepperoni”;以及家庭称谓,如“Grandmammamammamma”。作者还指出,要生成准确的家庭称谓,需要跳过内部的一个“a”,而其他变体则被有意留作探索。总体而言,本文轻松地展示了一个简洁的重写系统如何产生斐波那契式增长,以及越来越长、令人难忘的词语。

# 黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 L 系统可以生成象鼻虫、披萨配料和母系家族谱系 ( plover.com ) 4 分 由 **surprisetalk** 提交 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 帮助 abound 16 分钟 ago [–] > 我试过让 Claude 帮我处理这篇文章,但她说这个前提太荒谬了,所以我只能自己来。 回复 考虑申请 YC 2027 年冬季批次! 申请截止至 11 月 2 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系我们 搜索:
相关文章

原文

L-systems generate weevils, pizza toppings, and matriarchal lineages

The Fibonacci sequence is so-called because in Western mathematics is first appears in connection with a problem from Fibonacci's 1202 book Liber Abaci. Fibonacci asks us to consider a rabbit farm where a pair of baby rabits grows to adulthood in one month, and an adult pair of rabbits gives birth to a new pair of babies after a month. Representing an adult pair with a and a baby pair with b, we could write this as:

    b → a
    a → ab

Starting with one pair of baby rabbits, and performing the indicated substitutions month by month, we get:

    b
    a
    ab
    aba
    abaab
    abaababa
    abaababaabaab
    abaababaabaababaababa
    abaababaabaababaababaabaababaabaab
    abaababaabaababaababaabaababaabaababaababaabaababaababa
    …

The total number of symbols (and pairs of rabbits) each month gives us the Fibonacci sequence, as does the total number of as, or the total number of bs, in each line.

A structure like this one, in which there are symbols, in this case a and b, that are repeatedly replaced with strings of symbols, is called an “L-system”, and this L-system in particular is the “Fibonacci L-system”.

Yesterday I happened to mention Zyzzyva, which is a genus of weevils that I can only assume was named by a biologist who wanted to be last in the dictionary. When I see a pattern like this I instantly think of the Fibonacci L-system. We can use the Fibonacci L-system to generate a sequence of increasingly long weevil names:

    Yva
    Zva
    Zyva
    Zyzva
    Zyzzyva
    Zyzzyzyzva
    Zyzzyzyzzyzzyva
    Zyzzyzyzzyzzyzyzzyzyzva
    Zyzzyzyzzyzzyzyzzyzyzzyzzyzyzzyzzyva
    Zyzzyzyzzyzzyzyzzyzyzzyzzyzyzzyzzyzyzzyzyzzyzzyzyzzyzyzva

Or pizza toppings:

    eroni
    proni
    peroni
    peproni
    pepperoni
    peppepeproni
    peppepeppepperoni
    peppepeppeppepeppepeproni
    peppepeppeppepeppepeppeppepeppepperoni
    peppepeppeppepeppepeppeppepeppeppepeppepeppeppepeppepeproni

Or family matriarchs:

    Grandma
    Grandmam
    Grandmamma
    Grandmammamam
    Grandmammamammamma
    Grandmammamammammamammamam
    Grandmammamammammamammamammammamammamma
    Grandmammamammammamammamammammamammammamammamammammamammamam

I had to cheat a little here because there's an a in the middle that I didn't substitute. If we don't skip that we get the unpronounceable “Grmammandmammamammamma”.

A quick computer search suggests several other variations, including both “mammaries” and “titties”, but to prevent this article from devolving into juvenile sniggering, I'm going to cut the scroll here.

Amazingly, there was a previous article on a closely related topic.

Street view of Philadelphia.  In
the center is a lamp post with two red and blue
Interstate highway shields affixed, indicating that entrances to I-76
West and I-676 East are ahead.

I tried to get Claude to help me with this article, but it said the premise was too stupid so I had to do it myself.

[Other articles in category /misc] permanent link


联系我们 contact @ memedata.com