fitting the p value

Viewed 28

Hello my dear python enthusiasts, I have a problem in my python program that I have been writing and I could use some help. I want to Fit this code so it looks like the picture I uploaded, but I dont know how to to it. Thank for the help. https://drive.google.com/file/d/186-HbjC_Z80htW1OFA7BGvihxPKtCQba/view?usp=sharing

Here is the code that i have been writing:

import random
import numpy as np

def chisq(ndof: int):
    sqr=lambda x: x*x
    cs=np.array([sqr(random.gauss(0,1))
                    for i in range(0,ndof) ]).sum()
    return cs/ndof
ndof=2
nstat=100000

A=np.array([chisq(ndof) for i in range (0,nstat)])
A.sort();
for i in range (0,nstat):
    print(A[i],1-i/nstat);
1 Answers
Related