#author("2018-08-28T18:58:48+09:00","default:Miyashita","Miyashita")
#author("2018-09-14T00:47:51+09:00","default:Miyashita","Miyashita")
*Julia演習問題:乱数とソート [#z1d764ad]
**問題 [#n4d34307]
+0から100までの範囲で,50個の乱数列(整数)を作成し,その分布を調べなさい.
#codeprettify(lang-julia){{
N = 50
x = rand(N)
}}
+作成した乱数列データの平均値と標準偏差を求めなさい.
#codeprettify(lang-julia){{
Statistics.mean(x);
Statistics.std(x);
using Statistics: mean, std
mean(x) # or Statistics.mean(x);
std(x)  # or Statistics.std(x);
}}
+作成した乱数列データから上位5位の値を求め,乱数列のどの位置にあるのか図で示しなさい.
#codeprettify(lang-julia){{
sortperm(x)
Plots.bar(x, ...)
Plots.scatter!()
}}
***解答例(参考) [#tf775f30]
#ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/julia/rand_bar.png,600x450)

Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes