4.6.20 · HinglishTheory of Computation

Rice's theorem

1,960 words9 min readRead in English

4.6.20 · Coding › Theory of Computation


YEH theorem exist hi kyun karti hai?

"Behavior" vs "structure" kya hota hai?

  • Behavioral (semantic) property = language ki property — woh set of strings jo machine accept karti hai. Example: "kya empty string accept karta hai?", "kya infinite hai?", "kya hai?".
  • Structural (syntactic) property = machine description ki property, na ki woh kya compute karta hai. Example: "kya ke 7 states hain?", "kya kabhi blank likhta hai?". Yeh aksar decidable hote hain aur Rice inke baare mein kuch nahi kehta.

Statement

Do excluded trivial cases (jo decidable hain):

  • (koi language ke paas yeh nahi) → hamesha "no" answer do.
  • → hamesha "yes" answer do.

DERIVATION first principles se (Halting / se reduction)

Setup. Maano non-trivial hai. Hum undecidable language use karte hain.

Step 1 — Baseline chuno. WLOG maano (empty language ke paas yeh property nahi hai). Yeh step kyun? Agar ho, toh sirf complement property ke liye undecidability prove karo; decide karna decide karna hoga, toh yeh symmetric hai. Isliye kuch nahi jaata.

Step 2 — Witness pakdo. Kyunki non-trivial hai aur , koi language exist karti hai jise machine recognize karti hai. Yeh step kyun? Non-triviality guarantee karti hai kam se kam ek "yes" example. Humein ek target language chahiye jo property rakhti ho taaki hum us mein switch kar sakein.

Step 3 — Gadget. Input diya hua, ek nayi machine banao jo input par yeh kare:

  1. ko abhi ignore karo. Pehle ko par run karo (simulate).
  2. Agar ne accept kiya, toh ko par run karo aur accept karo agar accept kare ko.

Yeh step kyun? Yahi toh dil hai. Dono worlds trace karo:

  • Agar ne accept kiya: step 1 finish hoga, toh exactly ki tarah behave karega, isliye .
  • Agar ne accept nahi kiya: step 1 kabhi finish nahi hoga, kabhi step 2 tak nahi pahunchega, kuch accept nahi karega, toh .

Toh:

Step 4 — Contradiction. Maano ke liye ek decider exist karta hai. Use feed karo: "yes" bolta hai ne accept kiya. Yeh decide karta hai — impossible. Isliye undecidable hai.

Figure — Rice's theorem

Worked Examples


Common Mistakes (Steel-manned)


Recall Feynman: 12-saal ke bachche ko samjhao

Socho tumhare paas ek magic box hai jo doosre chhote robot-programs chalata hai. Tum ek checker-machine chahte ho jo ek robot ki instruction sheet padhe aur bataye "yeh robot eventually cat word bolega." Rice's theorem kehti hai: aisi koi perfect checker machine exist nahi kar sakti kisi bhi interesting "woh eventually kya karega" sawaal ke liye. Sirf boring sawaalon ke jawab hamesha diye ja sakte hain jahan jawab har robot ke liye same ho ("haan, hamesha" ya "nahi, kabhi nahi"). Wajah yeh hai: robot check karne ke liye, tumhare checker ko secretly pata hona chahiye ki robot kab bhi rukta hai — aur hum pehle hi prove kar chuke hain ki yeh general mein koi nahi jaanta.


Connections

  • Halting Problem — beej; Rice ise generalize karta hai.
  • A_TM and undecidability — woh language jisse hum reduce karte hain.
  • Mapping reductions — proof technique (gadget machine banao).
  • Recursive vs Recursively Enumerable languages — undecidable ≠ non-r.e.
  • Rice-Shapiro theorem — Rice ko refine karta hai recognizability decide karne ke liye.
  • Turing Machines — underlying model.

Flashcards

Rice's theorem kya kehta hai?
Har non-trivial semantic property of the language r.e. by a TM undecidable hoti hai.
"Semantic"/behavioral property kya hoti hai?
ki property (machine kya accept karti hai), machine ki encoding se independent.
"Non-trivial" property kya hoti hai?
Woh jo kam se kam ek r.e. language ke liye true ho aur kam se kam ek r.e. language ke liye false ho.
Rice ke dwara EXCLUDE hone wale do property types kaun se hain?
Trivial properties (always-true ya always-false) aur syntactic properties (machine description ke baare mein).
Proof mein non-triviality kyun zaroori hai?
Reduction ko ek YES-witness language aur ek NO-witness () chahiye flip karne ke liye; trivial properties flip nahi kar sakti.
Proof mein kaunsi language se reduce kiya jaata hai?
(equivalently the Halting Problem).
Gadget mein, kya hota hai jab ne par reject/loop kiya?
(woh ka par simulation kabhi finish nahi karta, toh kuch accept nahi karta).
Gadget mein, kya hota hai jab ne accept kiya?
, woh witness language jiske paas property hai.
Kya "kya ke 5 states hain?" Rice se covered hai?
Nahi — yeh description ki syntactic property hai; yeh decidable hai.
Kya Rice kehta hai ki non-r.e. hai?
Nahi, sirf itna ki woh undecidable hai (not recursive). Woh phir bhi r.e. ho sakta hai.
Kya " regular hai?" decidable hai?
Nahi — non-trivial semantic property → Rice se undecidable.
Kya "?" decidable hai?
Nahi — non-trivial ( ke paas hai, ke paas nahi) → undecidable.

Concept Map

generalized by

reduces to

applies to

says nothing about

requires

encoded as

makes

is

is

built into

proves

gives yes and no machines

Halting Problem undecidable

A_TM machine accepts w

Rice's Theorem

Behavioral property of L of M

Structural property of machine

Non-trivial property

L_P set of machine codes

Undecidable

Often decidable

Gadget machine flips property