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

added 1027 characters in body
Source Link

Jelly, 27 bytes

_ÆmÆḊ÷L1⁄2$
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€

Try it online!

How it works

_ÆmÆḊ÷L1⁄2$ - Helper link. Takes a list l on the left
 Æm - Yield the mean of l
_ - Subtract the mean from each element of l
 ÆḊ - Calculate the norm
 $ - Run the previous two commands over l:
 L - Length of l
 1⁄2 - Square root
 ÷ - Divide the norm by the square root of l's length
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€ - Main link. Takes a list l on the left
W - Yield [l]
 ẋ9 - Repeat 9 times
 9ƭ€ - Generate a 9 element list by running the previous 9 commands over l
 and collecting the results together:
 S - Sum
 P - Product
 Æm - Mean
 Æṁ - Median
 I - Forward increments
 Ṣ - Sort
 Ṃ - Minimum
 Ṁ - Maximum
 Ç - Helper link (standard deviation)

Jelly, 27 bytes

_ÆmÆḊ÷L1⁄2$
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€

Try it online!

Jelly, 27 bytes

_ÆmÆḊ÷L1⁄2$
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€

Try it online!

How it works

_ÆmÆḊ÷L1⁄2$ - Helper link. Takes a list l on the left
 Æm - Yield the mean of l
_ - Subtract the mean from each element of l
 ÆḊ - Calculate the norm
 $ - Run the previous two commands over l:
 L - Length of l
 1⁄2 - Square root
 ÷ - Divide the norm by the square root of l's length
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€ - Main link. Takes a list l on the left
W - Yield [l]
 ẋ9 - Repeat 9 times
 9ƭ€ - Generate a 9 element list by running the previous 9 commands over l
 and collecting the results together:
 S - Sum
 P - Product
 Æm - Mean
 Æṁ - Median
 I - Forward increments
 Ṣ - Sort
 Ṃ - Minimum
 Ṁ - Maximum
 Ç - Helper link (standard deviation)
Source Link

Jelly, 27 bytes

_ÆmÆḊ÷L1⁄2$
Wẋ9SPÆmÆṁIṢṂṀÇ9ƭ€

Try it online!

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