Diferencia entre revisiones de «Práctica 4: Lenguajes regulares y lema de pumping (Teoría de Lenguajes)»

De Cuba-Wiki
Línea 7: Línea 7:
==Ejercicio 05==
==Ejercicio 05==


'''c)'''
''c) {0^n/n es un numero primo }''
Sup. L regular -> Sea a=0. <math>\exists</math> α<math>\in</math>a*, β <math>\in</math>a*,γ<math>\in</math>a*,β≠λ tq <math>\forall</math> n, α.β^n.γ<math>\in</math>L. Sean: α=a^p, β=a^q, γ=a^r. Como β≠λ -> q≥1. Se debe cumplir que <math>\forall</math>n, p+nq+r es primo. Sea n=(p+2q+r+2) -> p+nq+r debe ser primo -> p+nq+r = p+(p+2q+r+2)q+r = p+pq+2q^2+rq+2q+r = (q+1)(p+2q+r) es primo (ABS) -> L NO es regular
<br>Sup. L regular -> Sea a=0. <math>\exists</math> α<math>\in</math>a*, β <math>\in</math>a*,γ<math>\in</math>a*,β≠λ tq <math>\forall</math> n, α.β^n.γ<math>\in</math>L. Sean: α=a^p, β=a^q, γ=a^r. Como β≠λ -> q≥1. Se debe cumplir que <math>\forall</math>n, p+nq+r es primo. Sea n=(p+2q+r+2) -> p+nq+r debe ser primo -> p+nq+r = p+(p+2q+r+2)q+r = p+pq+2q^2+rq+2q+r = (q+1)(p+2q+r) es primo (ABS) -> L NO es regular


'''e)'''
''e) {x<math>\in</math>{0, 1}*/x tiene igual cantidad de ceros que de unos}''
Sea p la longitud de bombeo y sea s = 0^p.1^p <math>\in</math> L y |s| > p. Por el lema de bombeo <math>\exists</math>xyz = s tal que x.y^i.z <math>\in</math> L <math>\forall</math>i ≥ 0. Sea x = λ y z = λ, en este caso, xyz efectivamente pertenece a L, sin embargo, se requiere ademas que |xy| ≤ p (ABS) -> L NO es regular.
<br>Sea p la longitud de bombeo y sea s = 0^p.1^p <math>\in</math> L y |s| > p. Por el lema de bombeo <math>\exists</math>xyz = s tal que x.y^i.z <math>\in</math> L <math>\forall</math>i ≥ 0. Sea x = λ y z = λ, en este caso, xyz efectivamente pertenece a L, sin embargo, se requiere ademas que |xy| ≤ p (ABS) -> L NO es regular.


'''h)'''
''h) {x<math>\in</math>{0, 1}*/x = x^r}''
Sup. L regular -> Sea a=0,b=1. Sup M es un autómata con k estados que lo reconoce. Sea ω=a^k.b^k. Es claro que ω<math>\in</math>L -> (2.5) <math>\exists</math> α, β y ρ tq αβρ=ω y |αβ|≤k y <math>\forall</math> n, αβ^nρ<math>\in</math>L. Como ω=a^k.b^k y |αβ|≤k -> α y β están compuestas sólo de a´s. Por lo tanto, podemos decir que: α=a^t, β=a^s, ρ=a^[k-(s+t)].b^k, donde 1≤ s+t ≤ k y s ≥ 1. Es claro que: αβρ=ω
<br>Sup. L regular -> Sea a=0,b=1. Sup M es un autómata con k estados que lo reconoce. Sea ω=a^k.b^k. Es claro que ω<math>\in</math>L -> (2.5) <math>\exists</math> α, β y ρ tq αβρ=ω y |αβ|≤k y <math>\forall</math> n, αβ^nρ<math>\in</math>L. Como ω=a^k.b^k y |αβ|≤k -> α y β están compuestas sólo de a´s. Por lo tanto, podemos decir que: α=a^t, β=a^s, ρ=a^[k-(s+t)].b^k, donde 1≤ s+t ≤ k y s ≥ 1. Es claro que: αβρ=ω
<br>Como no se hicieron suposiciones adicionales con respecto a las cadenas, decir que <math>\forall</math> n, α.β^n.ρ<math>\in</math>L equivale a decir que <math>\forall</math> n, t+ns+k-(s+t)=k. Sin embargo tomando n=0, t+ns+k-(s+t) = t+k-(s+t) = k -> -s = 0. Pero s >= 1 (ABS) -> L no es regular.
<br>Como no se hicieron suposiciones adicionales con respecto a las cadenas, decir que <math>\forall</math> n, α.β^n.ρ<math>\in</math>L equivale a decir que <math>\forall</math> n, t+ns+k-(s+t)=k. Sin embargo tomando n=0, t+ns+k-(s+t) = t+k-(s+t) = k -> -s = 0. Pero s >= 1 (ABS) -> L no es regular.




[[Category:Prácticas]]
[[Category:Prácticas]]

Revisión del 14:24 7 may 2008

Plantilla:Back

Ejercicio 01

Ejercicio 02

Ejercicio 03

Ejercicio 04

Ejercicio 05

c) {0^n/n es un numero primo }
Sup. L regular -> Sea a=0. αa*, β a*,γa*,β≠λ tq n, α.β^n.γL. Sean: α=a^p, β=a^q, γ=a^r. Como β≠λ -> q≥1. Se debe cumplir que n, p+nq+r es primo. Sea n=(p+2q+r+2) -> p+nq+r debe ser primo -> p+nq+r = p+(p+2q+r+2)q+r = p+pq+2q^2+rq+2q+r = (q+1)(p+2q+r) es primo (ABS) -> L NO es regular

e) {x{0, 1}*/x tiene igual cantidad de ceros que de unos}
Sea p la longitud de bombeo y sea s = 0^p.1^p L y |s| > p. Por el lema de bombeo xyz = s tal que x.y^i.z L i ≥ 0. Sea x = λ y z = λ, en este caso, xyz efectivamente pertenece a L, sin embargo, se requiere ademas que |xy| ≤ p (ABS) -> L NO es regular.

h) {x{0, 1}*/x = x^r}
Sup. L regular -> Sea a=0,b=1. Sup M es un autómata con k estados que lo reconoce. Sea ω=a^k.b^k. Es claro que ωL -> (2.5) α, β y ρ tq αβρ=ω y |αβ|≤k y n, αβ^nρL. Como ω=a^k.b^k y |αβ|≤k -> α y β están compuestas sólo de a´s. Por lo tanto, podemos decir que: α=a^t, β=a^s, ρ=a^[k-(s+t)].b^k, donde 1≤ s+t ≤ k y s ≥ 1. Es claro que: αβρ=ω
Como no se hicieron suposiciones adicionales con respecto a las cadenas, decir que n, α.β^n.ρL equivale a decir que n, t+ns+k-(s+t)=k. Sin embargo tomando n=0, t+ns+k-(s+t) = t+k-(s+t) = k -> -s = 0. Pero s >= 1 (ABS) -> L no es regular.