We know what a Lion is from [ISO] 4711/X.123. Since [CCITT] have specified a Lion to be a [particular option] of a [cat] we will have to wait for a [harmonized standard] to appear. $20,000,000 have been [fund]ed for [initial investigations] into this [standard development].\r\n\r\n
Stand in the top left hand [corner] of the Sahara Desert. Take one [step] east. Repeat until you have found the lion, or you reach the right hand edge. If you reach the right hand [edge], take one step southwards, and proceed towards the left hand edge. When you finally reach the lion, put it the cage. If the lion should happen to eat you before you manage to get it in the cage, press the [reset button], and try again.\r\n
Optionally, [experienced programmer]s will place a [pink elephant] in [Johannesburg] as a [sentinel value]. (thanks [ariels])\r\n \r\n
The way the problem reached me was: catch a wild lion in the Sahara\r\nDesert. [Another way of stating the problem] is:\r\n\r\n
\r\n [Axiom] 1: Sahara [elem] deserts\r\n Axiom 2: Lion elem Sahara\r\n Axiom 3: NOT(Lion elem cage)\r\n\r\n
We observe the following invariant:\r\n\r\n
P1: C(L) v not(C(L))\r\n\r\n
where C(L) means: the value of \"L\" is in the cage.\r\n\r\n
Establishing C initially is trivially accomplished with the statement\r\n\r\n
;cage := {}\r\nNote 0:\r\n[This is easily implemented] by opening the door to the \r\ncage and shaking out any lions that happen to be there \r\ninitially.\r\n(End of note 0.)\r\n\r\nThe obvious [program structure] is then:\r\n
\r\n ;cage:={}\r\n ;do NOT (C(L)) ->\r\n ;\"approach lion under [invariance] of P1\"\r\n ;if P(L) ->\r\n ;\"insert lion in cage\"\r\n [] not P(L) ->\r\n ;skip\r\n ;fi\r\n ;od\r\n\r\nwhere P(L) means: the value of L is within arm's reach.\r\n\r\nNote 1:\r\nAxiom 2 ensures that the [loop termination|loop terminates].\r\n(End of note 1.)\r\n\r\nExercise 0:\r\nRefine the step \"Approach lion under invariance of P1\".\r\n(End of exercise 0.)\r\n\r\nNote 2:\r\nThe program is [robust] in the sense that it will lead to\r\n[abortion] if the value of L is \"lioness\".\r\n(End of note 2.)\r\n\r\nRemark 0: This may be a new sense of the word \"robust\" for you.\r\n(End of remark 0.)\r\n\r\nNote 3:\r\n\r\nFrom observation we can see that the above program leads to the\r\n[desired goal]. It goes without saying that we therefore do not \r\nhave to [run] it.\r\n(End of note 3.)\r\n(End of approach.) \r\n(End of document)\r\n\r\n\r\n You can find an infinity of variations on the above [theme] floating around in the [cyberspace] (and probably in [dead tree] format too), but some of them tend to wear the concept a bit [thin]...
","author":{"lasttime":"2024-10-24T07:10:44Z","hidelastseen":0,"node_id":1477422,"is_bot":0,"title":"drdave","type":"user"},"node_id":1478484,"writeuptype":"idea","publishtime":"2003-07-21T21:02:14Z","createtime":"2003-07-21T21:02:14Z","cools":[{"title":"Pseudo_Intellectual","node_id":4586,"type":"user"},{"node_id":737325,"title":"Senso","type":"user"}]},"parent_categories":[],"categories":[],"type":"writeup","user":{"node_id":"779713","can_cool":0,"is_admin":0,"can_vote":0,"title":"Guest User","is_editor":0,"is_guest":1,"coolsleft":0}},"architecture":"aarch64","display_prefs":{"edn_hideedev":0,"rtn_hidecwu":0,"vit_hidenodeinfo":0,"num_newwus":"10","vit_hidenodeutil":0,"rtn_hidenws":0,"nw_nojunk":false,"rtn_hideedc":0,"vit_hidemaintenance":0,"edn_hideutil":0,"vit_hidelist":0,"vit_hidemisc":0},"nodeletorder":["sign_in","recommended_reading","new_writeups"],"reactPageMode":true,"recaptcha":{"enabled":true,"publicKey":"6LeF2BwsAAAAAMrkwFG7CXJmF6p0hV2swBxYfqc2"},"title":"How To Catch a Lion in the Sahara Desert (idea)","lastCommit":"12f701fc1c860c10ddd3467bb16b07723732e55f","user":{"editor":false,"admin":false,"guest":true,"in_room":"0","developer":true,"title":"Guest User","chanop":false,"node_id":"779713"},"staffpicks":[{"type":"e2node","node_id":"689500","title":"Newton's Rape Manual and other surprises"},{"node_id":"14459","title":"Costa Rica","type":"e2node"},{"type":"e2node","node_id":"1286022","title":"Petrified Forest National Park"},{"type":"e2node","node_id":"592534","title":"Damien Hirst"},{"title":"Shomer negiah","node_id":"1990320","type":"e2node"},{"type":"e2node","title":"Dizzy and Katyana's Wedding Ceremony","node_id":"1034499"},{"type":"e2node","node_id":"469780","title":"Tampopo"},{"type":"e2node","node_id":"1255244","title":"Home Life in Ancient Greece"},{"type":"e2node","title":"The Girl from Ipanema","node_id":"556067"},{"title":"The Gone, Growing in Number","node_id":"681550","type":"e2node"},{"type":"e2node","node_id":"1117523","title":"The horse that freed the slaves"},{"type":"e2node","title":"Baba O'Riley","node_id":"731966"},{"type":"e2node","node_id":"723534","title":"The Great Grand E2 Book Lotto"},{"title":"Mystery Science Theater 3000","node_id":"10803","type":"e2node"},{"type":"e2node","node_id":"49469","title":"flea"}],"nodetype":"writeup","chatterbox":{"roomName":"outside","miniMessages":[],"roomTopic":"Massive site change may have surfaced various issues. See: [root log: mid-December 2025: Writeup display overhaul], and report any problems. - Publication problems fixed. Thank you -[jaybonci|jb]","showMessagesInChatterbox":1,"messages":[]},"developerNodelet":{},"coolnodes":[{"latest_cool":"2026-02-21 09:49:12","parentTitle":"Allow yourself no dreams","wu_author":"m_turner","parentNode":1190680,"coolwriteups_id":1190681,"writeupCooled":2},{"latest_cool":"2026-02-21 09:01:56","parentTitle":"Toucans, to Me, Seem Poorly Designed","parentNode":2213324,"coolwriteups_id":2213325,"writeupCooled":4,"wu_author":"lostcauser"},{"parentNode":2213342,"coolwriteups_id":2213343,"writeupCooled":5,"parentTitle":"Most Businesspeople Spend Time Doing Business: Explaining the Great AI Productivity Mirage","latest_cool":"2026-02-21 08:24:14","wu_author":"Glowing Fish"},{"wu_author":"Gritchka","coolwriteups_id":1329371,"parentNode":1104001,"writeupCooled":8,"parentTitle":"This is why she stays","latest_cool":"2026-02-20 07:40:01"},{"latest_cool":"2026-02-20 06:26:38","parentTitle":"I Would Like To Be Only a Bright Red Coat","writeupCooled":2,"parentNode":2213358,"coolwriteups_id":2213357,"wu_author":"lostcauser"},{"parentNode":2020384,"coolwriteups_id":2208564,"writeupCooled":4,"parentTitle":"Four Lions","latest_cool":"2026-02-19 22:45:26","wu_author":"Hazelnut"},{"latest_cool":"2026-02-19 19:50:31","parentTitle":"Kyawthuite","wu_author":"Finky","coolwriteups_id":2213352,"parentNode":2213353,"writeupCooled":1},{"wu_author":"iceowl","latest_cool":"2026-02-19 18:07:56","parentTitle":"Sunday February 1, 2026","writeupCooled":6,"parentNode":2213255,"coolwriteups_id":2213254},{"writeupCooled":8,"parentNode":67501,"coolwriteups_id":594433,"wu_author":"Sudderth","parentTitle":"I'm trippin' my nut sack into a frenzy of dik play","latest_cool":"2026-02-19 12:40:11"},{"wu_author":"lostcauser","parentTitle":"Better the Bones of the Lions You Know","latest_cool":"2026-02-18 22:35:44","writeupCooled":1,"parentNode":2213346,"coolwriteups_id":2213347},{"writeupCooled":1,"parentNode":2213307,"coolwriteups_id":2213310,"wu_author":"teleny","parentTitle":"February 11, 2026","latest_cool":"2026-02-18 20:48:25"},{"writeupCooled":1,"parentNode":2213341,"coolwriteups_id":2213323,"latest_cool":"2026-02-18 05:00:34","parentTitle":"Dora and the Lost City of Gold","wu_author":"Finky"},{"latest_cool":"2026-02-17 23:08:35","parentTitle":"February 5, 2026","wu_author":"wertperch","parentNode":2213269,"coolwriteups_id":2213272,"writeupCooled":8},{"writeupCooled":1,"coolwriteups_id":2213306,"parentNode":2213303,"wu_author":"passalidae","parentTitle":"February 10, 2026","latest_cool":"2026-02-17 20:26:03"},{"parentTitle":"Many Things to Many People","latest_cool":"2026-02-17 18:57:14","writeupCooled":3,"parentNode":2174497,"coolwriteups_id":2213338,"wu_author":"lostcauser"},{"parentTitle":"Correspondence Regarding Joyce's \"Dubliners\"","latest_cool":"2026-02-17 18:04:28","wu_author":"Uberfetus","coolwriteups_id":469802,"parentNode":469784,"writeupCooled":3},{"coolwriteups_id":2213291,"parentNode":2213337,"writeupCooled":1,"latest_cool":"2026-02-17 17:22:12","parentTitle":"Seven or Ten Things I Hate About You","wu_author":"Pandeism Fish"},{"parentNode":2213332,"coolwriteups_id":2213333,"writeupCooled":4,"latest_cool":"2026-02-17 07:07:30","parentTitle":"These two statements are gross apart, but better together","wu_author":"Glowing Fish"},{"latest_cool":"2026-02-17 06:12:07","parentTitle":"February 16, 2026","writeupCooled":1,"coolwriteups_id":2213336,"parentNode":2213331,"wu_author":"andycyca"},{"wu_author":"gate","latest_cool":"2026-02-17 03:38:25","parentTitle":"Rules for working at a grocery store","writeupCooled":1,"parentNode":629279,"coolwriteups_id":2213334},{"parentTitle":"Vending machine","latest_cool":"2026-02-17 03:19:50","coolwriteups_id":808720,"parentNode":103632,"writeupCooled":2,"wu_author":"Ouroboros"},{"writeupCooled":5,"coolwriteups_id":1874473,"parentNode":1874472,"parentTitle":"The Consequence of Depravity","latest_cool":"2026-02-15 23:42:33","wu_author":"Sessor"},{"latest_cool":"2026-02-15 22:16:51","parentTitle":"things she did not say","wu_author":"deep thought","coolwriteups_id":949505,"parentNode":2213330,"writeupCooled":1},{"coolwriteups_id":934954,"parentNode":934938,"writeupCooled":1,"parentTitle":"Five degrees below zero Fahrenheit","latest_cool":"2026-02-15 11:23:06","wu_author":"qousqous"},{"parentTitle":"A Choice of Gods","latest_cool":"2026-02-15 08:15:40","writeupCooled":2,"parentNode":2213274,"coolwriteups_id":2213275,"wu_author":"Glowing Fish"},{"coolwriteups_id":2213236,"parentNode":2213246,"writeupCooled":4,"parentTitle":"The Rise of the Agents","latest_cool":"2026-02-15 08:14:15","wu_author":"relentless"},{"coolwriteups_id":2213295,"parentNode":2213294,"writeupCooled":3,"parentTitle":"Like a Girl Loves a Boy in White Buckskin Shoes","latest_cool":"2026-02-14 15:18:14","wu_author":"lostcauser"},{"coolwriteups_id":1803435,"parentNode":1793174,"writeupCooled":5,"latest_cool":"2026-02-13 18:21:58","parentTitle":"The Black Dahlia","wu_author":"JD"},{"wu_author":"anyend","parentTitle":"Ryugyong Hotel","latest_cool":"2026-02-12 18:57:26","writeupCooled":5,"parentNode":1160111,"coolwriteups_id":1373304},{"latest_cool":"2026-02-12 13:52:49","parentTitle":"King John","wu_author":"Glowing Fish","parentNode":1411948,"coolwriteups_id":2213312,"writeupCooled":1}],"guest":1}