Talk:Search

From NetHackWiki
Jump to navigation Jump to search

exact door/trap finding probabilities

The exact probabilities of finding a secret door or trap per search can be deduced from Detect.c#dosearch0 (called with aflag = 0) and rnl. The precise numbers matter for finding the expected number of searches (the numerics are instable as the probability approaches zero.) The table needs to be updated for the case you are wearing a ring of searching.

On request, I can provide the exact probability distribution of the involved functions.Tjr 21:27, July 11, 2010 (UTC)

Just to get it done, here are the raw numbers. The string in the first entry of each row is the parameter rnl() is called with - 8 is for traps, 2-7 are for secret doors with lenses / Excalibur. The remaining entries are the probabilities of success for Luck=-13, Luck=-12, ..., Luck=+13. Tjr 04:12, July 12, 2010 (UTC)
{{\"2: \", 1/126, 1/124, 1/122, 1/120, 1/118, 1/116, 1/114, 1/112, 1/110, 1/108, 1/106, 1/2, 1/2, 1/2, 1/2, 1/2, 93/94, 91/92, 89/90, 87/88, 85/86, 83/84, 81/82, 79/80, 77/78, 75/76, 73/74}, {\"3: \", 1/189, 1/186, 1/183, 1/180, 1/177, 1/174, 1/171, 1/168, 1/165, 1/162, 1/159, 1/3, 1/3, 1/3, 1/3, 1/3, 31/47, 91/138, 89/135, 65/66, 127/129, 62/63, 121/123, 59/60, 115/117, 56/57, 109/111}, {\"4: \", 1/252, 1/248, 1/244, 1/240, 1/236, 1/232, 1/228, 1/224, 1/220, 1/216, 1/212, 1/4, 1/4, 1/4, 1/4, 1/4, 93/188, 91/184, 89/180, 65/88, 127/172, 31/42, 161/164, 157/160, 51/52, 149/152, 145/148}, {\"5: \", 1/315, 1/310, 1/305, 1/300, 1/295, 1/290, 1/285, 1/280, 1/275, 1/270, 1/265, 1/5, 1/5, 1/5, 1/5, 1/5, 93/235, 91/230, 89/225, 13/22, 127/215, 62/105, 161/205, 157/200, 51/65, 93/95, 181/185}, {\"6: \", 1/378, 1/372, 1/366, 1/360, 1/354, 1/348, 1/342, 1/336, 1/330, 1/324, 1/318, 1/6, 1/6, 1/6, 1/6, 1/6, 31/94, 91/276, 89/270, 65/132, 127/258, 31/63, 161/246, 157/240, 17/26, 31/38, 181/222}, {\"7: \", 1/441, 1/434, 1/427, 1/420, 1/413, 1/406, 1/399, 1/392, 1/385, 1/378, 1/371, 1/7, 1/7, 1/7, 1/7, 1/7, 93/329, 13/46, 89/315, 65/154, 127/301, 62/147, 23/41, 157/280, 51/91, 93/133, 181/259}, {\"8: \", 1/504, 1/496, 1/488, 1/480, 1/472, 1/464, 1/456, 1/448, 1/440, 1/432, 1/424, 1/8, 1/8, 1/8, 1/8, 1/8, 93/376, 91/368, 89/360, 65/176, 127/344, 31/84, 161/328, 157/320, 51/104, 93/152, 181/296}}