Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ejemplos Clase 4 - 1 Lenguajes Formales y Autómatas
Ejemplos Clase 4 - 1 Lenguajes Formales y Autómatas
Mapear las abreviaturas de los meses del año utilizando la función de hash f:
S → {0,1,…,11}
|Colisiones:
Sondeo lineal:
(k+1) mod n
(5+1) mod 12 = 6
(5+2) mod 12 = 7
(5+3) mod 12 = 8
(5+4) mod 12 = 9
jan feb mar apr may jun jul aug sep oct nov dec
5 10 0 3 7 1 11 9 8 6 7 4
Sondeo lineal utilizando huecos (gaps)
g=5 mcd(5,12)=1
Para n = 12 y g = 5 con k= 5 :
(k + g) mod n = (5 + 5) mod 12
jan feb mar apr may jun jul aug sep oct nov dec
5 10 0 3 7 1 11 9 8 6 7 4
Para n = 12 y g = 5 con k= 7 :
(7+5) mod 12 = 0
(7+2.5) mod 12 = 5
(7+3.5) mod 12 = 10
(7+4.5) mod 12 = 3
0, 5, 10, 3, 8, 1, 6, 11, 4, 9, 2, 7.
jan feb mar apr May jun jul aug sep oct nov dec
5 10 0 3 7 1 11 9 8 6 2 4
Ejercicio 7 d)
(ax+b) mod n
mcd(a,n)=1
por teor. div. r=0 D=d.C => 2c+3 =7.C => c=(7.C-3) /2 => para C=1 se obtiene c=2
1−𝑚.7
1=a.k+m.n m debe ser entero 1=2.k+m.7 => 2
=k para m=-1 => k=4
f-1(x)=(4x+2)mod 7
f(3) = 2
f-1(2) = (4.2+2)mod 7 = 3
mcd(2,26)=2
Calcular a y b