Skip to main content
added 121 characters in body
Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 23 bytes

x=rnorm(3) x/(x%*%x)^.5 

Try it online!

Generates 3 realizations of the \$\mathcal N(0,1)\$ distribution and normalizes the resulting vector.

Plot of 1000 realizations:

enter image description here

R, 23 bytes

x=rnorm(3) x/(x%*%x)^.5 

Try it online!

Generates 3 realizations of the \$\mathcal N(0,1)\$ distribution and normalizes the resulting vector.

R, 23 bytes

x=rnorm(3) x/(x%*%x)^.5 

Try it online!

Generates 3 realizations of the \$\mathcal N(0,1)\$ distribution and normalizes the resulting vector.

Plot of 1000 realizations:

enter image description here

Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 23 bytes

x=rnorm(3) x/(x%*%x)^.5 

Try it online!

Generates 3 realizations of the \$\mathcal N(0,1)\$ distribution and normalizes the resulting vector.