PROGRAM BT4_5 PARAMETER (NMAX=100,MMAX=12) DIMENSION X(NMAX,MMAX) REAL MUY,MUY0,XICMA2, ALFA,U,UALFA,ALFA1,UALFA1 INTEGER N,M,I,J CHARACTER*15 H0,H1,ANSWER1,ANSWER2 ! MUY0: HANG SO ! XICMA2: PHUONG SAI CUA X ! ALFA, ALFA1: CAC XAC SUAT PHAM SAI LAM LOAI I DATA MUY0,XICMA2,ALFA,ALFA1 /23.5,0.1,0.05,0.01/ DATA H0,H1 /'CHAP NHAN H0','BAC BO H0'/ OPEN(1,FILE='C:\MASTER\G_TR\BAITAP~1\NEW\BANG10.TXT') READ(1,*) READ(1,*) READ(1,*) N,M DO I=1,N READ(1,*) TMP, (X(I,J),J=1,M) ENDDO ! TINH TRUNG BINH SO HOC MUY=0.0 DO I=1,N DO J=1,M MUY=MUY+X(I,J) ENDDO ENDDO MUY=MUY/REAL(N*M) ! TINH U VA CAC UALFA U=(MUY-MUY0)/SQRT(XICMA2)*SQRT(REAL(N)) UALFA=ANINV(1.0-ALFA/2.0,0.0,1.0) UALFA1=ANINV(1.0-ALFA1/2.0,0.0,1.0) IF (ABS(U).LT.UALFA) THEN ANSWER1=H0 ELSE ANSWER1=H1 ENDIF IF (ABS(U).LT.UALFA1) THEN ANSWER2=H0 ELSE ANSWER2=H1 ENDIF WRITE(*,*)' KET QUA KIEM NGHIEM U' WRITE(*,'(" MUY = ",F10.3)') MUY WRITE(*,'(" MUY0 = ",F10.3)') MUY0 WRITE(*,'(" N = ",I10)') N WRITE(*,'(" U = ",F10.3)') U WRITE(*,'(" ALFA = ",F10.3)') ALFA WRITE(*,'(" UALFA = ",F10.3)') UALFA WRITE(*,'(" KET LUAN: ",A15)') ANSWER1 WRITE(*,*) WRITE(*,'(" ALFA1 = ",F10.3)') ALFA1 WRITE(*,'(" UALFA1 = ",F10.3)') UALFA1 WRITE(*,'(" KET LUAN1: ",A15)') ANSWER2 WRITE(*,*) IF (ANSWER1.EQ.ANSWER2) THEN WRITE(*,*)' KHONG THAY DOI' ELSE WRITE(*,*)' THAY DOI' ENDIF END FUNCTION ANORMD(AMUY,XICMA,A,B) ! HAM NAY TINH XAC SUAT DE BIEN NGAU NHIEN PHAN BO CHUAN ! NHAN GIA TRI TRONG KHOANG (A,B): P(A