mirror of
https://github.com/Zenithsiz/ist-pe-proj.git
synced 2026-02-03 05:57:12 +00:00
Solved problem 7.
This commit is contained in:
parent
18a149dc7b
commit
c5ae79b41a
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -10,6 +10,7 @@
|
||||
"Ocupação",
|
||||
"País",
|
||||
"pessoais",
|
||||
"probs",
|
||||
"readxl",
|
||||
"remunerado",
|
||||
"Sexo",
|
||||
|
||||
1
7/answer.txt
Normal file
1
7/answer.txt
Normal file
@ -0,0 +1 @@
|
||||
0.0809
|
||||
15
7/script.R
Executable file
15
7/script.R
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/env Rscript
|
||||
|
||||
# Set the seed for the RNG
|
||||
set.seed(1310)
|
||||
|
||||
# Generate all the numbers
|
||||
n <- 18
|
||||
nums_len <- 3000
|
||||
nums <- sapply(1:nums_len, function(idx) {
|
||||
sum(rnorm(18, mean = 0, sd = 1)^2)
|
||||
})
|
||||
found_q <- quantile(nums, probs = 0.45, type = 2, names = FALSE)
|
||||
expected_q <- 16.610782192541615317452678264022358815695613493397815519636198613
|
||||
|
||||
print(round(abs(found_q - expected_q), 4))
|
||||
Loading…
x
Reference in New Issue
Block a user