星期日, 9月 28, 2025

River crossing puzzle 3

    problem statement




17 step solution 黃品勛
















Claude Sonnet 4.5 reasoning did not work (It worked very very hard.)

Claude Sonnet 4.5 gen BFS but did not work (misinterpretation of problem)





Code gen (Python)

code gen python A* search for ::River Crossing Puzzle ...



change to js



run js



use React to visualize the steps





ChatGPT 5 create BFS to solve it. 17 step solutionvisualize, visualizer

ChatGPT BFS

ChatGPT BFS

If BFS option is trurned off, ChatGPT has a hard time doing it manually.




ps:
Monologue is best.


reasoning mode in o1



Talking to itself



Running into difficulties? Cute



hours? Ha Ha Ha









Follow up to #3

1.  繪製專業工程圖

為何你的AI得不到專業級的工程圖版型?

專業版型需要時間調整(熬煮),你們第一次做出來通常很陽春。還有因為你們沒有付費,所以分配到很少的算力,只能做陽春版。所以初學者先用老師版型customize就好,要做出好的版型,要跟AI好好溝通很多回,而且要有足夠的算力($$$)。


如何套用

你需要套用自己的答案到版型裡面。這題要先求解,再把文字結果放進三種版型視覺化。套用時,先按下 customize鍵,等系統跑完版型,輸入你的文字資料,系統就會自動為你的資料上版型。


如果你要使用現成版型(artifact type) 做行程視覺化,步驟如下:

  1. 找到版型程式(作業工程圖下方連結)
  2. 按介面右上方 customize  鍵
  3. 輸入你的文字版時間排程
  4. 得到專業工程圖

2. 推理出正確時序

為什麼晚餐大作戰問題AI有時會出錯?

當AI面對包含多個限制條件的複雜問題時,確實存在難度。

在注意力機制(Attention mechanism)中,模型需要同時關注多個條件,並且每個注意力分配都是基於概率的。當條件數量增加時,要同時滿足所有條件的概率會顯著降低,這就像是連續投擲硬幣並期望全部正面朝上一樣——條件越多,全部滿足的概率越低。

這種情況下,模型可能會:

  • 忽略某些條件
  • 錯誤理解條件之間的關係
  • 在滿足一些條件的同時違反其他條件

如果您有一個包含多個複雜條件的問題需要解決,我建議將問題分解成較小的部分,逐步處理每個條件,使用推理模式這樣會更容易得到準確的解答。

要避免錯誤需要打開推理模式(如何開啟參看附圖),在直覺模式下容易忽略題目給定的限制條件。

How to turn on reasoning mode

請打開推理模式

1. 推理是把一件原本複雜的任務,拆解成一連串小型的步驟,就像煮一道菜,食譜會列出一串的步驟,讓你按部就班煮出來。這一連串拆解後的步驟,我們稱為思維鍊(Chain of Thought),因此當你使用推理模式的時候,會看到系統顯示每一個步驟在做的事。

2. 為什麼非推理型 LLM不擅長規劃(如搶救晚餐大作戰)或是處理複雜多重限制條件的難題(如渡河問題)?

一般來說,規劃是一項複雜的認知任務,需要幾個關鍵能力:

  • 理解因果關係和時間關係
  • 維持連貫的長期目標
  • 適應不斷變化的環境
  • 管理資源和限制

Remember to use reasoning mode to reduce such constraint violation errors. If you use Claude, turn it on in the menu by checking Extended Thinking. If you use ChatGPT, it will use Thinking mode by itself.

參考正確時序: Link 1, Link 2


3. 走迷宮

Good user interface that can generate a random maze, and allow users to add or delete walls.

建議顯示出動態找出路徑的過程,尤其是探索了哪些點。例如:

https://claude.ai/public/artifacts/502718bb-d96b-4211-b1d4-0671ae9892f0


4. ChatGPT 分享

Reminder: Cannot open your ChatGPT HTML or image files (jpg, gif, png). It is for your eyes only and not sharable.

How to share HTML from ChatGPT:

You can copy the HTML to Claude. Then prompt "render." After that, you can share the resulting link with me.

ChatGPT 只能分享一次,更新後的內容無法看見。必須要更新分享才能看到新的修改。

星期六, 9月 27, 2025

晚餐接機大作戰(半導體廠製程排程): AI 協同軟體開發 Part II A* on Python Level, Achieving Parallelism

 Scheduling Parallelism in Plans problem  (Eng) (from source)




Generate Python code base 

using such as A*, BFS, Dijkstra, ...

or let AI make its decision



To run Python, use Google Colab





Visualize results as Python can generate complex states (步驟參考)





Claude Python Colab Visualization,Python  Colab MIL Colab Viz

Gemini 2.5 Pro & Grok 4 Colab


最佳解 最高的平行度,throughput 高,idle time 減少,critical path 短




次佳解 因為James 似乎太奔波了,剛從機場回來,馬上得回去剛才的機場接人
在工廠等於也就是機器人來回運動,但是沒有產出




次佳解 Sarah 好忙,先烤火雞,換手給機場回來的 James,然後去機場接Emily,James 接手烤火雞,idle time 過長,而且造成沒有必要的 switchover 

Merge diagrams in a synchronized dashboard

 狀態圖(State Diagram) 









state diagram with aligned timeline





State diagram with sync timeline (map version)






看板圖 (Kanban)


 (interactive timeline)



流程圖(Flow chart)



星期五, 9月 26, 2025

Solving river crossing puzzles (半導體廠情境)

 半導體廠情境


  • Key Features Reproduced:

    🔬 Five Fab Systems: Alice (photoresist), Bob (plasma etch), Carlos (CVD), Diana (metrology), Elena (ion beam)

    🏭 Three Chambers: Prep staging, transfer chamber, and active processing

    ⚙️ Process Control: Systems marked with ⚙️ can control transfers between chambers

    🚫 Critical Constraints:

    • Photoresist + CVD incompatible (contamination)
    • Plasma + Metrology stay coupled (real-time feedback)
    • Ion beam + CVD interference (sensor conflicts)


  • 其他運用領域:機器人,供應鏈管理,自駕車,半導體廠製程,機器人人機協作安全規劃

  • 這個題目對AI 為什麼有點難? 多個限制條件的複雜問題

  • 推理模式是甚麼? 推理 vs. 直覺

星期三, 9月 24, 2025

EX#3 AI for Process Optimization

 課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#3  [your id, your name]




搶救感恩節晚餐大作戰講義 題目 


Plan a feasible schedule. Then verify the schedule. Then visualize your results. 



繳交範例

Claude validationreasoning*, Viz





檢查你的感恩節計畫是否正確

Use validator to check up the plan






如果你希望驗證結果可輸出為app
1. 先進入 validator
2. 按下右上方 customize 鍵
3. 接下來的操作步驟
4. 結果輸出為app





可使用狀態圖(State Diagram),看板圖 (Dashboard), 流程圖(Flow chart) 進行視覺化






 (interactive timeline)








Hint 
優化解可以達成所有人四點前到家

Hint
如果你要使用現成版型(artifact type) 做行程視覺化,步驟如下
0 找到版型程式  (工程圖下方連結)
1 按介面右上方 customize  鍵
2. 輸入你的文字版時間排程
3 得到專業工程圖
 



2. Try smart search. Prompt AI models to generate A* search Algorithm


星期四, 9月 18, 2025

推理模式研修題

Devise a strategy for the dog in the picture to retrieve its ball that fell into the pond without getting its body wet, with no humans nearby to help."

This is a problem-solving or creative thinking exercise asking someone to come up with a plan for how a dog could get its ball back from water without getting wet and without human assistance.

Animate your strategy in svg or in 3d. 


1. 方法必須合乎常理(例如狗不能飛,不會使用打撈網)

2. 需排除幻覺,不可使用畫面中不存在的器物

3. 答案必須滿足題目中的規定,例如狗在完成目標取回球的過程中都不可弄濕自己

3. 答案除了文字敘述,必須搭配動畫呈現(漫畫,影片亦可)



 LLM 有兩種模式 推理 vs. 直覺,你用對了嗎?


星期三, 9月 17, 2025

AI半導體廠製程優化



晚餐接機大作戰Scheduling Parallelism in Plans problem  (Eng) (from source)







EUVL


semiconductor fab scheduling (artifact)






Claude Sonnet 4 推理模式 (extended thinking),流程圖  no feasible,
ChatGPT 5流程圖  feasible, not optimal,

EX#2 Reasoning vs. non-reasoning AI

本次作業講義


建議工具

使用 Claude Sonnet 4

使用 ChatGPT 5

使用 Gemini 2.5 Pro 免費額度最高 1M tokens

使用 Grok 4



 課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#2  [your id, your name]

How to share a Claude link

How to share a ChatGPT link

How to share a Grok link

How to share Gemini Link


 

1. Given 1,2,3,4,5,6 can you give an equation that equals -38?  If you got a correct answer, ask how AI made it. If not, ask AI why it failed. 請分析AI解題策略(推理,直覺,蠻力,內建程式演算...),如果有錯誤,原因是什麼?


3. 計算面積




計算面積這題並沒有辦法靠內容比對這種直觀法就能得到答案,推理模型會比較適合

建議使用各種AI(特別是有推理能力的)

可考慮使用 Claude 4 Sonnet (Extended Mode 推理模式), Grok 4或 ChatGPT 5, Gemini 2.5 Pro


4. 想挑戰難的嗎 Challenge to LLM





Reasoning vs. non-reasoning AI





 AI的能力來自哪裡?

 

Given 19, 36, 55, 7, can you give an equation that equals 622?


educated guess ChatGPT 5 silde

Brute force but fails ChatGPT 5 slide

continued from the above Program execution ChatGPT 5 slide


直覺 Claude Sonnet 4 slide

推理模式 Claude Sonnet 4  Extended Thinking yet another, slide


推理模式Gemini 2.5 Pro 推理模式(參看下方註解) slide


直覺模式 Hand trial-and-error Grok 4 slide 天外飛來一筆



化繁為簡 思維鏈 (chain of thought)

深謀遠慮 RL(reinforced learning)




Given 1,2,3,4,5,6 can you give an equation that equals -38?


直覺模式 Hand trial-and-error brute force and fails ChatGPT 5 slide

Grok 4  直覺,hand trial-and-error, too many errors, stop

Sonnet 4 (直覺) hand trial-and-error, too many errors, stop

ChatGPT 5 直覺 hand trial-and-error, deemed nontrivial, stop and ask for brute force

Sonnet 4 推理模式slide

Gemini 2.5 Pro *

presentation resources



 


註解:
AI 自言自語什麼 (Gemini 2.5 pro 為例)

好的,這是在繁體中文中的翻譯: **探究方程式的可能性** 我已經開始使用各種數學運算來嘗試組合 19、36、55 和 7。最初,我的目標是找到一個能直接得出 622 的方程式。我將探索加、減、乘、除等可能性,評估其有效性並進行迭代。這是一個探索無數種可能數學組合的問題。 
**計算潛在的組合
** 我現在完全投入於測試不同算術運算的過程中。最初,我專注於直接的方法:將這四個給定的數字進行加、減、乘、除。我的目標是找到一個能得出目標值 622 的組合。如果這證明具有挑戰性,我計劃加入更複雜的運算。目標是得出一個具體的方程式。
 **研究數學關係** 我一直在尋找一個使用 19、36、55 和 7 來得出 622 的方程式,但初步的結果沒有幫助。搜尋結果非常籠統,只著重於數學中的運算順序。我需要調整我的搜尋,以專門針對這些數字和目標結果。
 **推導方程式** 我已經使用提供的數字構建了一個等於 622 的方程式。我的策略是從乘法開始,以快速接近目標值,然後減去剩餘數字的總和。我驗證了 (19 * 36) - (55 + 7) = 622。我現在可以自信地將此解決方案視為完整的。 
**優化方程式策略** 我現在正在制定一個計劃,以使用指定的數字生成得出目標數字的方程式。我目前的方法是利用乘法來接近答案,然後嘗試使用加法和減法使其相等。在我發現 (19 * 36) 是最接近 622 的結果後,我使用剩餘的數字來產生確切的差值,以獲得正確的結果。方程式 (19 * 36) - (55 + 7) = 622 是我經過這次分析後得出的解決方案。

星期三, 9月 10, 2025

EX#1 電子學 AI 助理

  AI for solving amplifier electronics (課堂講義內有參考解答)


 建議工具

使用 Claude Sonnet 4

使用 ChatGPT 5

使用 Gemini 2.5 Pro 免費額度最高 1M tokens

使用 Grok 4



 課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#1  [your id, your name]

How to share a Claude link

How to share a ChatGPT link

How to share a Grok link

How to share Gemini Link



1. Solve for the gain. 

2. Solve for the gain. 


















3. solve for the gain


 (source)






以上參考答案
(1) -4 (2) 8513 (3) -165 答案誤差10%以內都是正常的


4. Design a two stage amplifier using bjt.

the first stage is class A. the second is class AB. freq response cut off at 10Hz and 25 KHz

 






不是主修電子工程的同學,可以練習以下問題




share Claude

 




Claude man in the loop
Gemini 2.5 Pro got it right twice in a row