
## com43a of september 2024
#  a little Ch1 exercise stk4011
#  B^2 - 4C positive ? 

sim <- 10^5
Bsim <- rnorm(sim)
Csim <- rnorm(sim)
plot(Bsim,Csim)

check <- mean(1*(Bsim^2 > 4*Csim))
print(check)
# 0.588

# Pr(4C < B^2) : 

inte <- function(u)
{ pnorm(u/4)*dchisq(u,1) }

curve(inte,0,5)
integrate(inte,0,10) # 0.5873

