Vous êtes sur la page 1sur 25

Grupo XB

Profesora: Gmez Ortiz Guadalupe

Equipo:

Martnez Uribe Irving Ulises


Carmona Unzueta Omar
Agero Gonzlez Miguel ngel

Flores Castillo Cesar David

ACONTINUACIO SE MUESTRA EL CODIGO DEL PROGRAMA QUE GENERA ORDENA Y DETERMINA


DIFERENTES FACTORES COMO MEDIA Y VARIANZA :
package generador_ale;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.Math;
import java.io.*;
import java.text.DecimalFormat;
import java.util.StringTokenizer;
public class Generador_Ale extends javax.swing.JFrame {
public double [] ecko ;
public int cv;
public Generador_Ale() {
initComponents();
}
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton9 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jButton11 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
jButton14 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jButton1.setText("Algoritmo Productos Medios");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});

jButton2.setText("Algoritmo Lineal");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
}
});
jButton3.setText("Algoritmo Multiplicador Constante");
jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton3MouseClicked(evt);
}
});
jButton4.setText("Salir");
jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton4MouseClicked(evt);
}
});
jButton5.setText("Limpiar");
jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton5MouseClicked(evt);
}
});
jButton6.setText("Algoritmo congruencial multiplicativo");
jButton6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton6MouseClicked(evt);
}
});
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton7.setText("Prueba de Medias");
jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton7MouseClicked(evt);
}
});
jButton8.setText("Prueba de Varianza");
jButton8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton8MouseClicked(evt);
}
});
jButton9.setText("Kolgomorov");
jButton9.addMouseListener(new java.awt.event.MouseAdapter() {

public void mouseClicked(java.awt.event.MouseEvent evt) {


jButton9MouseClicked(evt);
}
});
jButton10.setText("cuadrados medios");
jButton10.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton10MouseClicked(evt);
}
});
jButton11.setText("chi cuadrada");
jButton11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton11MouseClicked(evt);
}
});
jButton12.setText("Poker");
jButton12.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton12MouseClicked(evt);
}
});
jButton14.setText("Arreglo");
jButton14.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton14MouseClicked(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(46, 46, 46)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton9, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton10, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(jButton11, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 101,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(58, 58, 58)
.addComponent(jButton14)
.addGap(50, 50, 50)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 515, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jButton10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton8)
.addGap(6, 6, 6)
.addComponent(jButton11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton12)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 404,
Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jButton5)
.addComponent(jButton14))
.addGap(22, 22, 22))
);

pack();
}// </editor-fold>
// Algoritmo de productos medios------------------------------------private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
jTextArea1.setText("");
float r;
float l;
String x0 = JOptionPane.showInputDialog("Dame el valor de Xo mayor a 3 digitos");
float X0= Integer.parseInt(x0);
String x1 = JOptionPane.showInputDialog("Dame el valor de x1 mayor a 3 digitos");
float X1 = Integer.parseInt(x1);
String c = JOptionPane.showInputDialog("Dame la cantidad de numeros a generar");
int C = Integer.parseInt(c);
int cont;
for(cont=0; cont < C; cont++)
{
float y0=X0*X1;
String d="";
d=d+y0;
String f ="";
f=f+d.charAt(3)+d.charAt(4)+d.charAt(5)+d.charAt(6);
r=Float.parseFloat(f);

X0=X1;
X1=r;
l=r/10000;
String v="";
v=v+l+"\n";
jTextArea1.append(v);
}
}

// algoritmo lineal-----------------------------------------------------------------------------------private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {


jTextArea1.setText("");
int s; // variable contador en el for
String a = JOptionPane.showInputDialog("Ingresa el valor de A ");
int A = Integer.parseInt(a);
String x0= JOptionPane.showInputDialog("Ingresa el valor de X0");
int X0 = Integer.parseInt(x0);
String c = JOptionPane.showInputDialog("Ingrese el Valor de C");
int C = Integer.parseInt(c);
String Num_Simulaciones = JOptionPane.showInputDialog("Ingrese la cantidad de numeros aleatorios
que desea generar");
int Num = Integer.parseInt(Num_Simulaciones);

String m = JOptionPane.showInputDialog("Ingrese el valor de m");


int M = Integer.parseInt(m);

char d [] =new char [2];


int e;

for (s=0; s<Num;s++)


{

int x=0; // variable que amacena los calculos


Double r=0.0;// variable a imprimir
int b=0; // variable que almacenara el valor en el que se encontro el caracter "."
double k;
String h=""; // variable que contendra el valor calculado en texto o String
String i="";
String l ="";
x = A*X0;
//operacion para obtener a xi
x=x+C;
x=x % M;
X0=x;
k=M-1;
r = x/k;
String v="";
v=v+r+"\n";
jTextArea1.append(v);
}

}
// multiplicador constante------------------------------------------------------------private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {
jTextArea1.setText("");
float r;
float l;
String x0 = JOptionPane.showInputDialog("Dame el valor de Xo mayor a 3 digitos");
float X0= Integer.parseInt(x0);
String x1 = JOptionPane.showInputDialog("Dame el valor de A mayor a 3 digitos");
float A =Integer.parseInt(x1);
String c = JOptionPane.showInputDialog("Dame la cantidad de numeros a generar");
int C = Integer.parseInt(c);
int cont;
for(cont=0; cont < C; cont++)
{
float y0=A*X0;
String d="";

d=d+y0;
String f ="";
int h =d.length();
if(h==9)
{
f=f+d.charAt(1)+d.charAt(2)+d.charAt(3)+d.charAt(4);
}
else
{
f=f+d.charAt(3)+d.charAt(4)+d.charAt(5)+d.charAt(6);

}
r=Float.parseFloat(f);
X0=r;

l=r/10000;
String v="";
v=v+l+"\n";
jTextArea1.append(v);
}

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {


}
// Algortimo congruencial multiplicativo-----------------------------------------------------------------private void jButton6MouseClicked(java.awt.event.MouseEvent evt) {
jTextArea1.setText("");
double r;
float l;

String x0 = JOptionPane.showInputDialog("Dame el valor de X0");


double X0= Integer.parseInt(x0);
String x1 = JOptionPane.showInputDialog("Dame el valor de K");
float K =Integer.parseInt(x1);
String c = JOptionPane.showInputDialog("Dame la cantidad de G");
float G = Integer.parseInt(c);
String n = JOptionPane.showInputDialog("Dame la cantidad de numeros a generar ");
int N = Integer.parseInt(n);

int cont;
double m = Math.pow(2,G);
float b =K*8+3;
for(cont=0; cont < N; cont++)
{
double X1=(b*X0) % m;
X0=X1;
r= X1/(m-1);
float u;
u=(float)r;

String v="";
v=v+u+"\n";
jTextArea1.append(v);
}
}
// algoritmo de cuadrados medios-----------------------------------------------------------------------------private void jButton10MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:

jTextArea1.setText("");
String x0 = JOptionPane.showInputDialog("Dame el valor de X0 > a 3D");
double X0= Double.parseDouble(x0);
String n = JOptionPane.showInputDialog("Dame la cantidad de numeros a generar ");
int N = Integer.parseInt(n);
float x;
for (int cont=0;cont<N;cont++)
{
X0=Math.pow(X0, 2);
String d="";
d=d+X0;
String f ="";
int h =d.length();
if(h==9)
{
f=f+d.charAt(1)+d.charAt(2)+d.charAt(3)+d.charAt(4);
}
else
{
if(h==7)
{
f=f+d.charAt(0)+d.charAt(1)+d.charAt(2)+d.charAt(3);
}

else
{
if(h==8)
{
f=f+d.charAt(1)+d.charAt(2)+d.charAt(3)+d.charAt(4);

}
else
{
f=f+d.charAt(3)+d.charAt(4)+d.charAt(5)+d.charAt(6);
}
}
}
x=Float.parseFloat(f);
X0=x;
float l=x/10000;
String v="";
v=v+l+"\n";
jTextArea1.append(v);

}// fin del else


}
private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
private void jButton9MouseClicked(java.awt.event.MouseEvent evt) {
//-------------------------------------------------kolmogorov
String x = JOptionPane.showInputDialog("Dame la cantidad de flotantes que vas a introducir");
int cant= Integer.parseInt(x);
float [] g = new float [cant];
for (int cont=0; cont<cant;cont++)
{
String y = JOptionPane.showInputDialog ("inrtoduce los flotantes ");
float o = Float.parseFloat(y);
g = new float [cant];
g [cont]= o;

}
Generador_Ale z = new Generador_Ale();
z.ks( g );

}
private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
//---------------------------------------------------// prueba de medias
prueba_DE_medias p = new prueba_DE_medias(ecko);
p.Media();
p.Limites();
String v="";
v=v+p.conclusion()+"\n";
jTextArea1.append(v);
}
private void jButton8MouseClicked(java.awt.event.MouseEvent evt) {
// prueba de varianza---------------------------------------------------------------------------------------------------------------------------------prueba_DE_varianza p= new prueba_DE_varianza( ecko );
p.media();
p.Varianza();
p.limites();
String v="";
v=v+p.conclusion()+"\n";
jTextArea1.append(v);
}
private void jButton11MouseClicked(java.awt.event.MouseEvent evt) {
// chi cuadrad--------------------------------------------------------------------prueba_DE_chicuadrada p= new prueba_DE_chicuadrada(ecko);
p.Oi();
p.estadisticaPrueba();
String v="";
v=v+p.conclusion()+"\n";
jTextArea1.append(v);
}
private void jButton12MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:

//prueba de poker ------------------------------------------------------------------------------------------------------------------------------------------------------------------------int digitos,gradoL,nElementos;


double nivelA;
nElementos=Integer.parseInt(JOptionPane.showInputDialog("INGRESE EL NUMERO DE ELEMENTOS DEL
CONJUNTO"));
digitos=Integer.parseInt(JOptionPane.showInputDialog("INGRESE EL NUMERO DE DIGITOS DE CADA
NUMERO"));
gradoL=Integer.parseInt(JOptionPane.showInputDialog("INGRESE EL GRADO DE LIBERTAD"));
nivelA=Double.parseDouble(JOptionPane.showInputDialog("INGRESE EL NIVEL DE ACEPTACION"));
PruebaPoker pp=new PruebaPoker("PRUEBA DE POKER",nElementos);
pp.setNumeroDigitos(digitos);
pp.setNivelAceptacion(nivelA);
pp.setGradosLibertad(gradoL);

}
private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
jTextArea1.setText("");
}
private void jButton14MouseClicked(java.awt.event.MouseEvent evt) {
String eck = jTextArea1.getText();
StringTokenizer st = new StringTokenizer (eck , "\n");
int cont =0;
int tam = st.countTokens();
// JOptionPane.showMessageDialog(null,tam);
ecko = new double [tam];
cv=tam;
while(st.hasMoreTokens())
{
String x = st.nextToken();
double valor = Double.parseDouble(x);
ecko [cont] = valor;
cont++;
//JOptionPane.showMessageDialog(null,valor);
}
}
// metodo de kolmogorov
public double ks (float []a){

quiksort (a,0,a.length-1);
float fn;
float d;
float dm;
dm=((float)(1/a.length)-a[0]);
if(dm<0)
dm=dm*(-1);
for(int i=0;i<a.length;i++){
fn=(float)(i+1)/a.length;

d=(float)fn-a[i];
if(d<0)
d=d*(-1);
if(d>dm) dm=d;
String v="";
v=v+dm+"\n";
jTextArea1.append(v);
}
return dm;

}
public void quiksort(float x[],int lo,int ho){
int l=lo, h=ho;
float mid,t;
if(ho>lo)
{
mid=x[(lo+ho)/2];
while(l<h)
{
while((l<ho)&&(x[l]<mid)) ++l;
while((h>lo)&&(x[h]>mid)) --h;
if(l<=h)
{
t = x[l];
x[l] = x[h];
x[h] = t;
++l;
--h;
}
}
if(lo<h) quiksort(x,lo,h);
if(l<ho) quiksort(x,l,ho);
}
}
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Generador_Ale.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Generador_Ale.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Generador_Ale.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Generador_Ale.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
Generador_Ale z = new Generador_Ale();
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Generador_Ale().setVisible(true);
}
});
}

// prueba de medias --------------------------------------------------------------------------------------------------------------------------------public class prueba_DE_medias {


public int n=40;//tamao del conjunto de numeros aleatorios
public double r[]=new double[cv];//conjunto de numeros
double alfa=0.05;//nivel de aceptacion
double med=0;// media
double LI;//limite inferiror
double LS;//limite superior
public double z[][]={//tabla de distribucion normal
{
0.5
,
0.50399 ,
0.50798 ,
0.51197 ,
0.51595 ,
0.51994 ,
0.52392 ,
0.5279 ,
0.53188 ,
0.53586 },
{0.53983
,
0.5438 ,
0.54776 ,
0.55172 ,
0.55567 ,
0.55962 ,
0.56356 ,
0.56749 ,
0.57142 ,
0.57535 },
{0.57926
,
0.58317 ,
0.58706 ,
0.59095 ,
0.59483 ,
0.59871 ,
0.60257 ,
0.60642 ,
0.61026 ,
0.61409 },
{0.61791
,
0.62172 ,
0.62552 ,
0.6293 ,
0.63307 ,
0.63683 ,
0.64058 ,
0.64431 ,
0.64803 ,
0.65173 },
{0.65542
,
0.6591 ,
0.66276 ,
0.6664 ,
0.67003 ,
0.67364 ,
0.67724 ,
0.68082 ,
0.68439 ,
0.68793 },
{0.69146
,
0.69497 ,
0.69847 ,
0.70194 ,
0.7054 ,
0.70884 ,
0.71226 ,
0.71566 ,
0.71904 ,
0.7224 },

{0.72575
0.74215 ,
{0.75804
0.77337 ,
{0.78814
0.80234 ,
{0.81594
0.82894 ,
{0.81594
0.82894 ,
{0.86433
0.87493 ,
{0.88493
0.89435 ,
{0.9032
0.91149 ,
{0.91924
0.92647 ,
{0.93319
0.93943 ,
{0.9452
0.95053 ,
{0.95543
0.95994 ,
{0.96407
0.96784 ,
{0.97128
0.97441 ,
{0.97725
0.97982 ,
{0.98214
0.98422 ,
{0.9861
0.98778 ,
{0.98928
0.99061 ,
{0.9918
0.99286 ,
{0.99379
0.99461 ,
{0.99534
0.99598 ,
{0.99653
0.99702 ,
{0.99744
0.99781 ,
{0.99813
0.99841 ,
{0.99865
0.99886 ,
{0.99903
0.99918 ,
{0.99931
0.99942 ,
{0.99952
0.9996 ,

,
0.72907 ,
0.73237 ,
0.73565 ,
0.73891 ,
0.74537 ,
0.74857 ,
0.75175 ,
0.7549 },
,
0.76115 ,
0.76424 ,
0.7673 ,
0.77035 ,
0.77637 ,
0.77935 ,
0.7823 ,
0.78524 },
,
0.79103 ,
0.79389 ,
0.79673 ,
0.79955 ,
0.80511 ,
0.80785 ,
0.81057 ,
0.81327 },
,
0.81859 ,
0.82121 ,
0.82381 ,
0.82639 ,
0.83147 ,
0.83398 ,
0.83646 ,
0.83891 },
,
0.81859 ,
0.82121 ,
0.82381 ,
0.82639 ,
0.83147 ,
0.83398 ,
0.83646 ,
0.83891 },
,
0.8665 ,
0.86864 ,
0.87076 ,
0.87286 ,
0.87698 ,
0.879 ,
0.881 ,
0.88298 },
,
0.88686 ,
0.88877 ,
0.89065 ,
0.89251 ,
0.89617 ,
0.89796 ,
0.89973 ,
0.90147 },
,
0.9049 ,
0.90658 ,
0.90824 ,
0.90988 ,
0.91308 ,
0.91466 ,
0.91621 ,
0.91774 },
,
0.92073 ,
0.9222 ,
0.92364 ,
0.92507 ,
0.92785 ,
0.92922 ,
0.93056 ,
0.93189 },
,
0.93448 ,
0.93574 ,
0.93699 ,
0.93822 ,
0.94062 ,
0.94179 ,
0.94295 ,
0.94408 },
,
0.9463 ,
0.94738 ,
0.94845 ,
0.9495 ,
0.95154 ,
0.95254 ,
0.95352 ,
0.95449 },
,
0.95637 ,
0.95728 ,
0.95818 ,
0.95907 ,
0.9608 ,
0.96164 ,
0.96246 ,
0.96327 },
,
0.96485 ,
0.96562 ,
0.96638 ,
0.96712 ,
0.96856 ,
0.96926 ,
0.96995 ,
0.97062 },
,
0.97193 ,
0.97257 ,
0.9732 ,
0.97381 ,
0.975 ,
0.97558 ,
0.97615 ,
0.9767 },
,
0.97778 ,
0.97831 ,
0.97882 ,
0.97932 ,
0.9803 ,
0.98077 ,
0.98124 ,
0.98169 },
,
0.98257 ,
0.983 ,
0.98341 ,
0.98382 ,
0.98461 ,
0.985 ,
0.98537 ,
0.98574 },
,
0.98645 ,
0.98679 ,
0.98713 ,
0.98745 ,
0.98809 ,
0.9884 ,
0.9887 ,
0.98899 },
,
0.98956 ,
0.98983 ,
0.9901 ,
0.99036 ,
0.99086 ,
0.99111 ,
0.99134 ,
0.99158 },
,
0.99202 ,
0.99224 ,
0.99245 ,
0.99266 ,
0.99305 ,
0.99324 ,
0.99343 ,
0.99361 },
,
0.99396 ,
0.99413 ,
0.9943 ,
0.99446 ,
0.99477 ,
0.99492 ,
0.99506 ,
0.9952 },
,
0.99547 ,
0.9956 ,
0.99573 ,
0.99585 ,
0.99609 ,
0.99621 ,
0.99632 ,
0.99643 },
,
0.99664 ,
0.99674 ,
0.99683 ,
0.99693 ,
0.99711 ,
0.9972 ,
0.99728 ,
0.99736 },
,
0.99752 ,
0.9976 ,
0.99767 ,
0.99774 ,
0.99788 ,
0.99795 ,
0.99801 ,
0.99807 },
,
0.99819 ,
0.99825 ,
0.99831 ,
0.99836 ,
0.99846 ,
0.99851 ,
0.99856 ,
0.99861 },
,
0.99869 ,
0.99874 ,
0.99878 ,
0.99882 ,
0.99889 ,
0.99893 ,
0.99896 ,
0.999 },
,
0.99906 ,
0.9991 ,
0.99913 ,
0.99916 ,
0.99921 ,
0.99924 ,
0.99926 ,
0.99929 },
,
0.99934 ,
0.99936 ,
0.99938 ,
0.9994 ,
0.99944 ,
0.99946 ,
0.99948 ,
0.9995 },
,
0.99953 ,
0.99955 ,
0.99957 ,
0.99958 ,
0.99961 ,
0.99962 ,
0.99964 ,
0.99965 },

{0.99966
,
0.99968 ,
0.99969 ,
0.9997 ,
0.99971 ,
0.99972 ,
0.99973 ,
0.99974 ,
0.99975 ,
0.99976 },
{0.99977
,
0.99978 ,
0.99978 ,
0.99979 ,
0.9998 ,
0.99981 ,
0.99981 ,
0.99982 ,
0.99983 ,
0.99983 },
{0.99984
,
0.99985 ,
0.99985 ,
0.99986 ,
0.99986 ,
0.99987 ,
0.99987 ,
0.99988 ,
0.99988 ,
0.99989 },
{0.99989
,
0.9999 ,
0.9999 ,
0.9999 ,
0.99991 ,
0.99991 ,
0.99992 ,
0.99992 ,
0.99992 ,
0.99992 },
{0.99993
,
0.99993 ,
0.99993 ,
0.99994 ,
0.99994 ,
0.99994 ,
0.99994 ,
0.99995 ,
0.99995 ,
0.99995 },
{0.99995
,
0.99995 ,
0.99996 ,
0.99996 ,
0.99996 ,
0.99996 ,
0.99996 ,
0.99996 ,
0.99997 ,
0.99997 },
{0.99997
,
0.99997 ,
0.99997 ,
0.99997 ,
0.99997 ,
0.99997 ,
0.99998 ,
0.99998 ,
0.99998 ,
0.99998 }};
public prueba_DE_medias( double raux []) {
r=raux;
}
public void Media(){//calculo de la media
double media=0;
for (int i=0;i<cv;i++){
media=media+r[i];
}
med= media/cv;
}
public void Limites(){
double Zvalor=0 ;// valor de Z en la distribucion normal
int decima=0;
int centecima=0;
double condicion=1-alfa/2;//condicion de busqueda de Z en la tabla
for (int i =0;i<41;i++)
{
for (int j=0;j<10;j++)
{
if (z[i][j]<=condicion){decima =i;centecima=j;}
}
}
Zvalor =((decima*0.1)+(centecima*0.01));
LI=0.5-Zvalor*(1/Math.sqrt(cv*12));
LS=0.5+Zvalor*(1/Math.sqrt(cv*12));
}
String conclusion (){
String salida="";
if (med<LS|| med>LI){
salida="Media: "+med+"\nLimite Inferiror : "+LI+"\nLimite Superior: "+LS+
"\n Por lo tanto el conjunto Ri tiene un valor esperado de 0.5 con un
nivel de aceptacion de 1- a ";
}
else {
salida="Media: "+med+"\nLimite Inferiror : "+LI+"\nLimite Superior: "+LS+
"\nPor lo tanto el conjunto Ri NO tiene un valor esperado de 0.5 con un
nivel de aceptacion de 1- a ";
}
return salida;
}

// prueba de varianza -------------------------------------------------------------------------------------------------public class prueba_DE_varianza {


public int n=40;//tamao del conjunto de numeros aleatorios
public double r[]=new double[cv];//conjunto de numeros
double alfa=0.050000000000000;//nivel de aceptacion
double media=0.000000000000000;
double varianza=0.000000000000000;// media
double LI;//limite inferiror
double LS;//limite superior
double Xcuadrada[][]={
{0.001, 0.0025, 0.005, 0.01,
0.025,
0.05,
0.1,
0.15,
0.2,
0.25,
0.3,
0.35,
0.4,
0.45,
0.5},
{10.8274,
9.1404, 7.8794, 6.6349,
5.0239,
3.8415,
2.7055,
2.0722,
1.6424,
1.3233,
1.0742,
0.8735,
0.7083,
0.5707,
0.4549},
{13.8150,
11.9827,
10.5965,
9.2104,
7.3778,
5.9915,
4.6052,
3.7942,
3.2189,
2.7726,
2.4079,
2.0996,
1.8326,
1.5970,
1.3863},
{16.2660,
14.3202,
12.8381,
11.3449,
9.3484,
7.8147,
6.2514,
5.3170,
4.6416,
4.1083,
3.6649,
3.2831,
2.9462,
2.6430,
2.3660},
{18.4662,
16.4238,
14.8602,
13.2767,
11.1433,
9.4877,
7.7794,
6.7449,
5.9886,
5.3853,
4.8784,
4.4377,
4.0446,
3.6871,
3.3567},
{20.5147,
18.3854,
16.7496,
15.0863,
12.8325,
11.0705,
9.2363,
8.1152,
7.2893,
6.6257,
6.0644,
5.5731,
5.1319,
4.7278,
4.3515},
{22.4575,
20.2491,
18.5475,
16.8119,
14.4494,
12.5916,
10.6446,
9.4461,
8.5581,
7.8408,
7.2311,
6.6948,
6.2108,
5.7652,
5.3481},
{24.3213,
22.0402,
20.2777,
18.4753,
16.0128,
14.0671,
12.0170,
10.7479,
9.8032,
9.0371,
8.3834,
7.8061,
7.2832,
6.8000,
6.3458},
{26.1239,
23.7742,
21.9549,
20.0902,
17.5345,
15.5073,
13.3616,
12.0271,
11.0301,
10.2189,
9.5245,
8.9094,
8.3505,
7.8325,
7.3441},
{27.8767,
25.4625,
23.5893,
21.6660,
19.0228,
16.9190,
14.6837,
13.2880,
12.2421,
11.3887,
10.6564,
10.006,
9.4136,
8.8632,
8.3428},
{29.5879,
27.1119,
25.1881,
23.2093,
20.4832,
18.3070,
15.9872,
14.5339,
13.4420,
12.5489,
11.7807,
11.0971,
10.4732,
9.8922,
9.3418},
{31.2635,
28.7291,
26.7569,
24.7250,
21.9200,
19.6752,
17.2750,
15.7671,
14.6314,
13.7007,
12.8987,
12.1836,
11.5298,
10.9199,
10.341},
{32.9092,
30.3182,
28.2997,
26.2170,
23.3367,
21.0261,
18.5493,
16.9893,
15.8120,
14.8454,
14.0111,
13.2661,
12.5838,
11.9463,
11.3403},

{34.5274,
19.8119,
13.6356,
{36.1239,
21.0641,
14.6853,
{37.6978,
22.3071,
15.7332,
{39.2518,
23.5418,
16.7795,
{40.7911,
24.7690,
17.8244,
{42.3119,
25.9894,
18.8679,
{43.8194,
27.2036,
19.9102,
{45.3142,
28.4120,
20.9514,
{46.7963,
29.6151,
21.9915,
{48.2676,
30.8133,
23.0307,
{49.7276,
32.0069,
24.0689,
{51.1790,
33.1962,
25.1064,
{52.6187,
34.3816,
26.1430,
{54.0511,
35.5632,
27.1789,
{55.4751,
36.7412,
28.2141,
{56.8918,
37.9159,
29.2486,
{58.3006,
39.0875,
30.2825,
{59.7022,
40.2560,
31.3159,

31.8830,
18.2020,
12.9717,
33.4262,
19.4062,
13.9961,
34.9494,
20.6030,
15.0197,
36.4555,
21.7931,
16.0425,
37.9462,
22.9770,
17.0646,
39.4220,
24.1555,
18.0860,
40.8847,
25.3289,
19.1069,
42.3358,
26.4976,
20.1272,
43.7749,
27.6620,
21.1470,
45.2041,
28.8224,
22.1663,
46.6231,
29.9792,
23.1852,
48.0336,
31.1325,
24.2037,
49.4351,
32.2825,
25.2218,
50.8291,
33.4295,
26.2395,
52.2152,
34.5736,
27.2569,
53.5939,
35.7150,
28.2740,
54.9662,
36.8538,
29.2908,
56.3325,
37.9902,
30.3073,

29.8193,
16.9848,
12.3398},
31.3194,
18.1508,
13.3393},
32.8015,
19.3107,
14.3389},
34.2671,
20.4651,
15.3385},
35.7184,
21.6146,
16.3382},
37.1564,
22.7595,
17.3379},
38.5821,
23.9004,
18.3376},
39.9969,
25.0375,
19.3374},
41.4009,
26.1711,
20.3372},
42.7957,
27.3015,
21.3370},
44.1814,
28.4288,
22.3369},
45.5584,
29.5533,
23.3367},
46.9280,
30.6752,
24.3366},
48.2898,
31.7946,
25.3365},
49.6450,
32.9117,
26.3363},
50.9936,
34.0266,
27.3362},
52.3355,
35.1394,
28.3361},
53.6719,
36.2502,
29.3360},

27.6882,
15.9839,

24.7356,
15.1187,

22.3620,
14.3451,

29.1412,
17.1169,

26.1189,
16.2221,

23.6848,
15.4209,

30.5780,
18.2451,

27.4884,
17.3217,

24.9958,
16.4940,

31.9999,
19.3689,

28.8453,
18.4179,

26.2962,
17.5646,

33.4087,
20.4887,

30.1910,
19.5110,

27.5871,
18.6330,

34.8052,
21.6049,

31.5264,
20.6014,

28.8693,
19.6993,

36.1908,
22.7178,

32.8523,
21.6891,

30.1435,
20.7638,

37.5663,
23.8277,

34.1696,
22.7745,

31.4104,
21.8265,

38.9322,
24.9348,

35.4789,
23.8578,

32.6706,
22.8876,

40.2894,
26.0393,

36.7807,
24.9390,

33.9245,
23.9473,

41.6383,
27.1413,

38.0756,
26.0184,

35.1725,
25.0055,

42.9798,
28.2412,

39.3641,
27.0960,

36.4150,
26.0625,

44.3140,
29.3388,

40.6465,
28.1719,

37.6525,
27.1183,

45.6416,
30.4346,

41.9231,
29.2463,

38.8851,
28.1730,

46.9628,
31.5284,

43.1945,
30.3193,

40.1133,
29.2266,

48.2782,
32.6205,

44.4608,
31.3909,

41.3372,
30.2791,

49.5878,
33.7109,

45.7223,
32.4612,

42.5569,
31.3308,

50.8922,
34.7997,

46.9792,
33.5302,

43.7730,
32.3815,

{61.0980,
57.6921,
41.4217,
39.1244,
32.3486,
31.3235,
{62.4873,
59.0461,
42.5847,
40.2563,
33.3809,
32.3394,
{63.8694,
60.3953,
43.7452,
41.3861,
34.4126,
33.3551,
{65.2471,
61.7382,
44.9032,
42.5140,
35.4438,
34.3706,
{66.6192,
63.0760,
46.0588,
43.6399,
36.4746,
35.3858,
{67.9850,
64.4097,
47.2122,
44.7641,
37.5049,
36.4008,
{69.3476,
65.7384,
48.3634,
45.8864,
38.5348,
37.4156,
{70.7039,
67.0628,
49.5126,
47.0072,
39.5643,
38.4302,
{72.0550,
68.3830,
50.6598,
48.1263,
40.5935,
39.4446,
{73.4029,
69.6987,
51.8050,
49.2438,
41.6222,
40.4589,
};
double Xcuadrada2[][]={
{0.55,
0.6,
0.65, 0.7,

55.0025,
37.3591,
30.3359},
56.3280,
38.4663,
31.3359},
57.6483,
39.5718,
32.3358},
58.9637,
40.6756,
33.3357},
60.2746,
41.7780,
34.3356},
61.5811,
42.8788,
35.3356},
62.8832,
43.9782,
36.3355},
64.1812,
45.0763,
37.3354},
65.4753,
46.1730,
38.3354},
66.7660,
47.2685,
39.3353}

0.75, 0.8,

52.1914,
35.8871,

48.2319,
34.5981,

44.9853,
33.4314,

53.4857,
36.9730,

49.4804,
35.6649,

46.1942,
34.4804,

54.7754,
38.0575,

50.7251,
36.7307,

47.3999,
35.5287,

56.0609,
39.1408,

51.9660,
37.7954,

48.6024,
36.5763,

57.3420,
40.2228,

53.2033,
38.8591,

49.8018,
37.6231,

58.6192,
41.3036,

54.4373,
39.9220,

50.9985,
38.6693,

59.8926,
42.3833,

55.6680,
40.9839,

52.1923,
39.7148,

61.1620,
43.4619,

56.8955,
42.0450,

53.3835,
40.7597,

62.4281,
44.5395,

58.1201,
43.1053,

54.5722,
41.8040,

63.6908,
45.6160,

59.3417,
44.1649,

55.7585,
42.8477,

0.85, 0.9,

0.95, 0.975, 0.99, 0.995, 0.9975,

0.999},
{0.3573, 0.2750,
0.0000, 0.0000, 0.0000},
{1.1957, 1.0217,
0.0100, 0.0050, 0.0020},
{2.1095, 1.8692,
0.0717, 0.0449, 0.0243},
{3.0469, 2.7528,
0.2070, 0.1449, 0.0908},
{3.9959, 3.6555,
0.4118, 0.3075, 0.2102},
{4.9519, 4.5702,
0.6757, 0.5266, 0.3810},
{5.9125, 5.4932,
0.9893, 0.7945, 0.5985},
{6.8766, 6.4226,
1.3444, 1.1042, 0.8571},
{7.8434, 7.3570,
1.7349, 1.4501, 1.1519},
{8.8124, 8.2955,
2.1558, 1.8274, 1.4787},
{9.7831, 9.2373,
2.6032, 2.2321, 1.8338},

0.2059, 0.1485, 0.1015, 0.0642, 0.0358, 0.0158, 0.0039, 0.0010, 0.0002,


0.8616, 0.7133, 0.5754, 0.4463, 0.3250, 0.2107, 0.1026, 0.0506, 0.0201,
1.6416, 1.4237, 1.2125, 1.0052, 0.7978, 0.5844, 0.3518, 0.2158, 0.1148,
2.4701, 2.1947, 1.9226, 1.6488, 1.3665, 1.0636, 0.7107, 0.4844, 0.2971,
3.3251, 2.9999, 2.6746, 2.3425, 1.9938, 1.6103, 1.1455, 0.8312, 0.5543,
4.1973, 3.8276, 3.4546, 3.0701, 2.6613, 2.2041, 1.6354, 1.2373, 0.8721,
5.0816, 4.6713, 4.2549, 3.8223, 3.3583, 2.8331, 2.1673, 1.6899, 1.2390,
5.9753, 5.5274, 5.0706, 4.5936, 4.0782, 3.4895, 2.7326, 2.1797, 1.6465,
6.8763, 6.3933, 5.8988, 5.3801, 4.8165, 4.1682, 3.3251, 2.7004, 2.0879,
7.7832, 7.2672, 6.7372, 6.1791, 5.5701, 4.8652, 3.9403, 3.2470, 2.5582,
8.6952, 8.1479, 7.5841, 6.9887, 6.3364, 5.5778, 4.5748, 3.8157, 3.0535,

{10.7553, 10.1820, 9.6115, 9.0343, 8.4384, 7.8073, 7.1138, 6.3038, 5.2260, 4.4038, 3.5706,
3.0738, 2.6612, 2.2141},
{11.7288, 11.1291, 10.5315, 9.9257, 9.2910, 8.6339, 7.9008, 7.0415, 5.8919, 5.0087, 4.1069,
3.5650, 3.1118, 2.6172},
{12.7034, 12.0785, 11.4548, 10.8215, 10.1653, 9.4673, 8.6963, 7.7895, 6.5706, 5.6287, 4.6604,
4.0747, 3.5820, 3.0407},
{13.6790, 13.0298, 12.3809, 11.7212, 11.0365, 10.3070, 9.4993, 8.5468, 7.2609, 6.2621, 5.2294,
4.6009, 4.0697, 3.4825},
{14.6555, 13.9827, 13.3096, 12.6243, 11.9122, 11.1521, 10.3090, 9.3122, 7.9616, 6.9077, 5.8122,
5.1422, 4.5734, 3.9417},
{15.6328, 14.9373, 14.2406, 13.5307, 12.7919, 12.0023, 11.1249, 10.0852, 8.6718, 7.5642, 6.4077,
5.6973, 5.0916, 4.4162},
{16.6108, 15.8932, 15.1738, 14.4399, 13.6753, 12.8570, 11.9462, 10.8649, 9.3904, 8.2307, 7.0149,
6.2648, 5.6234, 4.9048},
{17.5894, 16.8504, 16.1089, 15.3517, 14.5620, 13.7158, 12.7727, 11.6509, 10.1170, 8.9065,
7.6327, 6.8439, 6.1673, 5.4067},
{18.5687, 17.8088, 17.0458, 16.2659, 15.4518, 14.5784, 13.6039, 12.4426, 10.8508, 9.5908,
8.2604, 7.4338, 6.7228, 5.9210},
{19.5485, 18.7683, 17.9843, 17.1823, 16.3444, 15.4446, 14.4393, 13.2396, 11.5913, 10.2829,
8.8972, 8.0336, 7.2889, 6.4467},
{20.5288, 19.7288, 18.9243, 18.1007, 17.2396, 16.3140, 15.2787, 14.0415, 12.3380, 10.9823,
9.5425, 8.6427, 7.8648, 6.9829},
{21.5095, 20.6902, 19.8657, 19.0211, 18.1373, 17.1865, 16.1219, 14.8480, 13.0905, 11.6885,
10.1957, 9.2604, 8.4503, 7.5291},
{22.4908, 21.6525, 20.8084, 19.9432, 19.0373, 18.0618, 16.9686, 15.6587, 13.8484, 12.4011,
10.8563, 9.8862, 9.0441, 8.0847},
{23.4724, 22.6156, 21.7524, 20.8670, 19.9393, 18.9397, 17.8184, 16.4734, 14.6114, 13.1197,
11.5240, 10.5196, 9.6462, 8.6494},
{24.4544, 23.5794, 22.6975, 21.7924, 20.8434, 19.8202, 18.6714, 17.2919, 15.3792, 13.8439,
12.1982, 11.1602, 10.2561, 9.2222},
{25.4367, 24.5440, 23.6437, 22.7192, 21.7494, 20.7030, 19.5272, 18.1139, 16.1514, 14.5734,
12.8785, 11.8077, 10.8733, 9.8029},
{26.4195, 25.5092, 24.5909, 23.6475, 22.6572, 21.5880, 20.3857, 18.9392, 16.9279, 15.3079,
13.5647, 12.4613, 11.4973, 10.3907},
{27.4025, 26.4751, 25.5391, 24.5770, 23.5666, 22.4751, 21.2468, 19.7677, 17.7084, 16.0471,
14.2564, 13.1211, 12.1278, 10.9861},
{28.3858, 27.4416, 26.4881, 25.5078, 24.4776, 23.3641, 22.1103, 20.5992, 18.4927, 16.7908,
14.9535, 13.7867, 12.7646, 11.5876},
{29.3694, 28.4087, 27.4381, 26.4397, 25.3901, 24.2551, 22.9762, 21.4336, 19.2806, 17.5387,
15.6555, 14.4577, 13.4073, 12.1961},
{30.3533, 29.3763, 28.3889, 27.3728, 26.3041, 25.1478, 23.8442, 22.2706, 20.0719, 18.2908,
16.3622, 15.1340, 14.0555, 12.8104},
{31.3375, 30.3444, 29.3405, 28.3069, 27.2194, 26.0422, 24.7143, 23.1102, 20.8665, 19.0467,
17.0735, 15.8152, 14.7092, 13.4312},
{32.3219, 31.3130, 30.2928, 29.2421, 28.1361, 26.9383, 25.5864, 23.9522, 21.6643, 19.8062,
17.7891, 16.5013, 15.3679, 14.0568},
{33.3065, 32.2821, 31.2458, 30.1782, 29.0540, 27.8359, 26.4604, 24.7966, 22.4650, 20.5694,
18.5089, 17.1917, 16.0315, 14.6881},
{34.2913, 33.2517, 32.1995, 31.1152, 29.9730, 28.7350, 27.3363, 25.6433, 23.2686, 21.3359,
19.2326, 17.8868, 16.7000, 15.3243},
{35.2764, 34.2216, 33.1539, 32.0532, 30.8933, 29.6355, 28.2138, 26.4921, 24.0749, 22.1056,
19.9603, 18.5859, 17.3730, 15.9652},
{36.2617, 35.1920, 34.1089, 32.9919, 31.8146, 30.5373, 29.0931, 27.3430, 24.8839, 22.8785,
20.6914, 19.2888, 18.0501, 16.6109},
{37.2472, 36.1628, 35.0645, 33.9315, 32.7369, 31.4405, 29.9739, 28.1958, 25.6954, 23.6543,
21.4261, 19.9958, 18.7318, 17.2612},

{38.2328, 37.1340, 36.0207, 34.8719, 33.6603, 32.3449, 30.8563, 29.0505, 26.5093, 24.4331,
22.1642, 20.7066, 19.4171, 17.9166}
};

//-------------------------------------------------------------------------------------------------------------------------------------------public prueba_DE_varianza(double raux []) {


r=raux;
}
public void media (){
for (int i=0;i<cv;i++){
media=media+r[i];
}
media= media/cv;
}
public void Varianza(){
for (int i=0;i<cv;i++){
varianza+=Math.pow (( r[i]-media),2);
}
varianza=varianza/(cv-1);
}
public void limites(){
double valorXmax=0;
double valorXmin=0;
for(int i =0;i<15;i++){
if (Xcuadrada[0][i]<=(alfa/2)){
LS=valorXmax/(12*(cv-1));

valorXmax=Xcuadrada[cv-1][i];}}

for(int i =0;i<14;i++){if (Xcuadrada2[0][i]<=(1-alfa/2)){valorXmin=Xcuadrada2[cv-1][i];} }


LI=valorXmin/(12*(cv-1));

}
String conclusion(){
String mensaje ="";
if (varianza >LI ||varianza<LS){
mensaje ="Varianza: "+varianza+"\nLimite Inferiror : "+LI+"\nLimite Superior: "+LS+
"\nPor lo tanto el conjunto Ri tiene una varianza de 1/12 con un nivel
de aceptacion de 1- a ";
}
else{
mensaje ="Varianza: "+varianza+"\nLimite Inferiror : "+LI+"\nLimite Superior: "+LS+
"\nPor lo tanto el conjunto Ri NO tiene una varianza de 1/12 con un
nivel de aceptacion de 1- a ";
}
return mensaje;
}
}

//--------------------------------------------------chi cuadrada --------------------------------------------------------------------------public class prueba_DE_chicuadrada {

public int n=40;//tamao del conjunto de numeros aleatorios


public int m=10;//numero de intervalos
public double r[]=new double[cv];//conjunto de numeros
double alfa=0.050000000000000;//nivel de aceptacion
double media=0.000000000000000;
double varianza=0.000000000000000;// media
double LI;//limite inferiror
double LS;//limite superior
int intervalo[]=new int [m];//intervalos de 0.1
double Ei=cv/m;//frecuencia esperada
double estadistica=0;//valor que determina si se sigue una distribucion uniforme
double Xcuadrada[][]={
{0.001, 0.0025, 0.005, 0.01,
0.025,
0.05,
0.1,
0.15,
0.2,
0.25,
0.3,
0.35,
0.45,
0.5},
{10.8274,
9.1404, 7.8794, 6.6349,
5.0239,
3.8415,
2.7055,
2.0722,
1.6424,
1.3233,
1.0742,
0.7083,
0.5707,
0.4549},
{13.8150,
11.9827,
10.5965,
9.2104,
7.3778,
4.6052,
3.7942,
3.2189,
2.7726,
2.4079,
1.8326,
1.5970,
1.3863},
{16.2660,
14.3202,
12.8381,
11.3449,
9.3484,
6.2514,
5.3170,
4.6416,
4.1083,
3.6649,
2.9462,
2.6430,
2.3660},
{18.4662,
16.4238,
14.8602,
13.2767,
11.1433,
7.7794,
6.7449,
5.9886,
5.3853,
4.8784,
4.0446,
3.6871,
3.3567},
{20.5147,
18.3854,
16.7496,
15.0863,
12.8325,
9.2363,
8.1152,
7.2893,
6.6257,
6.0644,
5.1319,
4.7278,
4.3515},
{22.4575,
20.2491,
18.5475,
16.8119,
14.4494,
10.6446,
9.4461,
8.5581,
7.8408,
7.2311,
6.2108,
5.7652,
5.3481},
{24.3213,
22.0402,
20.2777,
18.4753,
16.0128,
12.0170,
10.7479,
9.8032,
9.0371,
8.3834,
7.2832,
6.8000,
6.3458},
{26.1239,
23.7742,
21.9549,
20.0902,
17.5345,
13.3616,
12.0271,
11.0301,
10.2189,
9.5245,
8.3505,
7.8325,
7.3441},
{27.8767,
25.4625,
23.5893,
21.6660,
19.0228,
14.6837,
13.2880,
12.2421,
11.3887,
10.6564,
9.4136,
8.8632,
8.3428},
{29.5879,
27.1119,
25.1881,
23.2093,
20.4832,
15.9872,
14.5339,
13.4420,
12.5489,
11.7807,
10.4732,
9.8922,
9.3418},
{31.2635,
28.7291,
26.7569,
24.7250,
21.9200,
17.2750,
15.7671,
14.6314,
13.7007,
12.8987,
11.5298,
10.9199,
10.341},
{32.9092,
30.3182,
28.2997,
26.2170,
23.3367,
18.5493,
16.9893,
15.8120,
14.8454,
14.0111,
12.5838,
11.9463,
11.3403},
{34.5274,
31.8830,
29.8193,
27.6882,
24.7356,
19.8119,
18.2020,
16.9848,
15.9839,
15.1187,
13.6356,
12.9717,
12.3398},

0.4,

0.8735,
5.9915,
2.0996,
7.8147,
3.2831,
9.4877,
4.4377,
11.0705,
5.5731,
12.5916,
6.6948,
14.0671,
7.8061,
15.5073,
8.9094,
16.9190,
10.006,
18.3070,
11.0971,
19.6752,
12.1836,
21.0261,
13.2661,
22.3620,
14.3451,

{36.1239,
21.0641,
14.6853,
{37.6978,
22.3071,
15.7332,
{39.2518,
23.5418,
16.7795,
{40.7911,
24.7690,
17.8244,
{42.3119,
25.9894,
18.8679,
{43.8194,
27.2036,
19.9102,
{45.3142,
28.4120,
20.9514,
{46.7963,
29.6151,
21.9915,
{48.2676,
30.8133,
23.0307,
{49.7276,
32.0069,
24.0689,
{51.1790,
33.1962,
25.1064,
{52.6187,
34.3816,
26.1430,
{54.0511,
35.5632,
27.1789,
{55.4751,
36.7412,
28.2141,
{56.8918,
37.9159,
29.2486,
{58.3006,
39.0875,
30.2825,
{59.7022,
40.2560,
31.3159,
{61.0980,
41.4217,
32.3486,

33.4262,
19.4062,
13.9961,
34.9494,
20.6030,
15.0197,
36.4555,
21.7931,
16.0425,
37.9462,
22.9770,
17.0646,
39.4220,
24.1555,
18.0860,
40.8847,
25.3289,
19.1069,
42.3358,
26.4976,
20.1272,
43.7749,
27.6620,
21.1470,
45.2041,
28.8224,
22.1663,
46.6231,
29.9792,
23.1852,
48.0336,
31.1325,
24.2037,
49.4351,
32.2825,
25.2218,
50.8291,
33.4295,
26.2395,
52.2152,
34.5736,
27.2569,
53.5939,
35.7150,
28.2740,
54.9662,
36.8538,
29.2908,
56.3325,
37.9902,
30.3073,
57.6921,
39.1244,
31.3235,

31.3194,
18.1508,
13.3393},
32.8015,
19.3107,
14.3389},
34.2671,
20.4651,
15.3385},
35.7184,
21.6146,
16.3382},
37.1564,
22.7595,
17.3379},
38.5821,
23.9004,
18.3376},
39.9969,
25.0375,
19.3374},
41.4009,
26.1711,
20.3372},
42.7957,
27.3015,
21.3370},
44.1814,
28.4288,
22.3369},
45.5584,
29.5533,
23.3367},
46.9280,
30.6752,
24.3366},
48.2898,
31.7946,
25.3365},
49.6450,
32.9117,
26.3363},
50.9936,
34.0266,
27.3362},
52.3355,
35.1394,
28.3361},
53.6719,
36.2502,
29.3360},
55.0025,
37.3591,
30.3359},

29.1412,
17.1169,

26.1189,
16.2221,

23.6848,
15.4209,

30.5780,
18.2451,

27.4884,
17.3217,

24.9958,
16.4940,

31.9999,
19.3689,

28.8453,
18.4179,

26.2962,
17.5646,

33.4087,
20.4887,

30.1910,
19.5110,

27.5871,
18.6330,

34.8052,
21.6049,

31.5264,
20.6014,

28.8693,
19.6993,

36.1908,
22.7178,

32.8523,
21.6891,

30.1435,
20.7638,

37.5663,
23.8277,

34.1696,
22.7745,

31.4104,
21.8265,

38.9322,
24.9348,

35.4789,
23.8578,

32.6706,
22.8876,

40.2894,
26.0393,

36.7807,
24.9390,

33.9245,
23.9473,

41.6383,
27.1413,

38.0756,
26.0184,

35.1725,
25.0055,

42.9798,
28.2412,

39.3641,
27.0960,

36.4150,
26.0625,

44.3140,
29.3388,

40.6465,
28.1719,

37.6525,
27.1183,

45.6416,
30.4346,

41.9231,
29.2463,

38.8851,
28.1730,

46.9628,
31.5284,

43.1945,
30.3193,

40.1133,
29.2266,

48.2782,
32.6205,

44.4608,
31.3909,

41.3372,
30.2791,

49.5878,
33.7109,

45.7223,
32.4612,

42.5569,
31.3308,

50.8922,
34.7997,

46.9792,
33.5302,

43.7730,
32.3815,

52.1914,
35.8871,

48.2319,
34.5981,

44.9853,
33.4314,

{62.4873,
42.5847,
33.3809,
{63.8694,
43.7452,
34.4126,
{65.2471,
44.9032,
35.4438,
{66.6192,
46.0588,
36.4746,
{67.9850,
47.2122,
37.5049,
{69.3476,
48.3634,
38.5348,
{70.7039,
49.5126,
39.5643,
{72.0550,
50.6598,
40.5935,
{73.4029,
51.8050,
41.6222,
};

59.0461,
40.2563,
32.3394,
60.3953,
41.3861,
33.3551,
61.7382,
42.5140,
34.3706,
63.0760,
43.6399,
35.3858,
64.4097,
44.7641,
36.4008,
65.7384,
45.8864,
37.4156,
67.0628,
47.0072,
38.4302,
68.3830,
48.1263,
39.4446,
69.6987,
49.2438,
40.4589,

56.3280,
38.4663,
31.3359},
57.6483,
39.5718,
32.3358},
58.9637,
40.6756,
33.3357},
60.2746,
41.7780,
34.3356},
61.5811,
42.8788,
35.3356},
62.8832,
43.9782,
36.3355},
64.1812,
45.0763,
37.3354},
65.4753,
46.1730,
38.3354},
66.7660,
47.2685,
39.3353}

53.4857,
36.9730,

49.4804,
35.6649,

46.1942,
34.4804,

54.7754,
38.0575,

50.7251,
36.7307,

47.3999,
35.5287,

56.0609,
39.1408,

51.9660,
37.7954,

48.6024,
36.5763,

57.3420,
40.2228,

53.2033,
38.8591,

49.8018,
37.6231,

58.6192,
41.3036,

54.4373,
39.9220,

50.9985,
38.6693,

59.8926,
42.3833,

55.6680,
40.9839,

52.1923,
39.7148,

61.1620,
43.4619,

56.8955,
42.0450,

53.3835,
40.7597,

62.4281,
44.5395,

58.1201,
43.1053,

54.5722,
41.8040,

63.6908,
45.6160,

59.3417,
44.1649,

55.7585,
42.8477,

public prueba_DE_chicuadrada(double raux []) {


r=raux;
}
public void Oi (){//cuenta el numero de observaciones encontradas en Ri perteneciente al rango del
intervalo
for (int i =0;i<cv;i++){
if(r[i]>0||r[i]<=0.1){intervalo[0]++;}
if(r[i]>0.1||r[i]<=0.2){intervalo[1]++;}
if(r[i]>0.2||r[i]<=0.3){intervalo[2]++;}
if(r[i]>0.3||r[i]<=0.4){intervalo[3]++;}
if(r[i]>0.4||r[i]<=0.5){intervalo[4]++;}
if(r[i]>0.5||r[i]<=0.6){intervalo[5]++;}
if(r[i]>0.6||r[i]<=0.7){intervalo[6]++;}
if(r[i]>0.7||r[i]<=0.8){intervalo[7]++;}
if(r[i]>0.8||r[i]<=0.9){intervalo[8]++;}
if(r[i]>0.9||r[i]<1){intervalo[9]++;}
}
}
public void estadisticaPrueba(){//calculamos la sumatoria de (Ei-Oi)/Ei
for (int i=0;i<m;i++){
estadistica+=(Math.pow((Ei-intervalo[i]),2))/Ei;
}
System.out.println(estadistica);
}
public String conclusion(){
String mensaje ="";

double valorXcuadrada=0;// valor de la tabla de chi cuadrada


for(int i =0;i<15;i++){
if (Xcuadrada[0][i]<=(alfa)){
valorXcuadrada=Xcuadrada[cv-1][i];}}
if (estadistica<valorXcuadrada){
mensaje="Los numeros Ri siguen una distribucion uniforme ";
}
else {
mensaje="Los numeros Ri NO siguen una distribucion uniforme ";
}
return mensaje;
}

} // fin del metodo de chi cuadrada

//----------------- metodo de poker----------------------------------------------------------------------------------------------------------

// Variables declaration - do not modify


private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton12;
private javax.swing.JButton jButton14;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration
}

Vous aimerez peut-être aussi