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

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

APL, 24 bytes

{.5*⍨+/(2*⍨⍵-+/⍵÷≢⍵)÷≢⍵}

A little different approach than Dennis' Dyalog APL solution Dennis' Dyalog APL solution. This should work with any APL implementation.

This creates an unnamed monadic function that computes the vector (x - μ)2 as 2*⍨⍵-+/⍵÷≢⍵, divides this by N (÷≢⍵), takes the sum of this vector using +/, and then takes the square root (.5*⍨).

Try it online

APL, 24 bytes

{.5*⍨+/(2*⍨⍵-+/⍵÷≢⍵)÷≢⍵}

A little different approach than Dennis' Dyalog APL solution. This should work with any APL implementation.

This creates an unnamed monadic function that computes the vector (x - μ)2 as 2*⍨⍵-+/⍵÷≢⍵, divides this by N (÷≢⍵), takes the sum of this vector using +/, and then takes the square root (.5*⍨).

Try it online

APL, 24 bytes

{.5*⍨+/(2*⍨⍵-+/⍵÷≢⍵)÷≢⍵}

A little different approach than Dennis' Dyalog APL solution. This should work with any APL implementation.

This creates an unnamed monadic function that computes the vector (x - μ)2 as 2*⍨⍵-+/⍵÷≢⍵, divides this by N (÷≢⍵), takes the sum of this vector using +/, and then takes the square root (.5*⍨).

Try it online

Source Link
Alex A.
  • 24.8k
  • 5
  • 39
  • 120

APL, 24 bytes

{.5*⍨+/(2*⍨⍵-+/⍵÷≢⍵)÷≢⍵}

A little different approach than Dennis' Dyalog APL solution. This should work with any APL implementation.

This creates an unnamed monadic function that computes the vector (x - μ)2 as 2*⍨⍵-+/⍵÷≢⍵, divides this by N (÷≢⍵), takes the sum of this vector using +/, and then takes the square root (.5*⍨).

Try it online

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