Divide and Conquer — not simply "breaking a big problem into small ones." Subproblems must be structurally isomorphic to the original AND relatively independent. Only when both hold does recursion truly reduce complexity. The Master Theorem makes this precise: if the merge cost dominates the subproblem cost, divide-and-conquer doesn't pay. The dominant failure mode is "pseudo-divide": subproblems share state or call back into each other, so you only moved the complexity around. Diagnostic: can two subproblems be solved by two people in two rooms without talking? If no, the boundary is wrong. The earliest symptom of pseudo-divide is exponential growth in coordination meetings — redraw boundaries, don't schedule more syncs.
AI Prompts
中文提示词
我正在用分治法处理 [问题/项目],拆分为子问题 [子问题1, 子问题2, ...]。请压力测试:
① 这些子问题是否真正"结构同构 + 相对独立"?标出最可能耦合的两条暗线;
② 估计"合并步骤"的成本——它是否会吞掉分治带来的并行收益?
③ 如果检测到伪分治,给出 1 个重画子问题边界的方案。
English Prompt
I'm applying divide-and-conquer to [problem/project], split into subproblems [sub1, sub2, ...]. Stress-test me:
1. Are these subproblems truly "structurally isomorphic + relatively independent"? Flag the two most likely hidden couplings.
2. Estimate the merge-step cost — will it eat the parallelism gain?
3. If you detect pseudo-divide, propose one re-partition that makes subproblems genuinely independent.
动态规划与记忆化 · Dynamic Programming & Memoization
"Those who cannot remember the past are condemned to recompute it." — paraphrasing Santayana
Dynamic Programming & Memoization — the surface story is "trade space for time." The real requirement is two simultaneous properties: overlapping subproblems + optimal substructure. Miss either and DP collapses into ordinary recursion or greedy. The critical lever is state definition: get it wrong and even a clever transition can't save you — you'll hit state-space explosion. Top-down memoization is lazy and closer to natural thinking; bottom-up tabulation is eager and more controllable. Non-trivial trap: most life problems aren't DP problems — they lack optimal substructure (environments drift, you don't revisit identical states). Misapplying DP to life means polishing answers to obsolete past states, locking yourself into path dependence. When the problem's distribution shifts, the table expires; healthy practice is dating every cache entry and rebuilding periodically.
AI Prompts
中文提示词
我想用 DP / 记忆化加速 [问题/工作流]。请帮我评估:
① 这个问题是否真同时满足"重叠子问题 + 最优子结构"?若缺其一,明确指出;
② 如果适用 DP,给出 1 个最简洁的状态定义,并估算状态空间维度——超 3 维则给压维建议;
③ 提示哪些子结果不应被缓存(环境漂移、分布外、一次性事件)。
English Prompt
I want to apply DP / memoization to [problem/workflow]. Please evaluate:
1. Does this problem truly satisfy both "overlapping subproblems" AND "optimal substructure"? If either is missing, name it explicitly.
2. If DP applies, propose the most parsimonious state definition and estimate the state-space dimensionality — if > 3 dimensions, suggest how to compress.
3. Flag which sub-results should not be cached (distribution drift, one-off events, out-of-distribution inputs).
贪心算法与局部最优陷阱 · Greedy & Local Optima Trap
"Each step looks optimal — and that's exactly why you're stuck on the wrong hill."
① 职业选择:每年都跳"涨薪最快的下一份工作" = 经典贪心。但职业函数没有 matroid 结构——做 3 年管理岗,技术深度就钝化;做 3 年纯技术,管理通道就关闭。每步局部最优会把你稳稳锁在一个"小山顶"。② 应对:刻意"模拟退火"——接受一次薪水暂降但能力维度跃迁的机会(如转 AI 方向、出国、创业),换跳出局部最优的可能。③ 育儿:每天用"她最不闹"的方式(看动画、买玩具)哄孩子 = 贪心。会贪到一个"她永远逃避难事"的局部最优。短期不舒服的"陪她搞难任务",是育儿版的模拟退火。④ AI 时代的非平凡推论:大模型本身就是个超级贪心机器——逐 token 采样每步选概率最高,正是为什么需要 beam search、temperature、长上下文规划等机制来对抗局部最优。
English Summary
Greedy & Local Optima — pick the locally best move at every step. Tempting because it's simple and often "good enough." But strictly optimal only on problems with matroid structure; most real problems aren't matroids. Greedy reliably ships you to the nearest hilltop — which is rarely the highest peak. Escapes: simulated annealing (allow occasional descent), beam search (keep K candidates), random restart. All three share one move: tolerate temporary worsening. Distinct from sunk-cost: sunk-cost is blindness to the past; greedy local optima is blindness to the far. Non-trivial AI corollary: large language models are themselves greedy machines — token-by-token sampling of the highest-probability next move — which is exactly why beam search, temperature, and long-horizon planning exist as countermeasures.
AI Prompts
中文提示词
我目前在 [领域/决策] 上的策略是 [描述当前每步如何选]。请诊断:
① 我是不是在用贪心?这个问题有没有 matroid 结构能保证贪心最优?
② 我可能被困在哪个局部最优峰?远处更高的"全局峰"长什么样?
③ 设计一次具体的"模拟退火"动作——允许哪段暂时下降,换取怎样的跨峰机会。
English Prompt
My current strategy in [domain/decision] is [describe how I pick each step]. Diagnose:
1. Am I running a greedy algorithm? Does this problem have matroid structure that guarantees greedy is optimal?
2. Which local-optimum hill am I likely stuck on? What does a higher global peak look like from afar?
3. Design one concrete "simulated-annealing" move — which temporary descent to accept, and which cross-peak opportunity it buys.
启发式与近似 · Heuristics & Approximation
"Perfect is the enemy of good — and in NP-hard problems, perfect doesn't even exist in your lifetime."
Heuristics & Approximation — when a problem is provably NP-hard, the optimum is unreachable in any practical sense, so you trade optimality for tractability. The trade has structure: good heuristics carry approximation guarantees (e.g., 1.5-approximate TSP); bad ones are guesses dressed up. The closer a heuristic function tracks the true optimum, the cheaper the search — A*'s efficiency lives or dies by it. Counter-intuitive: heuristic strength = depth of structural understanding; heuristics aren't shortcuts around knowledge, they're compressed knowledge. Human "intuition" is a heuristic learned over a lifetime — strong inside its training distribution, silently failing outside it. This is why senior experts crash on cross-domain moves: heuristics don't transfer for free. LLMs are heuristic approximators trained on human-language priors; same strength, same blind spot. Practice: in a new domain, first admit your heuristic is empty and do honest slow search before trusting any fast take.
AI Prompts
中文提示词
我面对的问题是 [描述]。直觉/经验告诉我答案是 [描述]。请帮我审计这个启发:
① 这个问题是否 NP 难或近似 NP 难?若是,明确指出"最优解不可得";
② 我目前的启发函数是从哪个训练分布学来的?当前问题是否在分布内?给出 2 条分布外的危险信号;
③ 给出 1 个有近似比意识的策略——"近似比目标"是多少倍最优,需要保留多大缓冲带防偏差。
English Prompt
The problem I face: [describe]. My intuition/experience says the answer is [describe]. Audit this heuristic:
1. Is this problem NP-hard or near-NP-hard? If so, name plainly that the optimum is unreachable.
2. Which training distribution did my current heuristic learn from? Is the present problem inside that distribution? Flag 2 out-of-distribution warning signs.
3. Propose one strategy with explicit approximation-ratio awareness — what factor of optimum am I targeting, and how much buffer do I need against bias?