# 【编程起跑线】09 数学

> 虽然说编程中用到的数学都不算特别复杂，但是在具体的实现中，还是有一些技巧和门道的。

- 作者：[小土刀](https://wdxtub.com/about)
- 发布日期：2016-01-23
- 更新日期：2019-08-05
- 原文（引用请使用此链接）：https://wdxtub.com/blog/psl/psl-09
- 所属系列：psl 编程起跑线
- 标签：数学、编程起跑线
- 许可：CC BY-NC-SA 4.0（https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh）
- 正文中的站内图片路径以 https://wdxtub.com 为根目录。

---

虽然说编程中用到的数学都不算特别复杂，但是在具体的实现中，还是有一些技巧和门道的。

---

## 更新历史

+ 2019.08.05：编入新系列
+ 2016.01.23：完成初稿

## 解题策略

数学的问题，比较突出的体现在，一些常见的数学形式，比方说：

+ 排列
+ 组合
+ 质数
+ 开方
+ 幂次

还有一些概率的问题，需要一定的概率基础，这里就不再赘述了。具体更多可以参考题目。

最后一类是脑筋急转弯问题，也就是看脑洞的，这个就随缘了。

（这一章实在没啥好写的，数学这个东西，懂就是懂，不懂就是不懂，还真没太多技巧）

## 附录

+ [Kth Permuation](/blog/interview/kth-permuation)
+ [Check Permutation](/blog/interview/check-permutation)
+ [Nth Prime](/blog/interview/nth-prime)
+ [Pow(x, n)](/blog/interview/pow-x-n)
+ [Combinations](/blog/interview/combinations)
+ [All Permutation](/blog/interview/all-permutation)
+ [All Permutations II](/blog/interview/all-permutations-ii)
+ [Sqrt(x)](/blog/interview/sqrt-x)
+ [Remove Digit](/blog/interview/remove-digit)
+ [Quick Pow](/blog/interview/quick-pow)
+ [Previous Permuation](/blog/interview/previous-permuation)
+ [Poison](/blog/interview/poison)
+ [Permutation Sequence](/blog/interview/permutation-sequence)
+ [Perfect Squares](/blog/interview/perfect-squares)
+ [Number of Digit](/blog/interview/number-of-digit)
+ [Number of Digit One](/blog/interview/number-of-digit-one)
+ [Next Permutation](/blog/interview/next-permutation)
+ [Max Points on a Line](/blog/interview/max-points-on-a-line)
+ [Jugs of Water](/blog/interview/jugs-of-water)
+ [Index of Permuation](/blog/interview/index-of-permuation)
+ [Index of Permutation II](/blog/interview/index-of-permutation-ii)
+ [The Heavy Pill](/blog/interview/the-heavy-pill)
+ [Hash Function](/blog/interview/hash-function)
+ [Happy Number](/blog/interview/happy-number)
+ [Fraction to Recurring Decimal](/blog/interview/fraction-to-recurring-decimal)
+ [Factorial Trailing Zeroes](/blog/interview/factorial-trailing-zeroes)
+ [The Egg Drop Problem](/blog/interview/the-egg-drop-problem)
+ [Divide Number](/blog/interview/divide-number)
+ [均分 01](/blog/interview/均分-01)
+ [Count Primes](/blog/interview/count-primes)
+ [Cosine Similarity](/blog/interview/cosine-similarity)
+ [Basketball](/blog/interview/basketball)
+ [The Apocalypse](/blog/interview/the-apocalypse)
+ [Ants on a Triangle](/blog/interview/ants-on-a-triangle)
+ [Add Digits](/blog/interview/add-digits)
+ [100 Lockers](/blog/interview/100-lockers)

