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 46: | Línea 46: | ||
'''Respuestas:''' | '''Respuestas:''' | ||
a) aux suc <math>(x: \mathbb{Z}): \mathbb{Z}</math> = x + 1 | a) aux suc <math>(x: \mathbb{Z}): \mathbb{Z}</math> = x+1 | ||
b) aux suma <math>(x,y: \mathbb{R}): \mathbb{R}</math> = x + y | b) aux suma <math>(x,y: \mathbb{R}): \mathbb{R}</math> = x + y | ||
c) aux producto<math>(x, y: \mathbb{R}): \mathbb{R}</math> = x * y | c) aux producto<math>(x, y: \mathbb{R}): \mathbb{R}</math> = x * y | ||
d) aux cuadrado<math>(x: \mathbb{Z})</math>: Bool = | d) aux cuadrado<math>(x: \mathbb{Z})</math>: Bool = (<math>\exists y \leftarrow</math> [1..y]) y*y = x | ||
e)aux primo<math>(x: \mathbb{Z})</math>: Bool = |[ y | y <math>\leftarrow</math>[1..|x|], x mod y == 0]| == 2 (Recordemos que un número es primo si tiene exactamente dos divisores positivos: el 1 y su valor absoluto) | e)aux primo<math>(x: \mathbb{Z})</math>: Bool = |[ y | y <math>\leftarrow</math>[1..|x|], x mod y == 0]| == 2 (Recordemos que un número es primo si tiene exactamente dos divisores positivos: el 1 y su valor absoluto) | ||
Línea 68: | Línea 68: | ||
j) aux mcd<math>(x,y: \mathbb{Z}): \mathbb{Z}</math> = <math>[ z | z \leftarrow [0..|x|], x \ mod \ z == 0, y \ mod \ z == 0 ]_{[ z | z \leftarrow [0..|x|], x \ mod \ z == 0, y \ mod \ z == 0 ] - 1}</math> | j) aux mcd<math>(x,y: \mathbb{Z}): \mathbb{Z}</math> = <math>[ z | z \leftarrow [0..|x|], x \ mod \ z == 0, y \ mod \ z == 0 ]_{[ z | z \leftarrow [0..|x|], x \ mod \ z == 0, y \ mod \ z == 0 ] - 1}</math> | ||
===Ejercicio 3=== | ===Ejercicio 3=== |