import cern.jet.random.*;
import cern.jet.random.engine.RandomEngine;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
import java.awt.print.PrinterJob;
import java.awt.print.*;

public class randex
{  
	public static double randg(double alpha)
	{//0<=alpha<=1
	double d=1.0334-0.0766*Math.exp(2.2942*alpha);
	double a=Math.pow(2,alpha)*Math.pow((1.0-Math.exp(-0.5*d)),alpha);
	double b=alpha*Math.pow(d,(alpha-1.0))*Math.exp(-d);
	double c=a+b;
	double U=0;
	double V=0;
	double X=0;
	boolean check=true;
	double vv=0;
	while(check)
	{
	U=Math.random();
	if(U<=(a/c)) {X=-2.0*Math.log(1.0-Math.pow((c*U),(1.0/alpha))/2.0);}
	else         {X=-Math.log(c*(1*U)/(alpha*Math.pow(d,(alpha-1.0))));}
	V=Math.random();
	if(X<=d) {vv=Math.pow(X,(alpha-1)*Math.exp(-X/2.0))/Math.pow(2.0,(alpha-1.0))/Math.pow((1.0-Math.exp(-X/2.0)),(alpha-1.0));
	              if(V<=vv) {check=false;}
	              else      {check=true;}
	         }
	else if(X>d) {vv=Math.pow((d/X),(1.0-alpha));
	             if(V<=vv) {check=false;}
	             else      {check=true;}
	             }
	}
	return X; 
	}
public static void main(String arg[])
{   double x[]=new double[100000];
    double y[]=new double[100000];
    double z[]=new double[100000];
    double alpha=0;
    Gamma g;
    double yy[]=new double[160];
    double zz[]=new double[160];
    for(int j=1;j<=159;j++)
    {
	alpha=0.0125*j/2.0;
	g=new Gamma(alpha, 0.5,RandomEngine.makeDefault() );
	yy[j]=0;
	zz[j]=alpha;
    for(int i=0;i<x.length;i++)
    {    
	  y[i]=g.nextDouble();
      //y[i]=randg(alpha);
      yy[j]+=y[i];
    }
    yy[j]/=x.length;
    System.out.println(zz[j]+" "+yy[j]);
    }
    double y1[][]={yy};
    double x1[][]={zz};
    int c1[]={0};
    Color co[]={Color.black};
    vplot v=new vplot(c1,co,x1,y1);
    v.plot();
	}
}