import random[br] [br]# Generar un número aleatorio entre 1 y 10[br]x = random.randint(1, 11)[br]a = 3[br]b = 8[br][br]# Negaciones de Desigualdades[br]if x == a:[br] print("x == a")[br]else:[br] print("x != a")[br][br]if x != a:[br] print("x != a")[br]else:[br] print("x == a")[br][br]if x > a:[br] print("x > a")[br]else:[br] print("x <= a")[br][br]if x <= a:[br] print("x <= a")[br]else:[br] print("x > a")[br][br]if x >= a:[br] print("x >= a")[br]else:[br] print("x < a")[br][br]if x < a:[br] print("x < a")[br]else:[br] print("x >= a")[br][br]# Conversión de conjunción a disyunción por Ley de Morgan[br]if x > a and x < b:[br] print("x > a && x < b")[br]else:[br] print("x <= a || x >= b")[br][br]if x >= a and x <= b:[br] print("x >= a && x <= b")[br]else:[br] print("x < a || x > b")[br][br]if x >= a and x < b:[br] print("x >= a && x < b")[br]else:[br] print("x < a || x >= b")[br][br]if x > a and x <= b:[br] print("x > a && x <= b")[br]else:[br] print("x <= a || x > b")[br][br]# Conversión de disyunción a conjunción por Ley de Morgan[br]if x <= a or x >= b:[br] print("x <= a || x >= b")[br]else:[br] print("x > a && x < b")[br][br]if x < a or x > b:[br] print("x < a || x > b")[br]else:[br] print("x >= a && x <= b")[br][br]if x < a or x >= b:[br] print("x < a || x >= b")[br]else:[br] print("x >= a && x < b")[br][br]if x <= a or x > b:[br] print("x <= a || x > b")[br]else:[br] print("x > a && x <= b")
import random[br] [br]# Generar un número aleatorio entre 1 y 10[br]x = random.randint(1, 11)[br]a = 3[br]b = 8[br][br]# Negaciones de Desigualdades[br]if x == a:[br] print(x,"==",a)[br]else:[br] print(x,"!=",a)[br][br]if x != a:[br] print(x,"!=",a)[br]else:[br] print(x,"==",a)[br][br]if x > a:[br] print(x,">",a)[br]else:[br] print(x,"<=",a)[br][br]if x <= a:[br] print(x,"<=",a)[br]else:[br] print(x,">",a)[br][br]if x >= a:[br] print(x,">=",a)[br]else:[br] print(x,"<",a)[br][br]if x < a:[br] print(x,"<",a)[br]else:[br] print(x,">=",a)[br][br]# Conversión de conjunción a disyunción por Ley de Morgan[br]if x > a and x < b:[br] print(x,">",a,"&&",x,"<",b)[br]else:[br] print(x,"<=",a,"||",x,">=",b)[br][br]if x >= a and x <= b:[br] print(x,">=",a,"&&",x,"<=",b)[br]else:[br] print(x,"<",a,"||",x,">",b)[br][br]if x >= a and x < b:[br] print(x,">=",a,"&&",x,"<",b)[br]else:[br] print(x,"<",a,"||",x,">=",b)[br][br]if x > a and x <= b:[br] print(x,">",a,"&&",x,"<",b)[br]else:[br] print(x,"<=",a,"||",x,">",b)[br][br]# Conversión de disyunción a conjunción por Ley de Morgan[br]if x <= a or x >= b:[br] print(x,"<=",a,"||",x,">=",b)[br]else:[br] print(x,">",a,"&&",x,"<",b)[br][br]if x < a or x > b:[br] print(x,"<",a,"||",x,">",b)[br]else:[br] print(x,">=",a,"&&",x,"<=",b)[br][br]if x < a or x >= b:[br] print(x,"<",a,"||",x,">=",b)[br]else:[br] print(x,">=",a,"&&",x,"<",b)[br][br]if x <= a or x > b:[br] print(x,"<=",a,"||",x,">",b)[br]else:[br] print(x,">",a,"&&",x,"<=",b)
import random[br] [br]# Generar un número aleatorio entre 1 y 10[br]x = random.randint(1, 11)[br]a = 3[br]b = 8[br][br]# Negaciones de Desigualdades[br]if x == a:[br] print("{} == {}".format(x,a))[br]else:[br] print("{} != {}".format(x,a))[br][br]if x != a:[br] print("{} != {}".format(x,a))[br]else:[br] print("{} == {}".format(x,a))[br][br]if x > a:[br] print("{} > {}".format(x,a))[br]else:[br] print("{} <= {}".format(x,a))[br][br]if x <= a:[br] print("{} <= {}".format(x,a))[br]else:[br] print("{} > {}".format(x,a))[br][br]if x >= a:[br] print("{} >= {}".format(x,a))[br]else:[br] print("{} < {}".format(x,a))[br][br]if x < a:[br] print("{} < {}".format(x,a))[br]else:[br] print("{} >= {}".format(x,a))[br][br]# Conversión de conjunción a disyunción por Ley de Morgan[br]if x > a and x < b:[br] print("{0} > {1} && {0} < {2}".format(x,a,b))[br]else:[br] print("{0} <= {1} || {0} >= {2}".format(x,a,b))[br][br]if x >= a and x <= b:[br] print("{0} >= {1} && {0} <= {2}".format(x,a,b))[br]else:[br] print("{0} < {1} || {0} > {2}".format(x,a,b))[br][br]if x >= a and x < b:[br] print("{0} >= {1} && {0} < {2}".format(x,a,b))[br]else:[br] print("{0} < {1} || {0} >= {2}".format(x,a,b))[br][br]if x > a and x <= b:[br] print("{0} > {1} && {0} <= {2}".format(x,a,b))[br]else:[br] print("{0} <= {1} || {0} > {2}".format(x,a,b))[br][br]# Conversión de disyunción a conjunción por Ley de Morgan[br]if x <= a or x >= b:[br] print("{0} <= {1} || {0} >= {2}".format(x,a,b))[br]else:[br] print("{0} > {1} && {0} < {2}".format(x,a,b))[br][br]if x < a or x > b:[br] print("{0} < {1} || {0} > {2}".format(x,a,b))[br]else:[br] print("{0} >= {1} && {0} <= {2}".format(x,a,b))[br][br]if x < a or x >= b:[br] print("{0} < {1} || {0} >= {2}".format(x,a,b))[br]else:[br] print("{0} >= {1} && {0} < {2}".format(x,a,b))[br][br]if x <= a or x > b:[br] print("{0} <= {1} || {0} > {2}".format(x,a,b))[br]else:[br] print("{0} > {1} && {0} <= {2}".format(x,a,b))
import random[br] [br]# Generar un número aleatorio entre 1 y 10[br]x = random.randint(1, 11)[br]a = 3[br]b = 8[br][br]# Negaciones de Desigualdades[br]if x == a:[br] print(f"{x} == {a}")[br]else:[br] print(f"{x} != {a}")[br][br]if x != a:[br] print(f"{x} != {a}")[br]else:[br] print(f"{x} == {a}")[br][br]if x > a:[br] print(f"{x} > {a}")[br]else:[br] print(f"{x} <= {a}")[br][br]if x <= a:[br] print(f"{x} <= {a}")[br]else:[br] print(f"{x} > {a}")[br][br]if x >= a:[br] print(f"{x} >= {a}")[br]else:[br] print(f"{x} < {a}")[br][br]if x < a:[br] print(f"{x} < {a}")[br]else:[br] print(f"{x} >= {a}")[br][br]# Conversión de conjunción a disyunción por Ley de Morgan[br]if x > a and x < b:[br] print(f"{x} > {a} && {x} < {b}")[br]else:[br] print(f"{x} <= {a} || {x} >= {b}")[br][br]if x >= a and x <= b:[br] print(f"{x} >= {a} && {x} <= {b}")[br]else:[br] print(f"{x} < {a} || {x} > {b}")[br][br]if x >= a and x < b:[br] print(f"{x} >= {a} && {x} < {b}")[br]else:[br] print(f"{x} < {a} || {x} >= {b}")[br][br]if x > a and x <= b:[br] print(f"{x} > {a} && {x} <= {b}")[br]else:[br] print(f"{x} <= {a} || {x} > {b}")[br][br]# Conversión de disyunción a conjunción por Ley de Morgan[br]if x <= a or x >= b:[br] print(f"{x} <= {a} || {x} >= {b}")[br]else:[br] print(f"{x} > {a} && {x} < {b}")[br][br]if x < a or x > b:[br] print(f"{x} < {a} || {x} > {b}")[br]else:[br] print(f"{x} >= {a} && {x} <= {b}")[br][br]if x < a or x >= b:[br] print(f"{x} < {a} || {x} >= {b}")[br]else:[br] print(f"{x} >= {a} && {x} < {b}")[br][br]if x <= a or x > b:[br] print(f"{x} <= {a} || {x} > {b}")[br]else:[br] print(f"{x} > {a} && {x} <= {b}")
# Negaciones de Desigualdades[br]x = list(range(1, 11))[br]a = 3[br]b = 8[br][br]# Conversión de Negaciones de Desigualdades[br]a1 = [xi == a for xi in x][br]print(f'a1={a1}') # negación de x != a %!(x != a)[br]a2 = [xi != a for xi in x][br]print(f'a2={a2}') # negación de x == a %!(x == a)[br]a3 = [xi > a for xi in x][br]print(f'a3={a3}') # negación de x <= a %!(x <= a)[br]a4 = [xi <= a for xi in x][br]print(f'a4={a4}') # negación de x > a %!(x > a)[br]a5 = [xi >= a for xi in x][br]print(f'a5={a5}') # negación de x < a %!(x < a)[br]a6 = [xi < a for xi in x][br]print(f'a6={a6}') # negación de x >= a %!(x >= a)[br][br]# Conversión de Negación - De conjunción a disyunción por Ley de Morgan[br]a7 = [(xi > a) and (xi < b) for xi in x] # negación de x <= a | x >= b %!(x <= a | x >= b)[br]print(f'a7={a7}')[br]a8 = [(xi >= a) and (xi <= b) for xi in x] # negación de x < a | x > b %!(x < a | x > b)[br]print(f'a8={a8}')[br]a9 = [(xi >= a) and (xi < b) for xi in x] # negación de x < a | x >= b %!(x < a | x >= b)[br]print(f'a9={a9}')[br]a10 = [(xi > a) and (xi <= b) for xi in x] # negación de x <= a | x > b %!(x <= a | x > b)[br]print(f'a10={a10}')[br][br]# Conversión de Negación - De disyunción a conjunción por Ley de Morgan[br]a11 = [(xi <= a) or (xi >= b) for xi in x] # negación de x > a & x < b %!(x > a & x < b)[br]print(f'a11={a11}')[br]a12 = [(xi < a) or (xi > b) for xi in x] # negación de x >= a & x <= b %!(x >= a & x <= b)[br]print(f'a12={a12}')[br]a13 = [(xi < a) or (xi >= b) for xi in x] # negación de x >= a & x < b %!(x >= a & x < b)[br]print(f'a13={a13}')[br]a14 = [(xi <= a) or (xi > b) for xi in x] # negación de x > a & x <= b %!(x > a & x <= b)[br]print(f'a14={a14}')