New Score :0
High Score :0
Run Best
NICE BUSINESS TYPE INDICATOR
3. ๊ธ์ ์ ์น๊ตฌ์๊ฒ ๋น๋ ธ๋๋ฐ ์ค๋์ด ๋์ ์ฃผ๊ธฐ๋ก ํ๋ .. ๊ทธ๋ฐ๋ฐ ์นด๋๊ฐ์ ๋ด์ผํ๋ ๋ ๋ ์ค๋์ธ๋ฐ... ์ด๊ฑธ ์ด์ฉ๋...
4. ์ฐ๋ฆฌ ํ์ฌ๋ ์ค์ํ ์์ฌ ๊ฒฐ์ ์ ํ ๋?
5. ์ด์ฌํ ์ผํ ๋๋ฅผ ์ํ ์ ๋ฌผ์ ์ฃผ๊ณ ์ถ๋ค. ์ด๋ค๊ฒ ์ข์๊น?
6. ์ํ์์ ํฌ์์ํ์ ์ถ์ฒ๋ฐ์๋ค. ์ด๋ค๊ฑธ ๊ฐ์ ํ์ง?
7. ํ์ฌ์์์ ๋๋?
8. ๊ฟ์์ ๊นจ์ด๋๋ 20๋ ์ ์ผ๋ก ๋์๊ฐ๋ค. ๋น์ ์ด ์ ์ผ ๋จผ์ ํ๋์ผ์?
9. ๋ด๊ฐ ์ธ์ฌ ๋ด๋น์๋ผ๋ฉด ์ ๊ท ์ ์ฌ์ ์ฑ์ฉ ์ ์ ์ผ ์ค์ํ๊ฒ ๋ณด๋๊ฒ์?
10. ํ์ฌ์ ์ ๋ง ์ซ์ดํ๋ ๋๋ฃ๊ฐ ์๋ค๋ฉด?
11. ๊ฐ๋ํ ์ง์ ๊ฐ์ฅ์ด ๋์๋ค.. ์๋ ์ ์์ผ ๋ ์ ๋ฌผ์?
12. ํ์ ํ์ฌ ์ถ๊ทผ ์คํ์ผ์?
13.ํ์ฌ ์ฒด์ก๋ํ ํ๋ ๋ ์ด๋ค. ์ค๋ ๋ญํ์ง?
14. ๋์ ์ ๋ฌด ์คํ์ผ์?
import numpy as np
def commonCompare(tmp):
if tmp <= 0:
return 0
else:
return 1
def AND(x1, x2):
x = np.array([x1, x2]) # ์
๋ ฅ์ ํธ
w = np.array([0.5, 0.5]) # ๊ฐ์ค์น
b = -0.7 # ์๊ณ๊ฐ
tmp = np.sum(w*x) + b
return commonCompare(tmp)
def OR(x1, x2):
x = np.array([x1, x2]) # ์
๋ ฅ์ ํธ
w = np.array([0.5, 0.5]) # ๊ฐ์ค์น
b = -0.2 # ์๊ณ๊ฐ
tmp = np.sum(w*x) + b
return commonCompare(tmp)
def NAND(x1, x2):
x = np.array([x1, x2]) # ์
๋ ฅ์ ํธ
w = np.array([-0.5, -0.5]) # ๊ฐ์ค์น
b = 0.7 # ์๊ณ๊ฐ
tmp = np.sum(w*x) + b
return commonCompare(tmp)
def NOR(x1, x2):
x = np.array([x1, x2]) # ์
๋ ฅ์ ํธ
w = np.array([-0.5, -0.5]) # ๊ฐ์ค์น
b = 0.2 # ์๊ณ๊ฐ
tmp = np.sum(w*x) + b
return commonCompare(tmp)
def XOR_type1(x1, x2):
s1 = NAND(x1, x2)
s2 = OR(x1, x2)
y = AND(s1, s2)
return y
def XOR_type2(x1, x2): # NAND๋ง์ผ๋ก ๊ตฌ์ฑ
t1 = NAND(x1, x2)
s1 = NAND(x1, t1)
s2 = NAND(t1, x2)
y = NAND(s1, s2)
return y
def XOR_type3(x1, x2): # NOR๋ง์ผ๋ก ๊ตฌ์ฑ
s1 = NOR(x1, x1)
s2 = NOR(x2, x2)
t1 = NOR(s1, s2)
t2 = NOR(x2, x1)
y = NOR(t1, t2)
return y
print('-------------------------AND-------------------------')
print(AND(0, 0)) # 0
print(AND(1, 0)) # 0
print(AND(0, 1)) # 0
print(AND(1, 1)) # 1
print('-------------------------OR-------------------------')
print(OR(0, 0)) # 0
print(OR(1, 0)) # 1
print(OR(0, 1)) # 1
print(OR(1, 1)) # 1
print('-------------------------NAND-------------------------')
print(NAND(0, 0)) # 1
print(NAND(1, 0)) # 1
print(NAND(0, 1)) # 1
print(NAND(1, 1)) # 0
print('-------------------------NOR-------------------------')
print(NOR(0, 0)) # 1
print(NOR(1, 0)) # 0
print(NOR(0, 1)) # 0
print(NOR(1, 1)) # 0
print('-------------------------XOR type 1-------------------------')
print(XOR_type1(0, 0)) # 0
print(XOR_type1(1, 0)) # 1
print(XOR_type1(0, 1)) # 1
print(XOR_type1(1, 1)) # 0
print('-------------------------XOR type 2-------------------------')
print(XOR_type2(0, 0)) # 0
print(XOR_type2(1, 0)) # 1
print(XOR_type2(0, 1)) # 1
print(XOR_type2(1, 1)) # 0
print('-------------------------XOR type 3-------------------------')
print(XOR_type3(0, 0)) # 0
print(XOR_type3(1, 0)) # 1
print(XOR_type3(0, 1)) # 1
print(XOR_type3(1, 1)) # 0
๋ํ์ด ์ฃผ๋ ์ฒ๋ฆฌ๋ C์ C++๋ก ๊ตฌํ ๋์์ต๋๋ค.