Thursday, November 18, 2004

Metodo Congruencial Mixto

 
El generador congruencial mixto nos permite obtener una sucesión de números aleatorios sin repetir ninguno siempre y cuando se escojan bien los parámetros.

Formula: Xn+1 = (a Xn + c) mod m

c = Entero impar, no divisible ni por 3 ni por 5
a = Cualquiera pero a ≡ 21 mod 200
m = número mayor aceptado por la computadora


Aquí esta el código fuente de el procedimiento Sub para generarlos valores

Public Sub Generacion()
Par = True
a = 21 Mod 200
'''''''''''''''' Generación De ro Como Impar
Do While (Par = True)
Randomize
c = Int((100 * Rnd))
If c / 2 = CInt(c / 2) Then
Par = True
Else
Par = False
'aqui validamos las condiciones
If Not (c Mod 3 = 0) Then
If Not (c Mod 5 = 0) Then
Par = False
Else
Par = True
End If
Else
Par = True
End If
'aqui termina la validacion
End If
Loop
Randomize
ro = Int((100 * Rnd))
'''''''''''''''' Generación De ro Como Impar
'''''''''''''''' Generación De m Mayor Que 2
Do While (Par = False)
Randomize
b = Int((100 * Rnd))
If (b > 2) Then
Par = True
Else
Par = False
End If
Loop
m = 2 * b
m = 100
End Sub


Comments:
esta bueno, de casualidad no tienes el congruencial multiplicativo?
 
hola, amigo la verdad yo llevo la materia de simulacion soy ing. industrial pero no se programar, serias tan amable de pasarme la pantalla de tu generador en visual? porfavor te lo agradeceria mucho es urgentisimo mi correo es
jorgeuc123@hotmail.com
 
hola amigo yo tambien estudio ingenieria y me interesa mucho tener la misma informacion que te pide jorge espadas, mi correo es ziorus@gmail.com
 
yo tengo el programa hecho n java dexit0@hot
 
We were slightly less impressed with the recent lap-tops from companies like Toshiba,
and the result is nothing short of gorgeous.

Also visit my site sex cams
 
Hello, Neat post. There is an issue together with your website in internet explorer, could check this?

IE nonetheless is the market chief and a big component to other
folks will omit your wonderful writing due to this problem.


My web page :: uz-translations.net
 
This is a topic which is close to my heart... Thank you!
Exactly where are your contact details though?

Feel free to surf to my blog; joonjeong.kr
 
Good day! I know this is kinda off topic but I was wondering if you knew where I
could find a captcha plugin for my comment form?

I'm using the same blog platform as yours and I'm having difficulty finding
one? Thanks a lot!

My blog: http://kalanka.org/w/index.php?title=Next_Year_Main_Feature_And_Driving_Performance
 
Do you mind if I quote a few of your posts as long as I
provide credit and sources back to your weblog? My blog is in the very
same niche as yours and my visitors would certainly benefit from a
lot of the information you provide here. Please let me know if this alright with you.
Thanks!

Take a look at my page ... yacobi
 
I do accept as true with all the ideas you have introduced for your post.
They are really convincing and can definitely work.
Nonetheless, the posts are too short for starters. Could you please prolong them a bit from subsequent time?
Thanks for the post.

Feel free to surf to my blog unleaded
 
Post a Comment  Home