Template talk:Spell probability table: Difference between revisions

From Heroes 3 wiki
Jump to navigation Jump to search
(some town names don't fit in one monospaced column, so spread them over two lines to preserve alignment)
(→‎The real chances: new section)
Line 77: Line 77:


: I'm fine with that. I'll leave it up to your discretion. ―[[user:imahero|imahero]] 08:25, 31 May 2018 (CEST)
: I'm fine with that. I'll leave it up to your discretion. ―[[user:imahero|imahero]] 08:25, 31 May 2018 (CEST)
== The real chances ==
"The values in this table are based on the rough, simplistic formula (1-(1-(x/100))y). The real values will be slightly higher. If someone wants to calculate the real values and edit this table, go for it!"
I believe you, but why is that? I was certain that we can graph it as following:
: c% chance for spell to appear in slot 1
: (1-c%) * c% chance to appear in slot 2, given it did not appear in slot 1 (since spells cant repeat)
: (1-c%)^2 * c% chance to appear in slot 3, given it did not appear in slots 1 and 2 (since spells can't repeat)
: . . .
: (1-c%)^k-1 * c% chance to appear in slot k, given it did not appear in slots [1:k] (since spells can't repeat and if it did appear in slot 1, it wouldn't in 2 and so on).
This can be written as SUM(i=0 to i=k) [(1-c%)^i-1 * c%), and simplified to 1 - (1-c%)^k (since probabilities always add up to 1). But apparently this formula is incorrect - why? [[User:Csaros|Csaros]] ([[User talk:Csaros|talk]])

Revision as of 13:06, 6 October 2024

Tried to find any ingame proof for strange 1-2% inequalities kind of 88/89% for Magic Arrow in Dungeon/Necropolis. The only source I've found was SPTRAITS.TXT file and the whole picture there looks like:

		% Chance to gain	Rampart		Inferno		Dungeon		Fortress							
Name			Level	Castle		Tower		Necropolis	Stronghold	Conflux
Bless			1	10	5	5	0	0	3	3	5	5
Bloodlust		1	0	0	0	10	5	5	10	5	5
Cure			1	10	10	5	5	0	5	5	10	5
Curse			1	0	0	3	5	10	5	0	0	0
Dispel			1	10	10	10	10	10	10	10	10	10
Haste			1	5	10	5	5	5	10	5	10	10
Magic Arrow		1	30	30	30	30	30	30	30	30	30
Prot. from Water	1	3	3	3	3	3	3	3	3	3
Protection from Fire	1	3	3	3	3	3	3	3	3	3
Shield			1	10	3	5	3	10	5	5	5	5
Slow			1	5	10	10	10	5	5	5	5	10
Stone Skin		1	5	5	10	5	10	5	10	5	5
Summon Boat		1	3	5	5	5	3	5	5	3	3
View Air		1	3	3	3	3	3	3	3	3	3
View Earth		1	3	3	3	3	3	3	3	3	3
Blind			2	4	6	2	12	4	4	4	6	8
Death Ripple		2	0	0	0	0	50	0	0	0	0
Disguise		2	2	2	2	4	2	2	2	0	2
Disrupting Ray		2	6	4	6	12	4	6	6	6	8
Fire Wall		2	4	4	4	12	4	4	4	4	8
Fortune			2	4	6	4	4	2	2	4	4	2
Ice Bolt		2	50	50	6	0	6	6	4	50	25
Lightning Bolt		2	4	4	50	20	6	50	50	4	25
Precision		2	6	6	4	8	2	6	4	4	2
Protection from Air	2	2	2	2	4	2	2	2	2	2
Quicksand		2	4	4	6	4	4	4	6	6	4
Remove Obstacle	2	4	4	6	4	4	4	4	4	4
Scuttle Boat		2	6	4	4	4	4	4	4	4	4
Visions			2	2	2	2	4	2	2	2	2	2
Weakness		2	2	2	2	8	4	4	4	4	4
Air Shield		3	4	8	8	2	4	4	8	4	4
Animate Dead		3	0	0	0	0	16	0	0	0	0
Anti-Magic		3	12	8	8	4	8	8	12	10	12
Destroy Undead		3	12	8	8	2	0	4	4	2	4
Earthquake		3	4	8	4	6	4	4	4	50	4
Fireball		3	8	8	8	50	12	16	12	2	12
Force Field		3	4	4	8	2	8	8	4	4	8
Forgetfulness		3	8	8	4	4	4	4	4	4	8
Frost Ring		3	16	16	16	0	12	12	12	4	12
Hypnotize		3	4	4	8	6	0	8	4	4	12
Land Mine		3	8	8	8	6	8	12	8	2	4
Mirth			3	4	4	4	2	4	4	12	2	4
Misfortune		3	4	4	4	6	8	4	4	2	4
Prot. from Earth	3	4	4	4	2	4	4	4	0	4
Teleport		3	8	8	8	8	8	8	8	10	8
Armageddon		4	0	0	0	5	5	10	0	0	0
Berserk			4	5	5	5	5	10	5	0	0	5
Chain Lightning		4	10	10	10	10	10	10	0	0	10
Clone			4	5	5	10	5	5	5	0	0	10
Counterstrike		4	5	10	5	5	5	5	0	0	5
Fire Shield		4	5	5	5	5	5	5	0	0	5
Frenzy			4	5	5	5	5	5	5	0	0	5
Inferno			4	5	5	5	10	5	5	0	0	10
Meteor Shower		4	10	10	10	10	10	10	0	0	10
Prayer			4	10	5	5	0	0	0	0	0	5
Resurrection		4	10	10	10	10	10	10	0	0	5
Slayer			4	5	5	5	5	5	5	0	0	5
Sorrow			4	5	5	5	5	5	5	0	0	5
Town Portal		4	10	10	10	10	10	10	0	0	10
Water Walk		4	10	10	10	10	10	10	0	0	10
Air Elemental		5	0	0	14	0	16	0	0	0	12
Dimension Door		5	0	20	14	16	16	16	0	0	13
Earth Elemental		5	0	16	14	16	16	12	0	0	12
Fire Elemental		5	0	0	0	16	0	12	0	0	12
Fly			5	0	16	16	16	16	12	0	0	13
Implosion		5	0	16	14	16	20	12	0	0	13
Magic Mirror		5	0	16	14	0	0	12	0	0	13
Sacrifice		5	0	0	0	20	16	12	0	0	0
Titan's Lightning Bolt	5	0	0	0	0	0	0	0	0	0
Water Elemental		5	0	16	14	0	0	12	0	0	12

So I think it will be more correct to use this 100%-per-level form in this tab as well. (Also it will allow us to get rid of 'tower with/without library' ugliness). --ShushMaster (talk) 05:48, 31 May 2018 (CEST) Besides, the current numbers are not totally correct: for example we have total 503% instead of 500% for tower without library' 1st lelel spells. --ShushMaster (talk) 06:07, 31 May 2018 (CEST)

I'm fine with that. I'll leave it up to your discretion. ―imahero 08:25, 31 May 2018 (CEST)

The real chances

"The values in this table are based on the rough, simplistic formula (1-(1-(x/100))y). The real values will be slightly higher. If someone wants to calculate the real values and edit this table, go for it!" I believe you, but why is that? I was certain that we can graph it as following:

c% chance for spell to appear in slot 1
(1-c%) * c% chance to appear in slot 2, given it did not appear in slot 1 (since spells cant repeat)
(1-c%)^2 * c% chance to appear in slot 3, given it did not appear in slots 1 and 2 (since spells can't repeat)
. . .
(1-c%)^k-1 * c% chance to appear in slot k, given it did not appear in slots [1:k] (since spells can't repeat and if it did appear in slot 1, it wouldn't in 2 and so on).

This can be written as SUM(i=0 to i=k) [(1-c%)^i-1 * c%), and simplified to 1 - (1-c%)^k (since probabilities always add up to 1). But apparently this formula is incorrect - why? Csaros (talk)