Professional Documents
Culture Documents
Lớp : 17050310
Khoá : 21
Lớp : 17050310
Khoá : 21
LỜI CẢM ƠN
Em xin gửi lời cảm ơn chân thành và sự tri ân sâu sắc đối với trường Đại Học Tôn
Đức Thắng và các thầy cô trong khoa Công Nghệ Thông Tin đã tạo điều kiện cho em
được tham gia môn học bổ ích này, giúp em có được những kiến thức quý giá và kinh
nghiệm để ứng dụng vào thực tiễn sau này . Và em cũng xin chân thành cảm ơn thầy Mai
Duy Tân đã nhiệt tình hướng dẫn để nhóm hoàn thành tốt bài tiểu luận này.
Bước đầu đi vào thực tế với kiến thức còn hạn chế. Vì thế, trong bài đề tài không
tránh khỏi sai sót, em rất mong quý Thầy Cô bỏ qua và nhận được ý kiến đóng góp quý
báo Thầy Cô để em học thêm được nhiều kinh nghiệm và sẽ hoàn thành tốt hơn trong đề
tài sắp tới.
Chúng tôi xin cam đoan đây là sản phẩm đồ án của riêng chúng tôi và được sự
hướng dẫn của Thầy Mai Duy Tân. Các nội dung nghiên cứu, kết quả trong đề tài này là
trung thực và chưa công bố dưới bất kỳ hình thức nào trước đây. Những số liệu trong các
bảng biểu phục vụ cho việc phân tích, nhận xét, đánh giá được chính tác giả thu thập từ
các nguồn khác nhau có ghi rõ trong phần tài liệu tham khảo.
Ngoài ra, trong đồ án còn sử dụng một số nhận xét, đánh giá cũng như số liệu của
các tác giả khác, cơ quan tổ chức khác đều có trích dẫn và chú thích nguồn gốc.
Nếu phát hiện có bất kỳ sự gian lận nào tôi xin hoàn toàn chịu trách nhiệm về
nội dung đồ án của mình. Trường đại học Tôn Đức Thắng không liên quan đến những
vi phạm tác quyền, bản quyền do tôi gây ra trong quá trình thực hiện.
Tác giả
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
____________________________________________
Tp. Hồ Chí Minh, ngày tháng năm 2021
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
____________________________________________
Tp. Hồ Chí Minh, ngày tháng năm 2021
Mục lục
1. Preparation:.......................................................................................................................................6
1.1. Format.........................................................................................................................................6
1.2. Contents.......................................................................................................................................6
1.3. List of References........................................................................................................................6
2. Content:..............................................................................................................................................7
Question 1...............................................................................................................................................7
Question 2...............................................................................................................................................7
Question 3...............................................................................................................................................7
Question 4. .............................................................................................................................................8
Question 5. .............................................................................................................................................8
Question 6...............................................................................................................................................9
Question 7. ...........................................................................................................................................10
SELF-EVALUATION FORM................................................................................................................11
COMBINATORICS AND GRAPH THEORY
Question 2. Write a python program to generate a random number between 1 and 10 then ask the
user to guess the number and print a message based on whether they get it right or not.
#ques2
import random
n = random.randint(1,10)
i = int(input("Nhap vao: "))
if i == n:
print("ban dung")
else:
print("sai")
print("so dung la:",n)
Question 3. Given username=Anna and password=190111. Write a python program to check the
validity of a username and password given by the user.
#ques3
name = input("what is ur name?")
pas = input("what is ur password ?")
if name == "Anna" and pas == "190111":
print("welcome Anna")
else:
print("erro")
COMBINATORICS AND GRAPH THEORY
Question 4. Write a python program to print all combinations size 2 of (1; 2; 3; 4; 5).
#ques4
from itertools import combinations
comb = list(combinations([1,2,3,4,5],2))
for i in list(comb):
print(i)
print(len(comb))
22 5 32 4
A ,B
Question 5. Let 4 m 7 6 , where m is the last 2 digits of your student ID. For
22 5
A
example, if your student ID is 51900754 then a valid matrix is 4 54 . Calculate the
following using python
a. 57 A 2 B
b. 2 A 19 B
c. A8
#ques5
My ID is: 517H0102 so m is 02.
import numpy
a = numpy.array([[22,5],[4,2]])
b = numpy.array([[32,4],[7,6]])
#5a
print(numpy.add(57*a,2*b))
#5b
print(numpy.subtract(2*a,19*b))
#5c
print(numpy.linalg.matrix_power(a,8))
COMBINATORICS AND GRAPH THEORY
#ques6
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_edge('A','B', weight=5)
G.add_edge('A','C',weight=5)
G.add_edge('A','E',weight=5)
G.add_edge('B','D',weight=3)
G.add_edge('C','E',weight=6)
G.add_edge('C','D',weight=4)
#6a
nx.draw(G, with_labels = True)
plt.show()
#6b
print(nx.shortest_path(G,'A','D', weight='weight'))
COMBINATORICS AND GRAPH THEORY
#ques7
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_edge('1','2', weight=2)
G.add_edge('1','4',weight=5)
G.add_edge('2','4',weight=5)
G.add_edge('2','3',weight=14)
G.add_edge('2','5',weight=4)
G.add_edge('3','5',weight=34)
G.add_edge('4','5',weight=58)
#7a
nx.draw(G, , with_labels = True)
plt.show()
#7b
print(nx.shortest_path(G,'1','5', weight='weight'))
COMBINATORICS AND GRAPH THEORY
SELF-EVALUATION FORM
You need to evaluate your self according to the below form. This self reference only,
your final result may not equal this result.
Please evaluate yourself in the "Self-evaluation" column. If the score of a requirement
is low, students should state the reason in the column “Reason(s)”, for example not
understanding the goal, not having enough time, not being able to do it, and not being
interested.
Requirements Score/10 Level 1 Level 2 Level 3 Self- Reason(s)
0 score 1/2 score Full score evaluation
In right format 1.0 Wrong Some errors. In right 0.5
format. format and
and outlines,
outlines. no error.
Question 1 1.0 No Partial Fully 1.0
content. answered, answered,
some errors. no error.
Question 2 1.0 No Partial Fully 1.0
content. answered, answered,
some errors. no error.
Question 3 1.0 No Correct Fully 1.0
content. augemented answered,
matrix no error.
Question 4 1.0 No Partial Fully 1.0
content. answered, answered,
some errors. no error.
Question 5 3.0 No Partial Fully 1.0
content. answered, answered,
some errors. no error.
Question 6 1.0 No Partial Fully 1.0
content. answered, answered,
correct no error.
formulas.
Question 7 1.0 No Partial Fully 1.0
content. answered, answered,
correct no error.
formulas.
Total 10.0 Result 9.5