1) សំណុំ តក្ក ទំនាក់ទំនង អនុគមន៍ ទំនាក់ទំនងកំណើន និងស្វ៊ីត
2) វិភាគបន្សំ ប្រូបាប៊ីលីតេ
3) Algorithms (វិធីសាស្រ្តកូដ) និងកម្មវិធីកុំព្យួរទ័រ(Scilab/Python)
4) Number theory and group theory
5) Cryptography
6) Applied Graph Theory
-វត្តមាននិងការចូលរួមសកម្មភាពសិក្សាក្នុងថ្នាក់(Attendent) 10%
-ការប្រឡងត្រួតពិនិត្យពាក់កណ្តាលឆមាស(Mid-term) 20%
-ការធ្វើកិច្ចការស្រាវជ្រាវ(Assignment) 20%
-ការប្រឡងបញ្ចប់ឆមាស(Final Term) 50%
print(3 < 5 and 7 < 5)
print(3 < 5 and not(7 < 5))
print(2+2 == 5 or 2+2 == 4)
.......................................................................
def foo():
print('Foo!')
return True
if 2 + 2 == 5 and foo():
print('True')
else:
print('False')
.................................................................
a = (6, 2, 4)
print(all((i % 2 == 0) for i in a))
a = (2, 7, 6)
print(all((i % 2 == 0) for i in a))
.................................................
def is_divisible_by_3(x):
return x % 3 == 0
lst = [5, 17, 6, 10]
print(not any([is_divisible_by_3(x) for x in lst]))
print(all([not is_divisible_by_3(x) for x in lst]))
.........................................................
ប្រវែងម៉ាទ្រីស
def length(lst):
if not lst:
return 0
else:
return 1 + length(lst[1:])
print(length([5, 3, 2, 1, 7]))
...............................................................
ហ្វាក់តូរ្យែល
def factorial(n):
assert n > 0
result = 1
for i in range(1, n + 1):
result *= i #result = result * i
return result
print(factorial(10))
................................................................
#Find maximum number of a, b, c
a=9
b=5
c=30
large=a
if b>large:
large=b
if c>large:
large=c
print(large)
#Find maximun element of Matrix A/ List A
A=[1, 3, 4, 8, 2, 4, 6, 1]
large=A[0]
for i in range(6):
if A[i+1]>large:
large=A[i+1]
print(large)
......................................................................
Multiple Matrix
# take a 3x3 matrix
A = [[12, 7, 3],
[4, 5, 6],
[7, 8, 9]]
# take a 3x4 matrix
B = [[5, 8, 1, 2],
[6, 7, 3, 0],
[4, 5, 9, 1]]
result = [[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]]
# iterating by row of A
for i in range(len(A)):
# iterating by column by B
for j in range(len(B[0])):
# iterating by rows of B
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]
for r in result:
print(r)
រក gcd, lcm
a = int(input('a= '))
b = int(input('b= '))
c=a*b
while b > 0:
r = a % b
a, b = b, r
print('gcd(a,b)=',a)
print('lcm(a,b)=',c/a)
.....................................
ដោះស្រាយសមីការឌីអូហ្វែនថាយ
ប្រើ Euclidean Algorithm https://www.math.uwaterloo.ca/~snburris/htdocs/linear.html
from sympy import gcdex
def solve_equation(a, b, c):
p, q, d = gcdex(a, b)
return (p * c // d, q * c // d) if c % d == 0 \
else 'no solution'
for a, b, c in ((391, 299, -69), (10, 6, 14), (10, 6, 15)):
print(f'Solution to {a}x+{b}y={c}:',solve_equation(a, b, c))
RSA cryptography
r=25%7 # find r such that 25=r(m0nd 3)
print(r)
.....................
#find e for gcd(713,e)=1
import math
for e in range(712):
if math.gcd(712,e)==1:
print(e)
.....................
#find d such that ed=1(mon phi(n))
import math
for d in range(660):
if (169*d)%660==1:
print(d)
.....................
#Decrpto C=m**e=144 find m, c^d=(m^e)^d=144^d (mod n)
m=(144**289)%713
print(m)
.....................
#change str into number
string = 'Geeks'
letter = 'k'
print(string.rfind(letter))
....................
# String into number
substr=str(input('LETTER:'))
alpha=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*()+-=_?<>~[]{}'
substr='Hello My Friends'
l=len(alpha)
sl=len(substr)
M=0
for i in range(sl):
k=alpha.rfind(substr[i])
M+=k*(10**(2*(sl-i-1)))
print(M)
................................................
import sys, threading
sys.setrecursionlimit(10**7)
threading.stack_size(2**27)
def ConvertToInt(message_str): # Converts message to integers
res = 0
for i in range(len(message_str)):
res = res * 256 + ord(message_str[i])
return res
def PowMod(a, n, mod): # Converts message(int), exponent, public key to ciphertext
if n == 0:
return 1 % mod
elif n == 1:
return a % mod
else:
b = PowMod(a, n // 2, mod)
b = b * b % mod
if n % 2 == 0:
return b
else:
return b * a % mod
def Encrypt(message, modulo, exponent):
return PowMod(ConvertToInt(message), exponent, modulo)
...............................................................
#CORRECT convert string into number
substr=str(input('LETTER:'))#substr='Hello My Friends'
alpha=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*()+-=_?<>~[]{}'
l=len(alpha)
sl=len(substr)
M=0
for i in range(sl):
k=alpha.rfind(substr[i])
M+=k*(10**(2*(sl-i-1)))
print(M)
............................................................
#COORECTconvert from number to string
#subint=int(input('Number:'))
n=int(input('Number:'))#12344600246707989098690
alpha=' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*()+-=_?<>~[]{}'
str1=str(n)
l=len(str1)
for i in range(2,l+1,2):
if l%2==0:
d=n//(10**(l-i))
di=(d%(100))%(len(alpha)+1)
else:
d=n//(10**(l-i+1))
di=(d%(100))%(len(alpha)+1)
print(alpha[di])
...................................
Applied Graph Theory
Related Course: Discrete Applied Mathematics
Textbook: Diestel, Graph Theory, 4th edition, is available at http://diestel-graph-theory.com/, including a free online version. You are expected to read the appropriate sections from this textbook corresponding to topics we discuss in lectures. Book Read Online" Graph Theory"
2. Matching, covering and packing
https://www.prip.tuwien.ac.at/staffpages/yll/docs/graph_theory_book_diestel.pdf
https://diestel-graph-theory.com/basic.html
https://www.emis.de/monographs/Diestel/en/GraphTheoryII.pdf
Examinations:
Mid-term Exam I: October 11th, Thursday. Topics: All topics corresponding to HWs#1,2,3.
Mid-term Exam II: November 15th, Thursday. Topics: All topics corresponding to HWs#4,5.
Final Exam : December 5th, Wednesday, 10:30am. Topics: All topics studied during the semester.
Homework Assignments:
Homework #1 [Double HW]: Due Thursday, 9/6 Solutions distributed on Thursday, 9/6.
Homework #2: Due Thursday, 9/20 Solutions distributed on Thursday, 9/20.
Homework #3 [Long HW]: Due Thursday, 10/4 Solutions distributed on Thursday, 10/4.
Homework #4: Due Tuesday, 10/23 Solutions distributed on Thursday, 10/25.
Homework #5 [Double HW]: Due Thursday, 11/8 Solutions distributed on Thursday, 11/8.
Homework #6 [Double HW]: Due Thursday, 11/29 Solutions to be distributed on Thursday, 11/29.
Links for Additional Information:
Mathworld : Graph Theory Dictionary
Glossary of terms in combinatorics
Dynamic Surveys in Combinatorics
Combinatorial Software and Databases
Textbooks for alternative points of view and for additional applications:
Graph Theory with Applications by Bondy and Murty
Introduction to Graph Theory, 2nd edition, D. West.
Modern Graph Theory, B. Bollobas.
Graph Theory (2008 edition), Bondy & Murty.
Algorithmic graph theory and perfect graphs, 2nd edition Martin Golumbic.
Graphs and Applications: An Introductory Approach, J.M.Aldous & R.J.Wilson.
Graph Theory Applications, L.R.Foulds.
Topics in Intersection Graph Theory, T.A.McKee & F.R.McMorris
Bipartite Graphs and their Applications, A.S.Asratian, T.MJ Denley, R.Haggkvist
https://www.math.iit.edu/~kaul/teaching.html
Modern Method in Discrete Mathematics
Principle Discrete Applied math
Topics in discrete applied mathematics, such as probability, information theory, coding theory, generating functions, and linear programming.