Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

correct arithmetic description (2÷⍨x is x/2, not 2/x).
Source Link

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

This consists of three parts: (2÷⍨+)⌿∘⌽ (,,-) +⌿÷≢

+⌿ ÷ ≢ is the sum divided by the count

(...)⌿∘⌽ reverses the list and then reduces from right to left using the function:
2÷⍨+ add next value to previous value and divide two by that by two

(,,-) is the concatenation of the PM and the SM, concatenated to their difference

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

This consists of three parts: (2÷⍨+)⌿∘⌽ (,,-) +⌿÷≢

+⌿ ÷ ≢ is the sum divided by the count

(...)⌿∘⌽ reverses the list and then reduces from right to left using the function:
2÷⍨+ add next value to previous value and divide two by that

(,,-) is the concatenation of the PM and the SM, concatenated to their difference

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

This consists of three parts: (2÷⍨+)⌿∘⌽ (,,-) +⌿÷≢

+⌿ ÷ ≢ is the sum divided by the count

(...)⌿∘⌽ reverses the list and then reduces from right to left using the function:
2÷⍨+ add next value to previous value and divide that by two

(,,-) is the concatenation of the PM and the SM, concatenated to their difference

explanation
Source Link
Adám
  • 31.8k
  • 4
  • 131
  • 292

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

This consists of three parts: (2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

+⌿ ÷ ≢ is the sum divided by the count

(...)⌿∘⌽ reverses the list and then reduces from right to left using the function:
2÷⍨+ add next value to previous value and divide two by that

(,,-) is the concatenation of the PM and the SM, concatenated to their difference

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

This consists of three parts: (2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

+⌿ ÷ ≢ is the sum divided by the count

(...)⌿∘⌽ reverses the list and then reduces from right to left using the function:
2÷⍨+ add next value to previous value and divide two by that

(,,-) is the concatenation of the PM and the SM, concatenated to their difference

-2
Source Link
Adám
  • 31.8k
  • 4
  • 131
  • 292

APL (Dyalog Unicode), 20 (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,-,-)+⌿÷≢

Try it online! Try it online!

APL (Dyalog Unicode), 20 bytes SBCS

(2÷⍨+)⌿∘⌽(,-,)+⌿÷≢

Try it online!

APL (Dyalog Unicode), (削除) 20 (削除ここまで) 18 bytes SBCS

-2 thanks to Bubbler.

Anonymous tacit prefix function. Returns list of Progressive MeanTM, Standard Mean, Trend.

(2÷⍨+)⌿∘⌽(,,-)+⌿÷≢

Try it online!

Source Link
Adám
  • 31.8k
  • 4
  • 131
  • 292
Loading

AltStyle によって変換されたページ (->オリジナル) /