生活 | 学习是款值得购入的游戏

把学习想成游戏是非常常见的营销号想法,但在本篇文章中,学习要被看成游戏,有一个严格的条件,我后面会讲这个条件。

先不考虑这个条件,学习因为满足以下要求,可以被看成一款游戏:

  • ??? (最重要的条件,但经常被忽视,后面再讲)
  • 规则:作弊者会有被惩罚的风险(通常而言会被惩罚)
  • 挑战:有些学科学起来很难
  • 反馈:考试会改变你的 rk
  • 互动:因为你的学习你才真正学到东西
  • 冲突:你的对手 rk 高,你 rk 就更低
  • 激励:你 rk 高的时候能享受更好看的粒子效果
  • 进度:先学微积分才能学 AI
  • 随机:即使你努力了,你的 rk 可能还是会掉
  • 社交:你可以和你的舍友开 impart 或者一起内卷
  • 画质:比游戏还刺激!

然而,没了第一条,学习就和坐牢等效了。事实上,坐牢也满足后面的全部要求。

第一条是「动机」。

性质

动机对任何人类来说都是必要的,但方式不同。假设有人让你学数学,你可能想知道:

  • 选项一:数学如何帮助你实现 AI
  • 选项二:数学如何内部一致地解释生活中的事物

曾有大学课程从「线性代数」改名为「AI 基础」,吸引了不少选项一的人。我认为这就是很好的使用「动机」的实践。

然而,在大约 90% 的教育实践中,动机都被忽略了。不过作为学习者,我们有自己的方式找到我们所需要的动机。

开始之前,有些关于动机的误解需要澄清。

误解

动机是静态的

任何联系都有其条件,也包括动机。例如,我的算法老师经常在课上提到有人通过算法获取巨额利润的例子,来尝试激励我们学习算法。但这样的动机对我们大部分人都无效,因为这个动机给人一种 90 年代的感觉,我们也倾向于不相信我们能够做到。

我认为,「用 143 行搓出一个自己的编程语言」对于选项一的人来说是个良好的动机,因为它满足以下要求:

  • 可实现:143 行看起来并不多
  • 新鲜:你在市面上很少能看到这样的教程
  • 有想象空间:你可以把语言扩展成想要的样子

上面关于金钱的动机只能满足「可扩展」这个要求。

动机是通用的

有些教师倾向于认为动机是通用的。例如,之前我的某个老师认为所有学生都想要更高的排名,但这显然是错误的。

事实上,不可能形成一个能吸引所有人的动机。

在教学的时候,更适合先想一个能吸引约 30% 的人的动机,然后明确、坚持使用这个动机。浪费剩下 70% 的人的时间是极其不道德和低效的。

自学的时候,你可能更希望有个专为你定制的动机,这样的动机通常可以比教育目的的动机更明确,效果也会更好。找一个你愿意终生追求的动机,比你想象的更难,也能带来更多力量。

找到你的动机

如今,高质量的教学资源可以被公开访问,可能只有一处不完美的地方:它们通常缺乏一个好的动机。解决之理论上可以极大地提高你的学习能力(如果你想的话)。

假设你需要学习概率论。

询问 ChatGPT

一个可能的问题是:

What practical project can I make after learning Probability Theory? I already learnt Python, please avoid involving new prerequisites in the project.

ChatGPT 回答:

After learning Probability Theory and having Python skills, there are several practical projects you can undertake to apply your knowledge. Here are a few project ideas that don’t require new prerequisites:

  • Dice Roll Simulator: Create a Python program that simulates rolling dice. You can calculate and visualize the probabilities of different outcomes for various types of dice, such as 6-sided, 10-sided, or even customized dice.

  • Coin Toss Probability Calculator: Build a tool that calculates the probabilities of getting heads or tails when flipping a coin a certain number of times. You can also add features to simulate multiple coin flips and visualize the outcomes.

  • Card Game Simulator: Develop a program that simulates card games like Poker or Blackjack. You can use probability theory to calculate the odds of winning or achieving specific hands. Implement a simple AI opponent for added complexity.

  • Monte Carlo Simulation: Use Monte Carlo simulations to estimate probabilities in various scenarios. For example, you can estimate the value of π by simulating random points within a circle inscribed in a square.

  • Stock Price Prediction: Apply probability theory to model and predict stock price movements. You can use historical data and methods like Brownian motion to create a basic stock price prediction model.

  • Weather Forecasting: Build a simple weather forecasting tool that uses historical weather data and probability distributions to make short-term weather predictions for a specific location.

  • Game of Chance: Create a simple game of chance, such as a casino-style game, and calculate the house edge and expected outcomes for players. This project will involve probability calculations for various game scenarios.

  • Random Password Generator: Develop a password generator that creates secure and random passwords based on user-defined parameters. You can use probability distributions to ensure password randomness.

  • A/B Testing Analysis: Analyze the results of an A/B test using probability theory. Calculate statistical significance and confidence intervals to determine the effectiveness of changes made to a website or application.

  • Sports Statistics Analyzer: Analyze sports statistics and apply probability theory to predict the outcomes of sports events. You can create a tool that provides win-loss predictions for upcoming games based on historical data.

These projects will help you reinforce your understanding of probability theory while applying your Python skills to real-world scenarios. Choose a project that interests you the most and aligns with your goals and preferences.

你可以从中找个有趣的,找到之后可以向 ChatGPT 询问细节。比如我想了解卡牌游戏模拟器,我可以这样问:

I’m particularly interested in Card Game Simulator. How can I build a minimal version of it, and what probability knowledge will it involve?

ChatGPT 的回复中有一堆代码,但本质上只是个模拟器(但它的名字就是模拟器……),而不是一个用到概率论知识的预测器。要想设计概率论知识,你可以尝试:

How can I implement a predicting model? Please annotate the probability knowledge used.

ChatGPT 提供了一些代码,相关的地方是:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def basic_strategy_predict(player_hand, dealer_upcard):
# Basic strategy: Make decisions (hit or stand) based on the player's hand and the dealer's upcard.

player_value = calculate_hand_value(player_hand)

# Probability knowledge: The likelihood of busting when hitting
# If the player's hand value is 11 or less, it's always safe to hit.
if player_value <= 11:
return 'hit'

# If the player's hand value is 12 to 16 and the dealer's upcard is 7 or higher,
# hitting is the safer choice because the player's chances of beating the dealer are low.
if 12 <= player_value <= 16 and dealer_upcard in ['7', '8', '9', '10', 'Ace']:
return 'hit'

# If the player's hand value is 17 or higher, standing is generally the safer choice.
return 'stand'

但这个看起来太简单了,你希望遇到一些从未学过的概率论知识。

Can you implement something that uses advanced probability knowledge? Some calculus is preferred.

ChatGPT 回复:

Implementing a card game predictor that uses more advanced probability knowledge, particularly involving calculus, can be quite challenging. While the basic strategy model we discussed earlier is suitable for most practical purposes, incorporating advanced calculus-based probabilities can be an overkill for a game like Blackjack. However, I can introduce you to a concept called “card counting,” which involves tracking the composition of the remaining deck to make more informed decisions. This method doesn’t directly use calculus but relies on statistical probability concepts.

这说明这段对话寄了。你可以重试直到获取想要的答案。如果你能知道你想学的具体东西是什么(例如蒙特卡洛模拟、贝叶斯原理)的话,把这些加入到你的问题中可以提高你获得预期答案的概率。

然而,你可能会感觉这样的重试过程比较烦。下面是个更好的方法。

询问他人

显然很多人之前学过概率论,然后最后发现概率论有用。你可以问一些人,「如果没有概率论,你的生活会有什么改变?」,如果有一些比较震撼的答案(例如没有概率论,就处理不了先验分布和后验分布,我的 AI 就做不成了),你可能会更有动机一些。

这个方法成本比 ChatGPT 方法高(对于部分人来说,比如我),所以我没有提供任何例子。下面我将介绍我能想到的最好方法(至少对我好)。

预见

这个方法很简单:直接尝试做你想做的事情(即使大概率超出能力范畴),看缺失了什么知识,然后填补这些知识。

这看起来很天真,但实际上能直接秒了没有动机的问题!这是因为在传统的学习方式中,你先决定学什么,再根据学到的知识决定做什么,这是非常动机不良的。在预见式学习中,你先决定做什么,再根据尝试做的时候遇到的困难决定学什么!

不过这种方式说起来容易,做起来难,这也是为什么大部分人没有采用这种方案。大部分人会希望有个真实意义上的老师教他们知识,因为自主学习也会引入学习资料不足和自律系统弱的问题。

我最近在尝试实现绷语言,来以更符合直觉、更可访问的方式呈现算法竞赛的知识,但冰冻三尺非一日之寒。目前而言,预见式学习并不是对所有人都有效,由此看出找动机是「没有银弹」的。

结论

若能使用上述任意一种方法解决缺乏动机的问题,学习就可以成为一款值得购入的游戏。目前,大家可能需要自己想办法解决,但如果以后人人都能轻松获取动机的话,就更好了。