You are on page 1of 12

TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM

TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG


KHOA CÔNG NGHỆ THÔNG TIN

BÁO CÁO CUỐI KÌ MÔN

TOÁN TỔ HỢP VÀ ĐỒ THỊ

BÁO CÁO CUỐI KỲ


TOÁN TỔ HỢP VÀ ĐỒ THỊ

Người hướng dẫn: Thầy Mai Duy Tân

Người thực hiện: NGUYỄN THUẬN CƯỜNG – 517H0102

Lớp : 17050310

Khoá : 21

THÀNH PHỐ HỒ CHÍ MINH, NĂM 2021


TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM
TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG
KHOA CÔNG NGHỆ THÔNG TIN

BÁO CÁO CUỐI KÌ MÔN

TOÁN TỔ HỢP VÀ ĐỒ THỊ

BÁO CÁO CUỐI KỲ


TOÁN TỔ HỢP VÀ ĐỒ THỊ

Người hướng dẫn: Thầy Mai Duy Tân

Người thực hiện: NGUYỄN THUẬN CƯỜNG – 517H0102

Lớp : 17050310

Khoá : 21

THÀNH PHỐ HỒ CHÍ MINH, NĂM 2021


COMBINATORICS AND GRAPH THEORY

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.

Xin chân thành cảm ơn.


COMBINATORICS AND GRAPH THEORY

BÁO CÁO ĐƯỢC HOÀN THÀNH


TẠI TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG

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.

TP. Hồ Chí Minh, ngày tháng năm 2021

Tác giả

Nguyễn Thuận Cường


COMBINATORICS AND GRAPH THEORY

PHẦN XÁC NHẬN VÀ ĐÁNH GIÁ CỦA GIẢNG VIÊN

Phần xác nhận của GV hướng dẫn

__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
____________________________________________
Tp. Hồ Chí Minh, ngày tháng năm 2021

(ký và ghi họ tên)

Phần đánh giá của GV chấm bài

__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
____________________________________________
Tp. Hồ Chí Minh, ngày tháng năm 2021

(ký và ghi họ tên)


COMBINATORICS AND GRAPH THEORY

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

REPORT ASSIGNMENT OF COMBINATORICS AND GRAPH THEORY


1. Preparation:
1.1. Format
- The dimension of the report should be in A4 size.
- Single spacing should be used for typing the general text. The general text shall be
typed in the Font style “Times New Roman” and Font size 12.
- Top edge: 35 mm
- Bottom edge: 30 mm
- Left side: 40 mm
- Right side: 25 mm
1.2. Contents
- Cover Page & Title Page
- Acknowledgement
- Table of Contents
- List of Symbols, Abbreviations and Nomenclature
- List of Tables
- List of Figures
- Abstract
- Contents
- List of References
- Table and figures
1.3. List of References
The listing of references should be typed 4 spaces below the heading “REFERENCES”
in alphabetical order in single spacing left – justified. The reference material should be
listed in the alphabetical order of the first author. The name of the author/authors should
be immediately followed by the year and other details. A typical illustrative list given
below.
REFERENCES
1. Ariponnammal, S. and Natarajan, S. (1994) „ Transport Phonomena of Sm Sel – X
Asx‟, Pramana – Journal of Physics Vol.42, No.1, pp.421-425.
2. Barnard, R.W. and Kellogg, C. (1980) „ Applications of Convolution Operators to
Problems in Univalent Function Theory‟, Michigan Mach, J., Vol.27, pp.81–94.
3. Shin, K.G. and Mckay, N.D. (1984) „Open Loop Minimum Time Control of
Mechanical Manipulations and its Applications‟, Proc.Amer.Contr.Conf., San Diego,
CA, pp. 1231-1236.
COMBINATORICS AND GRAPH THEORY

2. Content: Answer the following questions.


Question 1. Write a python program that asks the user to enter a length in kilometer. If the user
enters a negative length, the program should tell the user that the entry is invalid. Otherwise, the
program should convert the length to meter and print out the result. There are 1000 meters in a
kilometer.
#ques1
kg = int(input("Enter weight in kilogram: "))
if kg < 0:
  print("invalid entry")
else:
  print(kg*1000,"gram")

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

Question 6. Given the graph

Write python programs to


a. Redraw the graph (no need to display the weights).
b. Find shortest path from A to D.

#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

Question 7. Given the graph

Write python programs to


a. Redraw the graph (no need to display the weights).
b. Find shortest path from 1 to 5.

#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

You might also like