Edición de «Práctica 3: Cuantificadores (Algoritmos I)»
De Cuba-Wiki
Puedes deshacer la edición. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces publica los cambios para así efectuar la reversión.
Revisión actual | Tu texto | ||
Línea 7: | Línea 7: | ||
# (<math>\forall j \in [0..|s|)) s_j == x </math> | # (<math>\forall j \in [0..|s|)) s_j == x </math> | ||
# (<math>\exists x \in r, x\ mod\ 2 == 0)(\forall j \in [0..|s|)) s_j == x </math> | # (<math>\exists x \in r, x\ mod\ 2 == 0)(\forall j \in [0..|s|)) s_j == x </math> | ||
# <math> ( |s|>5 \land a < b-1 \land (\forall j \in [a..b)) 2 * s_j == s_{j+1})</math> | # <math> ( |s|>5 \land a<b-1 \land (\forall j \in [a..b)) 2 * s_j == s_{j+1})</math> | ||
Línea 64: | Línea 64: | ||
otras formas: | otras formas: | ||
-utilizar un aux ultimo que sea algo asi como cabeza(invertir(l:[T])) | -utilizar un aux ultimo que sea algo asi como cabeza(invertir(l:[T])) | ||
-acum(y | s: <math>\mathbb{Z}</math> = Indef, y <math>\leftarrow</math> [1..abs(x)], x mod y == 0); | |||
i) aux mcm<math>(x,y: \mathbb{Z}): \mathbb{Z}</math> = cab([ z | z <math>\leftarrow</math> [0..|x*y|], z \ mod \ x == 0, z \ mod \ y == 0]) | i) aux mcm<math>(x,y: \mathbb{Z}): \mathbb{Z}</math> = cab([ z | z <math>\leftarrow</math> [0..|x*y|], z \ mod \ x == 0, z \ mod \ y == 0]) | ||
Línea 119: | Línea 120: | ||
''sinRepetidos''(x: [T]): Bool = (<math>\forall</math> i,j <math>\leftarrow</math> [0..|x|-1], i <math>\neq</math>j) <math>x_i \neq x_j </math> | ''sinRepetidos''(x: [T]): Bool = (<math>\forall</math> i,j <math>\leftarrow</math> [0..|x|-1], i <math>\neq</math>j) <math>x_i \neq x_j </math> | ||
Línea 152: | Línea 149: | ||
===Ejercicio 4=== | ===Ejercicio 4=== | ||