Skip to content

Commit

Permalink
update text
Browse files Browse the repository at this point in the history
  • Loading branch information
yoninazarathy committed Nov 12, 2020
1 parent ce73bbf commit 245d944
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions 1_chapter/fast.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Statistics

@time begin
data = [mean(rand(5*10^2)) for _ in 1:10^6]
println("98% of the means lie in the estimated range: ",
(quantile(data,0.01),quantile(data,0.99)) )
data = [mean(rand(5*10^2)) for _ in 1:10^6]
println("98% of the means lie in the estimated range: ",
(quantile(data,0.01),quantile(data,0.99)) )
end
18 changes: 9 additions & 9 deletions 1_chapter/slow.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Statistics

@time begin
data = Float64[]
for _ in 1:10^6
group = Float64[]
for _ in 1:5*10^2
push!(group,rand())
end
push!(data,mean(group))
data = Float64[]
for _ in 1:10^6
group = Float64[]
for _ in 1:5*10^2
push!(group,rand())
end
println("98% of the means lie in the estimated range: ",
(quantile(data,0.01),quantile(data,0.99)) )
push!(data,mean(group))
end
println("98% of the means lie in the estimated range: ",
(quantile(data,0.01),quantile(data,0.99)) )
end

0 comments on commit 245d944

Please sign in to comment.