离散题你会做了吗?
注:不一定是今年考试题
2019年期末题库
填空题
- 设集合A={1,2,3}, B={2,4,6},则A-B= {1,3} 。
- 命题“每一种生物均是动物的否定是 存在一种生物不是动物 。
- 命题(5<7)V((9>6)→(6=6))的真值为 真(T) 。
- 若将否定联结词¬移到谓词的前面,则¬(∃x)P(x)⇔ (∀x)¬P(x) 。
- 如果有限集合A有n个元素,则其幂集P(A)有 2n 个元素。
- 对谓词公式(∃x)A(x)→B,将量词的作用域进行扩张,得到的等价式为 (∀x)(A(x)→B)。
- 连通图至少有 1颗生成树。
选择题
- 设P:李明有点愚钝,Q:李明用功,将命题“李明虽然有点愚钝但很用功。”符号化正确的是( D)。
A. ¬P∧¬Q
B. P∨Q
C. P→Q
D. P∧Q - 下列公式是重言式的是(D)。
A. (P∨¬Q)→Q
B. P→(Q∨R)
C. ¬(P→Q)∧Q
D. P→(P∨Q) - 下列结论中不正确的是( D)。
A. 树是连通的
B. 树是无回路的
C. 树是无向图
D. 树是有回路的 - 设A={1,2,3},A上二元关系S={<1,1>,<1,2>,< 3,2>,< 3,3>},则S是( C)。
A. 自反关系
B. 反自反关系
C. 传递关系
D. 对称关系 - 下列关于半群的说法正确的是( A)。
A. 运算是封闭的
B. 运算是可交换的
C. 有幺元
D. 有零元 - 下列结论中不正确的是( A)。
A. 任意简单有向图中,任意结点的入度等于出度
B. 任意简单有向图中,所有结点的入度之和等于边数
C. 任意简单有向图中,所有结点的度数之和等于边数的两倍
D. 任意简单有向图中,所有结点的入度之和等于出度之和 - 设R是集合X上的等价关系,则下列结论中不正确的是( D)。
A. R是自反的
B. R是对称的
C. R是传递的
D. R是反自反的
解答题
- 求命题公式Q∧(Q→P)的主析取范式。
Q | P | Q→P | Q∧(Q→P) |
---|---|---|---|
T | T | T | T |
T | F | F | F |
F | T | T | F |
F | F | T | F |
主合取范式:P∧Q |
- 构造命题公式¬P∨Q的真值表。
P | ¬P | Q | ¬P∨Q |
---|---|---|---|
T | F | T | T |
T | F | F | F |
F | T | T | T |
F | T | T | T |
-
设A={ x|x是book中的字母},B={x│x是black中的字母},求A∪B, A∩B。
A∪B={b,l,a,c,o,k}
A∩B={b,k} -
设A={a,b,c,d},R={<a,b>,<b,a>,<b,c>,<c,d>}是A上的关系。
(1)求R的自反闭包;
r( R)={<a,b>,<b,a>,<b,c>,<c,d>,<a,a>,<b,b>,<c,c>,<d,d>}
(2)求R的对称闭包;
s( R)={<a,b>,<b,a>,<b,c>,<c,d>,<c,b>,<d,c>}
(3)用Warshall算法求出R的传递闭包;
Warshall算法A:=MR=
[ 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 ] \left [ \begin {matrix} 0&1&0&0\\ 1&0&1&0\\ 0&0&0&1\\ 0&0&0&0 \end{matrix} \right] ⎣⎢⎢⎡0100100001000010⎦⎥⎥⎤
i=1时,A:= [ 0 1 0 0 1 1 1 0 0 0 0 1 0 0 0 0 ] \left [ \begin {matrix} 0&1&0&0\\ 1&1&1&0\\ 0&0&0&1\\ 0&0&0&0 \end{matrix} \right] ⎣⎢⎢⎡0100110001000010⎦⎥⎥⎤
i=2时,A:= [ 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 0 ] \left [ \begin {matrix} 1&1&1&0\\ 1&1&1&0\\ 0&0&0&1\\ 0&0&0&0 \end{matrix} \right] ⎣⎢⎢⎡1100110011000010⎦⎥⎥⎤
I=3时,A:= [ 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 ] \left [ \begin {matrix} 1&1&1&1\\ 1&1&1&1\\ 0&0&0&1\\ 0&0&0&0 \end{matrix} \right] ⎣⎢⎢⎡1100110011001110⎦⎥⎥⎤
i=4时,A:= [ 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 ] \left [ \begin {matrix} 1&1&1&1\\ 1&1&1&1\\ 0&0&0&1\\ 0&0&0&0 \end{matrix} \right] ⎣⎢⎢⎡1100110011001110⎦⎥⎥⎤
则t( R)={<a,a>,<a,b>,<a,c>,<a,d>,<b,a>,<b,b>,<b,c>,<b,d>,<c,d>} -
(1)画一个有一条欧拉回路和一条汉密尔顿回路的图;
(2)画一颗带有权1,3,4,5,6的最优二叉树。
证明题
-
在A中关系R定义为:<x,y>R<u,v>,当且仅当|x-y|=|u-v|。
证明:R是一个等价关系。
-
证明:(P∨Q)∧(P→R)∧(Q→S)⇒S∨R
2021年题库(2019级考试真题)
英文版试题翻译来的专业名词不太准确。
A部分(每题4分,共60分)
- 求下面两个数的最大公约数GCD(欧几里得算法)。
(219,33)
219/33=6…21
33/21=1…12
21/12=1…9
12/9=1…3
9/3=0
最大公约数是3 - 利用德摩根定律写出下面公式的等价公式:
¬(p∨q)
等价公式为: ¬p∧¬q - 对下列序列求t(3)和t(4)值:
t(1)=1, t(2)=-2
t(n)=3×t(n-1)-5×t(n-2)+10(n>2)
t(3)=3t(2)-5t(1)+10=-6-5+10=-1
t(4)=3t(3)-5t(2)+10=-3+10+10=17 - 完成以下二进制的运算:
101012×10012
10101 × 1001 10111101 \begin{array}{r} 10101\\ ×1001\\ \hline 10111101\\ \end{array} 10101×100110111101 - 分析判断下面给出的图,是欧拉图、半欧拉图或两者都不是
请写出欧拉回路或欧拉通路(如果存在)。
半欧拉图
欧拉通路:1、2、3、4、5、9、10、8、6、7、E - 请用谓词和量词逻辑符号写出下列命题,并确定它的真值。
存在一个实数x,使得x2+4=0
设P(x)为实数,Q(x) x2+4=0
∃xP(x)∧Q(x)
真值0 - 仿射密码提供了一个加密函数
f(x)=(3x+5) mod 26, x={1,2,…,26}
找到数字21的加密密码
f(21)=(3*21+5)%26=16 - 设p和q是介词。写出(p∨¬q)的真值表
p q ¬q p∨¬q 1 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 - 设函数定义如下
f: {-1,1,2,3,4} → {0,2,3,4,5}, f(x)=x+1
求f-1(4)的值
f-1(x)=x-1
f-1(4)=4-1=3 - 在BCD算法中执行以下计算:
487 + 332
0100 1000 0111 + 0011 0011 0010 0111 1011 1001 + 1 0110 1000 0001 1001 8 1 9 \begin{array}{r} 0100&1000&0111\\ +0011&0011&0010\\ \hline 0111&1011&1001\\ \hline +1&0110\\ \hline 1000&0001&1001\\ \hline 8&1&9 \end{array} 0100+00110111+11000810000011101101100001101110010100110019 - 证明偶数的平方是偶数。
设偶数t=2k
t2=2k×2k=4k2
4k2一定是偶数 - 一个IT经理有12台电脑。如果他一个办公室需要5个,他有多少种选择?
C 12 5 = 792 C_{12}^{5} =792 C125=792 - 描述一个完全图的定义。
无向完全图:对简单无向图,图中任意两个不同的定点件都有边。有n个顶点的无向完全图有n(n-1)/2条边
有向完全图:对简单有向图,任意两个顶点间都有方向互为相反的两条弧。有n个顶点的有向完全图有n(n-1)条弧 - 如果f是由f(x)=x+1定义的函数,g是g(x)=5的函数,那么求(gof)(x)。
(gof)(x)=f(g(x))=5+1=6 - 给出¬Q→P命题的逆命题和反命题。
反命题:Q→¬P
逆命题:P→¬Q
B部分(每题10分,共40分)
- (1)求9041的15位二进制表示。
010001101010001
(2)写出(a)中答案的补码。
010001101010001
(3)因此或其他方式找到-9041的16位表示
FFFFFFFFFFFFDCAF - (1)假设一棵树有16个顶点。这棵树有多少条边。
15
(2)绘制一个顶点具有流动度的树,或解释为什么不存在这样的树:
(a). 六个顶点,度数为1,1,1,2,2,3;
(b). 9个顶点,度数为1、2、2、2、2、2、2、2、3。
不能生成树,理由:略
3. (1)编写一个递归函数算法,以找到下列递归关系的项。
t (1) = 30
t (n) = 2 × t (n - 1) - 5 (n > 1)。
Begin
input n
int t(n)
if n == 1
return 30
return 2*t(n-1)-5
sum = n
output sum
end
由于所掌握的题库并不全,缺少3题一部分和4题
2021年题库(2019级考试真题)英文版,不附答案
Section A
- Find the greatest common divisor GCD(219, 33).
- Use De’ Morgan’s Law to write a logical equivalence of ¬(p∨q)
- Evaluate t(3) and t(4) for the sequence:
t(1)=1,t(2)=-2
t(n)=3×t(n-1)- 5×t(n- 2)+10(n>2) - Perform the following binary arithmetic:
101012 × 10012 - Classify the graph given in each figure below is Eulerian, semi-Eulerian, or neither. Write the Eulerian circuit or Eulerian path if any exists.
- Write the following proposition symbolically in the notation of quantifying and predicate logic. Determine its truth value.
‘There exists a real number x such that x2 +4=0.’。 - An encryption function is provided by an affine cipher
f:X→X,f(x)=(3x+5)mod 26, X={1,2…,26}
Find the encryption code for the numbers 21. - Let p and q be prepositions. Write a truth table for (p∨¬q).
- Let the function f be defined as follows:
f: {-1,1,2,3,4}→{0,2,3,4,5},f(x) =x+1
Find the value of f-1(4). - Perform the following calculations in BCD arithmetic:
487 + 332. - Prove that square of an even number is even.
- An IT manager got 12 computers. If he needs 5 of them for an office, how many ways he
can choose them? - Describe the definition of a Complete graph.
- If f is a function defined by f(x)=x+1 and g is a function such that g(x)=5, then find (fog)(x).
- Give the converse and the contrapositive of the statement(¬q→p)
Section B
- ( a ) Find the binary representation of 9041 in 15-bits.
( b ) Write the 2’s complement of the answer in ( a ).
( c ) Hence or otherwise find the 16-bits representation of -9041. - ( i ) Suppose there are 16 vertices in a tree. How many edges this tree can have.
( ii )Draw a tree whose vertices have the following degrees, or explain why no
Such tree exists:
( a ) six vertices, with degrees 1,1,1,2,2,3;
( b ) Nine vertices, with degrees 1,2,2,2,2,2,2,2,3. - ( i ) Write a recursive Function algorithm to find the terms of following recurrence relation.
t(1)=3
t(n)=2×t(n-1)-5 (n>1)