puzzle Computer Science

3 个科学问题 · 计算机 Computer Science

本页目录

柯尼斯堡七桥问题对图论有什么启示?

What did the Seven Bridges of Königsberg teach graph theory?

欧拉证明:要一次不重复地走完所有桥,图中最多只能有两个奇度顶点。这个问题把“能不能走通”抽象成顶点与边的图,标志着图论的诞生,也引出了一笔画(欧拉路径)的判断准则。
Euler showed a route crossing every bridge once needs at most two odd-degree vertices. Abstracting 'can we walk it' into vertices and edges birthed graph theory and the rule for Eulerian paths.
难度 进阶 · 适合 大众 CC BY 4.0 · 已核验 · Verified 2026-10-03 · 2 条独立证据
来源 · Source

《什么是数学》(柯朗)(拓扑章:柯尼斯堡七桥)

What Is Mathematics? (Courant), topology (Königsberg bridges)

#七桥 #图论

为什么电脑里一切都只用 0 和 1?

Why does everything in a computer use only 0 and 1?

因为硬件最易区分两种状态:电压高或低、磁极正或反、光通或断。用“开/关”两种状态来表示 0 和 1 最简单可靠,再把很多位组合起来,就能表示任意数字、文字和图像。
Hardware most easily tells two states apart: high/low voltage, north/south magnetism, on/off light. Representing 0 and 1 as 'off/on' is simplest and most reliable; stacking many bits encodes any number, text or image.
难度 入门 · 适合 小学低段(6-8) CC BY 4.0 · 已核验 · Verified 2026-10-03 · 2 条独立证据
来源 · Source

Charles Petzold & David Sullivan,《Code: The Hidden Language of Computer Hardware and Software》第2版,No Starch Press,2022

C. Petzold & D. Sullivan, Code: The Hidden Language of Computer Hardware and Software, 2nd ed., No Starch Press, 2022

#二进制 #硬件

为什么在电脑里算 0.1 + 0.2 不等于 0.3?

Why is 0.1 + 0.2 not equal to 0.3 in a computer?

电脑用二进制小数存储数字,而 0.1 和 0.2 在二进制里是无限循环的,只能近似保存,舍入误差让相加结果变成 0.30000000000000004 这样的数。这是浮点数表示的固有局限,不是 bug。
Computers store decimals in binary, where 0.1 and 0.2 are repeating fractions that get rounded, so the sum comes out as 0.30000000000000004. It's an inherent limit of floating-point, not a bug.
难度 入门 · 适合 小学低段(6-8) CC BY 4.0 · 已核验 · Verified 2026-08-23
来源 · Source

Charles Petzold,《Code: The Hidden Language of Computer Hardware and Software》第2版,Microsoft Press,2022

C. Petzold, Code, 2nd ed., Microsoft Press, 2022; Chinese ed.《编码》

#浮点 #精度