



      real*8 pnew(4),aux,auxi,uni(100000,4,1)
      real*8 err,thumb,dbetin
      real*8 xguess(12),xres(12),rp(5),fv(12),xsc(12),fsc(12)
      real*8 xnew(12),error,moy,std,test
      real*8 mu,sigma,xinf,xsup,aux1,aux2,moy1,moy2,std1,std2
      real*8 aux11,aux22,dnordf,dnorin
      integer ip(6),m,i,j,l,t,kk,jj,ii,nn,zz
      character rep

      real*8 erre,u(100000,10,1)
      integer mc,nj,no,np

      external erset,thumb,drnun,drnnor,dbetin,dneqbf,rnset
      external dsvrgp,dnordf,dnorin,dgamma
      intrinsic dlog,dexp
      open(unit=60,file='data_asym_10_4.dat',status='new')
c      open(unit=60,file='data_asym_10_5.dat',status='new')
c      open(unit=60,file='data_sym_10_5.dat',status='new')
c      open(unit=60,file='data_sym_10_4.dat',status='new')

c data
      write(6,*)'start'
      call rnset(642867)

c      mc=100000
      mc=10000
      nj=4
      no=1

c parameters of the beta  distributions
c  bidders 1 and 2

      pnew(1)=3.0d0
      pnew(2)=3.0d0

c parameters of the beta distributions
c  bidders 3 and 4

       pnew(3)=5.0d0
c      pnew(3)=3.0d0
      pnew(4)=3.0d0


      moy1=0.0d0
      std1=0.0d0
      moy2=0.0d0
      std2=0.0d0

      do 310 m=1,mc
 
      call drnun(1,uni(m,1,1))
      call drnun(1,uni(m,2,1))
      call drnun(1,uni(m,3,1))
      call drnun(1,uni(m,4,1))

        write(6,*)m
        aux=dbetin(uni(m,1,1),pnew(1),pnew(2))
        moy1=moy1+aux
        u(m,1,1)=aux

        aux=dbetin(uni(m,2,1),pnew(1),pnew(2))
        moy1=moy1+aux
        u(m,2,1)=aux

        aux=dbetin(uni(m,3,1),pnew(3),pnew(4))
        moy2=moy2+aux
        u(m,3,1)=aux

        aux=dbetin(uni(m,4,1),pnew(3),pnew(4))
        moy2=moy2+aux
        u(m,4,1)=aux
c      write(6,*)m,u(m,1,1),u(m,2,1),u(m,3,1),u(m,4,1)
c      read *,rep

  310 continue


      moy1=moy1/(m*2.0d0)
      moy2=moy2/(m*2.0d0)
      do 315 m=1,mc
         std1=std1+(u(m,1,1)-moy1)**2
         std2=std2+(u(m,3,1)-moy2)**2
         write(60,100)u(m,1,1)
         write(60,100)u(m,2,1)
         write(60,100)u(m,3,1)
         write(60,100)u(m,4,1)
  315 continue
      std1=std1/(m*1.0d0)
      std2=std2/(m*1.0d0)

      write(6,*)"moy et std player 1",moy1,std1**0.5
      write(6,*)"moy et std player 4",moy2,std2**0.5

  100 format (2d20.12)

      end






