离散数学入门级概念:集合、关系、元组相关问题

 

申明: 本博客内容为课程作业应答,理解上不一定正确,如您恰好看到该文档,请适量参考!作者对答案的正确性不负任何责任!


习题 1.1:{ 0 , 1 , { 0 , 1 } , { 1 , 2 } }有几个元素? 机器学习中, 这类形式的集合有什么优点和缺点?

  • 以逗号为分割,本集合共有4个元素,分别是数字0、数字1、集合{0,1}、集合{1,2};
  • 个人理解,在机器学习中,此类集合扩大了传统集合的定义约束,能够更宽泛地将多个类别的数据放到同一个集合中;同时,对于固定的输入参数如X,Y等,能够通过重组变形如X^2, XY等将更多参数带入学习网络,其为机器学习及输入等带来了新的入参及为网络训练提供更多支撑;能扩大网络分析问题的能力。缺点在于,多类型数据及重组可能带来信息的冗余,也为问题解决实现带来了一定的复杂度。

习题 1.2: ∅ 的基数是多少? { ∅ }呢?

  •  空集∅,由于集合是空的,集合内不存在任何元素,所以其基数(集合内元素个数)是 0
  • { ∅ } 表示一个只包含空集的集合,集合内有一个元素是∅,所以其基数是1。 

习题 1.3: 多标签学习中, 输出为一个向量,相应的学习器算不算函数呢? 

  •  个人理解,多标签学习是指,类似输入一张图片,然后输出该图片中所包含元素的标签,比如输入以下图片,则学习器能返回类似大海,大树,树根,地面,浪花,天空等标签。则对应某一个训练状态的学习器,同一个输入图片,学习器会返回一个表示各种标签的向量,而该向量所包含的信息应该是一定的,即对于同一个学习器,一个输入,只会对于一个输出。这符合函数的定义,所以学习器属于广义范围内的函数

习题 1.4: 元组只能表达对象的数据部分, 还是可以完整地表达? 用一个具体的程序来说明. 

  •  万事万物皆对象,所以如果想要封装一定的东西,都应该能通过一定的方式形成一个具体的类,类中可以包含其后续实例的数据部分,也可以涵盖实例对象所涉及的操作。
  • 在程序设计中,元组应该可以封装成一个类,不仅能表示实例对象的数据部分,也可以涵盖其相关的任何操作。如一个操作动作(方法),或者是不同对象间的泛化,包含或依赖关系。
// 以门上有锁为例,简单展示
public class Door{
    private float len; // 长,此处演示对象数据
    private float width; // 宽
    private float height; // 高
    
    private DoorLock lock; // 门上的锁, 此处演示包含其他对象
    
    /*
     * 给门换一把锁,此处演示对象相关操作
     */ 
    public void resetDoorLock(){
        // todo
    }
 
    // ……
}
 
public class DoorLock {
    private String brand; // 品牌
    private String model; // 型号
    private int secLevel; // 安全等级
    private int lockType; // 锁类型  
    
    // ……
}

习题 1.5: 定义二叉树. 

直接引用老师的最新定义:https://blog.csdn.net/minfanphd/article/details/116582678

习题 1.6: 定义带权无向图. 

 Definition . A weighted undirected graph is a tuple Gu=(V,E), where  {V} = \{v_1, \dots, v_n\} is the set of nodes, and \mathbf{E} : V x V \rightarrow R+∪{0}  is the edge weight function satisfying:

< v_j, v_i> \in \mathbf {E}  iff   < v_i, v_j> \in \mathbf{E}. and E\left ( v_i,v_j \right ) = E\left ( v_j,v_i \right )

习题 2.1(习题9):考虑 \phi , 重新写 Definition 7 以解决其存在的问题, 见其讨论 d).

 Definition . A  tree is a triple T = (\mathbf{V}, r, p), where \mathbf{V} = \{v_1, \dots, v_n\} is the set of nodes, r \in \mathbf{V} is the root, and p: \mathbf{V} \setminus \{r\} \rightarrow \mathbf{V} is the parent function satisfying:
a) \forall k \geq 1, p^k(v) \neq v , and
b) \forall v \in \mathbf{V} \setminus \{r\}, \exists 1 k \geq 1, st. p^k(v) = r.

c) especially, when \mathbf{V} = \phi , T = (\mathbf{\phi}, \dots) is a speciall tree.

习题 3.1 模仿自动机的样子来重新定义二叉树.

A binary tree is a 5-tuple M = (\Sigma, \mathbf{V}, \mathbf{r}_0, \mathbf{T}, f), where
a) \Sigma = \{l,r\} is the alphabet, represents the left and right child node;
b) \mathbf{V} is the set of nodes ;
c) \mathbf {r}_0 \in \mathbf{V} is the root of the tree;
d) T= \{\phi\} is the set of terminal states;
e)  f: \mathbf{V} \cup \{\phi\} \times \Sigma \to \mathbf{V} \cup \{\phi\} is the transition function.
Any  s \in \Sigma^* is accepted by this automata iff  f(\mathbf{r}_0, s) \in \mathbf{T} and for the node that the path passes through, no node \mathbf {v} \in \mathbf{V} appears twice.

习题3.2 模仿自动机的样子来重新定义树. 

 A tree is a 5-tuple M = (\Sigma, \mathbf{V}, \mathbf{r}_0, \mathbf{T}, f), where
a) \Sigma = \{c\} is the alphabet, represents the one child node;
b) \mathbf{V} is the set of nodes ;
c) \mathbf {r}_0 \in \mathbf{V} is the root of the tree;
d) T= \{\phi\} is the set of terminal states;
e)  f: \mathbf{V} \cup \{\phi\} \times \Sigma \to \mathbf{V} \cup \{\phi\} is the transition function.
Any  s \in \Sigma^* is accepted by this automata iff  f(\mathbf{r}_0, s) \in \mathbf{T} and for the node that the path passes through, no node \mathbf {v} \in \mathbf{V} appears twice.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值