기초수학-실습 [길한얼]

2027 days 전, charta 작성

plot(Piecewise([[(0,1),x^2],[(1,2),1],[(2,3),x^2-3]])) 
       
1 in ZZ 
       
True
True
1/2 in ZZ 
       
False
False
1/2 in QQ 
       
True
True
sqrt(2) in QQ 
       
False
False
sqrt(2) in RR 
       
True
True
i^2 
       
-1
-1
i^3 
       
-I
-I
I in RR 
       
False
False
I in CC 
       
True
True
QQ(.5) 
       
1/2
1/2
RR(sqrt(2)) 
       
1.41421356237310
1.41421356237310
not True 
       
False
False
not False 
       
True
True
True and False 
       
False
False
True and True 
       
True
True
True or False 
       
True
True
False or False 
       
False
False
(True or False) and False 
       
False
False
True or (False and False) 
       
True
True
1 == 1 
       
True
True
1 == 0 
       
False
False
not(True or False) == True and False 
       
False
False
1 != 1 
       
False
False
1 != 0 
       
True
True
1 <> 0 
       
True
True
1 > 2 
       
False
False
2 > 1 
       
True
True
4.1 < 5.7 
       
True
True
6 < 5 
       
False
False
1 >= .99999 
       
True
True
1 <= 35 
       
True
True
not (True or False) == (False and True) 
       
True
True
1 >= 1 
       
True
True
1 + i >= 2 - i 
       
(I + 1) >= (-I + 2)
(I + 1) >= (-I + 2)
((3/2) > 1) or (2/3 < 1) 
       
True
True
((3/2) > 1) ^^ (2/3 < 1) 
       
False
False
x > 1/2 
       
x > (1/2)
x > (1/2)
s=12 s 
       
12
12
s=34 s 
       
34
34
t=7 t=t+1 t 
       
8
8
a,b=1,2 a 
       
1
1
       
2
2
c,d,e=2,3,5 c,d,e 
       
(2, 3, 5)
(2, 3, 5)
a = b = 1 a 
       
1
1
       
1
1
f(x) = x^2 + x + 1 
       
x=3 f(x) 
       
13
13
[6,28,496,8128] 
       
[6, 28, 496, 8128]
[6, 28, 496, 8128]
[1..7] 
       
[1, 2, 3, 4, 5, 6, 7]
[1, 2, 3, 4, 5, 6, 7]
[4..9] 
       
[4, 5, 6, 7, 8, 9]
[4, 5, 6, 7, 8, 9]
[2,4..10] 
       
[2, 4, 6, 8, 10]
[2, 4, 6, 8, 10]
[1,4..13] 
       
[1, 4, 7, 10, 13]
[1, 4, 7, 10, 13]
[1,11..31] 
       
[1, 11, 21, 31]
[1, 11, 21, 31]
[1,11..35] 
       
[1, 11, 21, 31]
[1, 11, 21, 31]
[pi,4*pi..32] 
       
[pi, 4*pi, 7*pi, 10*pi]
[pi, 4*pi, 7*pi, 10*pi]
x = pi * 2 x = x / 2 x 
       
pi
pi
A=Set([2,3,3,3,2,1,8,6,3]) A 
       
{8, 1, 2, 3, 6}
{8, 1, 2, 3, 6}
A.cardinality() 
       
5
5
8 in A 
       
True
True
10 in A 
       
False
False
B = Set([8,6,17,-4,20, -2 ]) B 
       
{17, 20, 6, 8, -4, -2}
{17, 20, 6, 8, -4, -2}
A.union(B) 
       
{1, 2, 3, 6, 8, 17, 20, -4, -2}
{1, 2, 3, 6, 8, 17, 20, -4, -2}
A.intersection(B) 
       
{8, 6}
{8, 6}
A.difference(B) 
       
{1, 2, 3}
{1, 2, 3}
B.difference(A) 
       
{17, 20, -4, -2}
{17, 20, -4, -2}
A.symmetric_difference(B) 
       
{17, 2, 3, 20, 1, -4, -2}
{17, 2, 3, 20, 1, -4, -2}
A = Set([1,2,3]) A 
       
{1, 2, 3}
{1, 2, 3}
powA = A.subsets(); powA 
       
Subsets of {1, 2, 3}
Subsets of {1, 2, 3}
pairsA = A.subsets(2); pairsA 
       
Subsets of {1, 2, 3} of size 2
Subsets of {1, 2, 3} of size 2
powA.list() 
       
[{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}]
[{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}]
pairsA.list() 
       
[{1, 2}, {1, 3}, {2, 3}]
[{1, 2}, {1, 3}, {2, 3}]
[tan(x) for x in [0,pi/4..pi]] 
       
[0, 1, Infinity, -1, 0]
[0, 1, Infinity, -1, 0]
M = Set([3,6..20]) M.subsets().cardinality() 
       
64
64
14 // 4 
       
3
3
14 % 4 
       
2
2
divmod(14,4) 
       
(3, 2)
(3, 2)
3.divides(15) 
       
True
True
5.divides(17) 
       
False
False
12.divisors() 
       
[1, 2, 3, 4, 6, 12]
[1, 2, 3, 4, 6, 12]
101.divisors() 
       
[1, 101]
[1, 101]
(2^19-1).is_prime() 
       
True
True
153.is_prime() 
       
False
False
62.factor() 
       
2 * 31
2 * 31
63.factor() 
       
3^2 * 7
3^2 * 7
24.prime_divisors() 
       
[2, 3]
[2, 3]
63.prime_divisors() 
       
[3, 7]
[3, 7]
gcd(14,63) 
       
7
7
gcd(15,19) 
       
1
1
lcm(4,5) 
       
20
20
lcm(14,21) 
       
42
42
divmod(956,98) 
       
(9, 74)
(9, 74)
956//98 
       
9
9
956%98 
       
74
74
3.divides(234878) 
       
False
False
134.divisors() 
       
[1, 2, 67, 134]
[1, 2, 67, 134]
491.divisors() 
       
[1, 491]
[1, 491]
422.divisors() 
       
[1, 2, 211, 422]
[1, 2, 211, 422]
1002.divisors() 
       
[1, 2, 3, 6, 167, 334, 501, 1002]
[1, 2, 3, 6, 167, 334, 501, 1002]
[is_prime(x) for x in divisors(134)] 
       
[False, True, True, False]
[False, True, True, False]
[is_prime(x) for x in divisors(491)] 
       
[False, True]
[False, True]
[is_prime(x) for x in divisors(422)] 
       
[False, True, True, False]
[False, True, True, False]
[is_prime(x) for x in divisors(1002)] 
       
[False, True, True, False, True, False, False, False]
[False, True, True, False, True, False, False, False]
[gcd(x) for x in [(2,5),(4,10),(18,51)]] 
       
[1, 2, 3]
[1, 2, 3]
[lcm(x) for x in [(2,5),(4,10),(18,51)]] 
       
[10, 20, 306]
[10, 20, 306]
[(2*5),(4*10),(18*51)] 
       
[10, 40, 918]
[10, 40, 918]
max(1,5,8) 
       
8
8
min(1/2,1/3) 
       
1/3
1/3
abs(-10) 
       
10
10
abs(4) 
       
4
4
plot(abs(4))