From 8342ba5e9392811dbc0514a97e847a44a5b330a2 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 6 Jun 2022 21:29:06 -0400 Subject: When I wrote all these docs did I really understand I'd have to edit them? --- docs/doc/repeat.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/repeat.html') diff --git a/docs/doc/repeat.html b/docs/doc/repeat.html index b5e4ba06..bf097430 100644 --- a/docs/doc/repeat.html +++ b/docs/doc/repeat.html @@ -12,7 +12,7 @@ »3 "ABCDE" " AB" -

In mathematics (which unsurpisingly tends to use complicated terms to talk about an easy concept), this kind of repetition is called an iterated function and written with exponential notation. It's related to function composition in the same way that exponentiation () relates to multiplication (×): function iteration is repeated composition.

+

In mathematics (which unsurpisingly tends to use complicated terms to talk about an easy concept), this kind of repetition is called an iterated function and written with exponential notation. It's related to function composition in the same way that exponentiation () relates to multiplication (×): function iteration is repeated composition.

n4  ←→  n×n×n×n
 F4  ←→  FFFF
 
@@ -25,7 +25,7 @@ 3 + 3 + 7 13 -

This kind of composition can't be represented by anymore (you'd need a train), but it's similar in spirit. 𝕨 𝔽n 𝕩 is always equivalent to 𝕨𝔽n 𝕩, provided n is a constant—not a function, as discussed in the next section.

+

This kind of composition can't be represented by anymore (you'd need a train), but it's not much of a leap. 𝕨 𝔽n 𝕩 is always equivalent to 𝕨𝔽n 𝕩, provided n is a constant—not a function, as discussed in the next section.

Dynamic repetition count

In the general case, 𝔾 is a function, which is applied to all arguments to get the repetition count. That is, the actual count is 𝕨𝔾𝕩.

↗️
    1 4
@@ -43,11 +43,11 @@
 ⟨ 2 3 3 ⟩
 

Negative repetition

-

What does it mean to repeat a function a negative number of times? For a negative integer -n, BQN defines F(-n) to be Fn. In particular, F¯1 simply undoes F.

+

What does it mean to repeat a function a negative number of times? For a negative integer -n, BQN defines F(-n) to be Fn. In particular, F¯1 simply undoes F.

↗️
    1 ¯1 "abcde"  # Rotate backwards
 "eabcd"
 
-

Because BQN's Undo is a little looser than a strict mathematical inverse, this is an extension of the function inverse written f⁻¹ in mathematics. As a result, it doesn't have all the same properties. For natural numbers, Repeat follows the rule that Fm Fn 𝕩 is F(m+n) 𝕩. For integers, we have 𝕩 Fn F(-n) 𝕩, but not necessarily 𝕩 F(-n) Fn 𝕩.

+

Because BQN's Undo is a little looser than a strict mathematical inverse, this is an extension of the function inverse written f⁻¹ in mathematics. As a result, it doesn't have all the same properties. For natural numbers, Repeat follows the rule that Fm Fn 𝕩 is F(m+n) 𝕩. With a negative, we have 𝕩 Fn F(-n) 𝕩, but not necessarily 𝕩 F(-n) Fn 𝕩.

Array of repetition counts

The value of 𝕨𝔾𝕩 might also be an array, whose elements are any valid repetition values—integers, or other arrays. Each integer in the nested structure is replaced with the result of repeating 𝔽 that many times.

↗️
    2×2,4,¯2,1⟩⟩ 1
-- 
cgit v1.2.3