计算机程序集合,所有计算机程序组成的集合是可列的(可数的)

这篇博客探讨了如何证明特定编程语言中所有计算机程序的集合是可数的。通过将程序视为有限字母表上的字符串,并利用数学定理(如并集的可数性和 Cantor-Bernstein 定理),可以展示长度为 n 的字符串集合 An 是可数的,进而推导出所有字符串集合 S 也是可数的。此外,还证明了可数集合的子集同样可数,从而得出结论,任何编程语言的程序集都是可数无限的。
摘要由CSDN通过智能技术生成

Show that the set of all computer programs

in any particular programming language is countable.

This can be proved by noting that a computer programs in a

particular language can be thought of as a string of characters

from a finite alphabet.

Theorem 1:

If A and B are countable sets, then A ∪ B is also countable.

Theorem 2: Cantor-Bernstein Theorem

If A and B are sets with |A| ≤ |B| and |B| ≤ |A|, then |A| =

|B|.

Call the set of strings of length n, where n ≥ 0, An.

For any finite alphabet, An is finite and therefore countable.

The set of all strings over the alphabet is S = A0 ∪ A1 ∪ A2 ∪ ..., which is a union of a

countable number of countable sets.

We can see that the number of sets is countable by simply

mapping An to its

corresponding n.

Hence S is also countable.

Now we need to prove that the subset of a countable set is

countable.

Lemma: If B is a subset of a countable set A, then B is also

countable.

If A is a finite set, then we are finished, since |B|≤|A|. If A

is countable infinite, then we know we can list the elements of A

in some way such that A = {a1,

a2, a3, ..., an}, where n∈N.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值