m (Created page with "= Crash course in Julia (programming) = Julia is a powerful/efficient/high-level computer programming language. You can get into interact...") |
m |
||
Line 24: | Line 24: | ||
lst=[rand()^2 for i=1:10^5] | lst=[rand()^2 for i=1:10^5] | ||
</code> | </code> | ||
+ | |||
+ | and after | ||
+ | |||
+ | <code lang="julia"> | ||
+ | using Plots | ||
+ | histogram(lst) | ||
+ | </code> | ||
+ | |||
+ | <center><wz tip="Distribution of $10^5$ squared random numbers.">[[File:julia-randX2.png|400px]]</wz></center> |
Julia is a powerful/efficient/high-level computer programming language. You can get into interacting mode right-away with:
julia
You may need to install packages, which can be done as follows:
import Pkg; Pkg.add("Distributions")
Once this is done (once for ever on a given machine), you can then be:
using Distributions
Let us generate ten thousands random points following a squared-uniform probability distribution, $X^2$.
lst=[rand()^2 for i=1:10^5]
and after
using Plots
histogram(lst)