Variables Aleatorias

download Variables Aleatorias

of 25

description

Simulación de Manufactura

Transcript of Variables Aleatorias

  • DR. JORGE ACUA

    GENERACION DE NUMEROS ALEATORIOS Y VARIABLES ALEATORIAS

    La simulacin de eventos se basa en la ocurrencia aleatoria de los mismos, por ello los nmeros aleatorios y las variables aleatorias son de especial importancia en la aplicacin de esta herramienta

  • news

    DR. JORGE ACUA

    VARIABLES ALEATORIAS

    PIDE UN NUMERO ALEATORIO

    PROCESO

    TIEMPO

    GENERADOR

    DE

    VARIABLES

    ALEATORIAS

    GENERADOR

    DE NUMEROS

    ALEATORIOS

    PIDE TIEMPO DA DISTRIBUCION Y PARAMETROS

    ENTREGA TIEMPO GENERADO

    ENTREGA NUMERO GENERADO

  • news

    DR. JORGE ACUA

    VARIABLES ALEATORIAS

    PROCESO

    TIEMPO=?

    GENERADOR

    DE

    VARIABLES

    ALEATORIAS

    GENERADOR

    DE

    NUMEROS

    ALEATORIOS

    NORMAL CON MEDIA=4.3 Y DESVIACION=0.4 PIDE UN

    NUMERO ALEATORIO

    TIEMPO=4.324

    ENTREGA 0.34555

  • news

    DR. JORGE ACUA

    GENERADOR DE NUMEROS

    ALEATORIOS

    Los nmeros aleatorios son los que dan un comportamiento real al modelo.

    Es un proceso matemtico-estadstico Existen varios algoritmos: Mtodo del cuadrado medio Mtodo congruencial lineal Mtodo congruencial multiplicativo

    Todos los mtodos se basan en una semilla En la generacin se debe poner especial cuidado al

    perodo, que es el nmero de nmeros que se pueden generar hasta que se repita la serie.

    El nmero aleatorio es un valor entre 0 y 1 y se distribuyen uniformemente.

  • news

    DR. JORGE ACUA

    METODO DEL CUADRADO

    MEDIO

    Es uno de los primeros mtodos. Consiste en:

    1. Escoger una semilla arbitraria

    2. Elevar la semilla al cuadrado

    3. Escoger los dgitos medios del cuadrado como nmero aleatorio

    4. Elevar esos dgitos al cuadrado

    5. Repetir 3 y 4 hasta generar los nmeros deseados sin que se repita la cadena o serie.

  • news

    DR. JORGE ACUA

    METODO DEL CUADRADO

    MEDIO EJEMPLO: Generar 4 nmeros aleatorios con la semilla

    5497. Ri : nmero aleatorio generado

    1. Semilla= X0= 5497

    2. X02

    = 54972 = 30217009

    3. X1 = 2170 R1 = 0.217

    4. X12 = 21702 = 04708900

    3. X2 = 7089 R2 = 0.7089

    4. X22 = 70892 = 50253921

    3. X3 = 2539 R3 = 0.2539

    4. X32 = 25392 = 06446521

    3. X4 = 4465 R4 = 0.4465

    Estos son los

    cuatro nmeros

    aleatorios

  • news

    DR. JORGE ACUA

    En Simulacin se debe siempre muestrear de una distribucin de probabilidad que representa la ocurrencia de los eventos.

    Estas distribuciones pueden ser tericas o empricas y ambas pueden ser continuas o discretas.

    Las distribuciones empricas estn representadas por distribuciones de frecuencias.

    En el caso de distribuciones tericas existen varios mtodos para generar las variables.

    GENERACION DE

    VARIABLES ALEATORIAS

  • news

    DR. JORGE ACUA

    Tcnicas para generar variables aleatorias provenientes de una distribucin terica: Transformada inversa (usada para generar variables

    aleatorias distribuidas segn Exponencial, Weibull y Triangular)

    Funcin acumulada (usada para generar variables aleatorias de distribuciones empricas)

    Transformacin directa (usada para generar variables normalmente distribuidas)

    Mtodo de convolucin (usado para generar variables aleatorias distribuidas segn ERLANG, POISSON y GAMMA)

    GENERACION DE

    VARIABLES ALEATORIAS

  • news

    DR. JORGE ACUA

    PROCEDIMIENTO

    1. Encontrar la funcin acumulada de la distribucin respectiva.

    2. Igualar esa funcin a R (nmero aleatorio uniformemente distribuido) sea F(x)=R

    3. Resolver la anterior ecuacin para x.

    4. Establecer la funcin generadora

    EJEMPLO

    Encontrar la funcin generadora de la exponencial.

    1. F(x) = 1 - e - x 2. 1 - e - x = R

    3. x = (-1/ ) ln(1-R) 4. xi = (-1/ ) ln(1-Ri)

    METODO DE LA

    TRANSFORMADA INVERSA

  • news

    DR. JORGE ACUA

    EJEMPLO DE GENERADOR DE VARIABLES EXPONENCIALES

    PROCESO

    TIEMPO=?

    xi = (-1/ )*

    ln(1-Ri)

    GENERADOR

    DE NUMEROS

    ALEATORIOS

    EXPONENCIAL MEDIA=4.5 MINS

    PIDE UN NUMERO ALEATORIO

    TIEMPO=1.91 MINS

    ENTREGA 0.34555

  • news

    DR. JORGE ACUA

    OTRAS FUNCIONES GENERADORAS

    Distribucin uniforme xi = a +( b - a ) * Ri

    Distribucin Weibull xi = * [ -ln (1 - Ri )]

    1/

    Distribucin triangular R1 = ALEATORIO 1

    R2 = ALEATORIO 2

    SI (R1 < (B - A) / (C - A)) ENTONCES

    Triangular = A + (B - A) * R2 SINO

    Triangular = C - (C - B) * R2

    METODO DE LA

    TRANSFORMADA INVERSA

  • news

    DR. JORGE ACUA

    DISTRIBUCION NORMAL PROCEDIMIENTO A.

    PROCEDIMIENTO B.

    1. Generar R1 y R2 Vi=2Ri-1 para i=1,2

    W=V12+V2

    2

    2. Si W>1 volver al Paso 1. Sino:

    Z1=V1*y Z2=V2*y

    X1=Z1* +

    X2=Z2* +

    *612

    1i

    iRX

    w

    wy

    )ln(2

  • news

    DR. JORGE ACUA

    EJEMPLO DE PROCEDIMIENTO

    A. Generar dos variables aleatorias para un tiempo de

    proceso cuya media es 5 y su desviacin estndar es 0.3.

    X1=S1* + = 0.2*0.3+5= 5.24

    X2=S2* + = -0.6*0.3+5= 4.82

    6.064.56

    2.062.66

    12

    1

    2

    12

    1

    1

    i

    i

    i

    i

    RS

    RS

  • news

    DR. JORGE ACUA

    EJEMPLO DE

    PROCEDIMIENTO B. Generar dos variables aleatorias para un tiempo de proceso cuya

    media es 5 y su desviacin estndar es 0.3. 1. R1=0.6 y R2 =0.3 V1=2(0.6) -1= 0.2 V2=2(0.3) -1=- 0.4 W=0.22+(-0.4)2=0.2

    2. W

  • news

    DR. JORGE ACUA

    EJEMPLO 2 DE

    PROCEDIMIENTO B. Generar 30 valores para un tiempo de proceso que se distribuye

    normalmente con media es 2.35 minutos y desviacin estndar es 0.23 minutos.

    # R1 R2 V1 V2 W y Z1 Z2 X1 X2

    1 0.760177467 0.04974372 0.52035493 -0.90051257 1.08169214 (No sirve pues W>1)

    2 0.50190155 0.54633272 0.0038031 0.09266543 0.00860135 33.2541048 0.12646867 3.08150595 2.38 3.06

    3 0.107204119 0.32589551 -0.78559176 -0.34820899 0.73840392 0.9063139 -0.71199273 -0.31558665 2.19 2.28

    4 0.744025954 0.20457119 0.48805191 -0.59085763 0.5873074 1.34624008 0.65703504 -0.79543622 2.50 2.17

    5 0.888466886 0.30798921 0.77693377 -0.38402158 0.75109866 0.87300188 0.67826464 -0.33525156 2.51 2.27

    6 0.600042775 0.51130059 0.20008555 0.02260119 0.04054504 12.5742851 2.51593273 0.28419381 2.93 2.42

    7 0.123304795 0.68341085 -0.75339041 0.3668217 0.70215527 1.00358691 -0.75609275 0.36813746 2.18 2.43

    8 0.656965005 0.07457283 0.31393001 -0.85085435 0.82250517 0.68930038 0.21639208 -0.58649423 2.40 2.22

    9 0.551837621 0.00516526 0.10367524 -0.98966949 0.99019425 0.14107958 0.01462646 -0.13962216 2.35 2.32

    10 0.958738503 0.5849138 0.91747701 0.16982761 0.87060547 0.56420017 0.51764068 0.09581677 2.47 2.37

    11 0.666282809 0.21796188 0.33256562 -0.56407625 0.4287819 1.98741681 0.6609465 -1.12105462 2.50 2.09

    12 0.819078493 0.20853019 0.63815699 -0.58293962 0.74706294 0.88355688 0.563848 -0.51506031 2.48 2.23

    13 0.293377603 0.30383294 -0.41324479 -0.39233413 0.32469733 2.63223846 -1.08775884 -1.03271698 2.10 2.11

    14 0.088355424 0.32108534 -0.82328915 -0.35782931 0.80584684 0.73194157 -0.60259955 -0.26191015 2.21 2.29

    15 0.097035419 0.77361042 -0.80592916 0.54722084 0.94897247 0.33224026 -0.26776211 0.1818088 2.29 2.39

    16 0.109395645 0.40379788 -0.78120871 -0.19240423 0.64730644 1.15923757 -0.90560649 -0.22304222 2.14 2.30

  • news

    DR. JORGE ACUA

    En este caso se trabaja con la frecuencia relativa acumulada y el punto medio que representa a la variable aleatoria.

    EJEMPLO: Para una distribucin de probabilidad variable continua

    Li Ls Xk nk fk Fk

    5.05 14.95 10.0 4 0.1250 0.1250

    14.95 24.85 19.9 6 0.1875 0.3125

    24.85 34.75 29.8 12 0.3750 0.6875

    34.75 44.65 39.7 8 0.2500 0.9375

    44.65 54.55 49.6 2 0.0625 1

    DISTRIBUCIONES EMPIRICAS

  • news

    DR. JORGE ACUA

    Xk Fk R(# aleatorio)

    10.0 0.1250 0.0000 0.1250

    19.9 0.3125 0.1251 0.3125

    29.8 0.6875 0.3126 0.6875

    39.7 0.9375 0.6876 0.9375

    49.6 1 0.9376 0.9999

    As, si por ejemplo, si se tiene un nmero aleatorio generado que da el valor de 0.5078, entonces el valor de la variable aleatoria es el correspondiente a Xk o sea 29.8.

    DISTRIBUCIONES

    EMPIRICAS

  • news

    DR. JORGE ACUA

    EJEMPLO DE GENERACION DE

    VARIABLES ALEATORIAS

    A: Determine un intervalo de confianza del

    95% para el tiempo de proceso de 40

    partes cuya funcin densidad de

    probabilidad es:

    B. Muestre los efectos en la media, desviacin

    e intervalo que tiene el incremento en el

    tamao de la muestra.

    0)4(

    32)(

    3xpara

    xxf

  • news

    DR. JORGE ACUA

    FUNCION ACUMULADA

    F(x)

    SOLUCION:

    A.

    016

    168

    )4(

    16

    )4(

    16

    2

    3232)(

    4

    )4(

    32)()(

    0)4(

    32)(

    2

    2

    2

    0

    2

    3

    0

    3

    0

    3

    Rxx

    Rx

    xuduuxF

    dxdu

    xu

    dxx

    dxxfxF

    xparax

    xf

  • news

    DR. JORGE ACUA

    GENERACION

    DE LA

    VARIABLE

    ALEATORIA x

    x2+8x+(16-16/R)

    # Aleatorio (16-16/R) x1 x2 x

    1 0,51 -15,11 1,58 -9,58 1,58

    2 0,86 -2,54 0,31 -8,31 0,31

    3 0,96 -0,73 0,09 -8,09 0,09

    4 0,88 -2,09 0,25 -8,25 0,25

    5 0,38 -25,96 2,48 -10,48 2,48

    6 0,33 -32,55 2,97 -10,97 2,97

    7 0,46 -18,58 1,88 -9,88 1,88

    8 0,75 -5,25 0,61 -8,61 0,61

    9 0,23 -52,36 4,27 -12,27 4,27

    10 0,81 -3,66 0,43 -8,43 0,43

    11 0,88 -2,12 0,26 -8,26 0,26

    12 0,28 -41,49 3,58 -11,58 3,58

    13 0,32 -34,39 3,10 -11,10 3,10

    14 0,75 -5,47 0,63 -8,63 0,63

    15 0,76 -5,05 0,59 -8,59 0,59

    17 0,43 -21,29 2,11 -10,11 2,11

    18 0,43 -21,33 2,11 -10,11 2,11

    19 0,55 -13,09 1,39 -9,39 1,39

    20 0,18 -72,89 5,43 -13,43 5,43

    21 0,81 -3,81 0,45 -8,45 0,45

    22 0,17 -77,77 5,68 -13,68 5,68

    23 0,96 -0,67 0,08 -8,08 0,08

    24 0,35 -30,23 2,80 -10,80 2,80

    25 0,34 -31,42 2,89 -10,89 2,89

    26 0,87 -2,39 0,29 -8,29 0,29

    27 0,99 -0,16 0,02 -8,02 0,02

    28 0,25 -48,55 4,03 -12,03 4,03

    29 0,52 -14,57 1,53 -9,53 1,53

    30 0,92 -1,30 0,16 -8,16 0,16

    31 0,65 -8,73 0,97 -8,97 0,97

    32 0,76 -4,99 0,58 -8,58 0,58

    33 0,31 -35,61 3,18 -11,18 3,18

    34 0,62 -9,63 1,06 -9,06 1,06

    35 0,94 -1,02 0,13 -8,13 0,13

    36 0,77 -4,87 0,57 -8,57 0,57

    37 0,89 -1,98 0,24 -8,24 0,24

    38 0,55 -13,24 1,41 -9,41 1,41

    39 0,38 -26,42 2,51 -10,51 2,51

    40 0,39 -25,54 2,44 -10,44 2,44

    PROMEDIO 1,67

    DESVIACION 1,534

  • news

    DR. JORGE ACUA

    RESPUESTA A LA PARTE

    A.

    El intervalo de confianza del 95% para el tiempo

    de proceso de 40 partes es:

    95.0}058.2282.1{

    058.240

    534.1*96,167.1

    '

    282.140

    534.1*96,167.1

    '

    95.0}{

    025.0

    025.0

    P

    nzxLs

    nzxLi

    LsLiP

  • news

    DR. JORGE ACUA

    RESPUESTA A LA PARTE

    B. n t Z xbarra sigma LIC LSC

    10 2,262 1,49 1,41 0,43 2,55

    30 2,045 1,79 1,67 1,16 2,43

    50 1,96 1,71 1,44 1,31 2,11

    100 1,96 1,90 1,89 1,53 2,27

    200 1,96 2,01 2,07 1,72 2,30

    300 1,96 2,11 2,34 1,84 2,37

    400 1,96 2,06 2,29 1,83 2,28

    500 1,96 2,09 2,30 1,88 2,29

    600 1,96 2,07 2,27 1,89 2,26

    700 1,96 2,01 2,19 1,84 2,17

    800 1,96 1,95 2,14 1,80 2,10

    900 1,96 1,93 2,11 1,79 2,06

    1000 1,96 1,92 2,08 1,79 2,05

  • news

    DR. JORGE ACUA

    GRAFICOS DE

    ESTABILIDAD

    DE LOS PROMEDIOS GRAFICO DE PROMEDIOS

    1,40

    1,50

    1,60

    1,70

    1,80

    1,90

    2,00

    2,10

    2,20

    0 100 200 300 400 500 600 700 800 900 1000

    TAMAO DE MUESTRA

    PR

    OM

    ED

    IO

  • news

    DR. JORGE ACUA

    GRAFICOS DE

    ESTABILIDAD

    DE LAS DESVIACIONES ESTANDAR GRAFICO DE DESVIACIONES ESTANDAR

    1,40

    1,60

    1,80

    2,00

    2,20

    2,40

    0 100 200 300 400 500 600 700 800 900 1000

    TAMAO DE MUESTRA

    DE

    SV

    IAC

    ION

    ES

    TA

    ND

    AR

  • news

    DR. JORGE ACUA

    GRAFICOS DE

    ESTABILIDAD

    DE LOS INTERVALOS DE CONFIANZA GRAFICO DE INTERVALOS DE CONFIANZA

    0,300,550,801,051,301,551,802,052,302,55

    0 100 200 300 400 500 600 700 800 900 1000

    TAMAO DE LA MUESTRA

    LIM

    ITE

    S D

    E C

    ON

    FIA

    NZ

    A