• Herzlich Willkommen!

    Nach der Schließung von inDiablo.de wurden die Inhalte und eure Accounts in dieses Forum konvertiert. Ihr könnt euch hier mit eurem alten Account weiterhin einloggen, müsst euch dafür allerdings über die "Passwort vergessen" Funktion ein neues Passwort setzen lassen.

    Solltet ihr keinen Zugriff mehr auf die mit eurem Account verknüpfte Emailadresse haben, so könnt ihr euch unter Angabe eures Accountnamens, eurer alten Emailadresse sowie eurer gewünschten neuen Emailadresse an einen Administrator wenden.

Question About the Rare item Caculator

Diablo Rare Calc

New member
Registriert
15 April 2012
Beiträge
9
Punkte Reaktionen
0
Hello everyone, I'm a Chinese Diablo2 Player, and I'm very interested in researching all stuff about DII.

I've posted many topics in Chinese D2 forum.

Well, recently I've studyed the rule of generating rare item affix,and based on the rule,I wrote a program to caculate the probility of certain rare item affix.

As I can't find any information about rare item affix from Blizzard. So I don't know whether my program is correct or not.

I found your website has a caculator, and I used it, if there are 3 affix, the result is similer to mine. if there are 6 affix, your result is too high, 8 times the probility of mine.

So I want to contact the caculator author, as I want to know the formula of your caculator when caculating rare item affix. And I can provide my formula. (The programe I
made is the first one in China, we don't have another available program )

Is there anyone who can help me?Thanks first。


If anyone who is interested in my algorithm of caculate rare item affix, I can provide it here,although translate it from Chinese to English will cost a little time。

If the forum master know the algorithm, I also want to contact him, but I don't know how, in my foum, we can @ the one you want to find, normally they will show up to solve problem。

Here is the Program I wrote, while I caculated a rare ring which have 3 Prefixes, at affix level 86, the total prefix frequency is 126, while my result is similar to your caculator, but not the same.

http://imgsrc.baidu.com/forum/pic/item/ae51f3deb48f8c544728308e3a292df5e1fe7f9c.jpg

(Can the picture show up? First time post picture here)
 
Zuletzt bearbeitet:
ae51f3deb48f8c544728308e3a292df5e1fe7f9c.jpg

wtf? :D
edit : affixgenerator by Tub (not online since 2010 ... )
 
Zuletzt bearbeitet:
We cannot see the image. I think that the board at baidu.com does not allow linking to images like that.

Just a guess, based on the factor of 8: During the affix generation, the number of affixes is determined first. Let's say this number is 6, as this is the interesting case.
Now, for each affix, the game determines whether this affix becomes a prefix or a suffix. If one of the groups already has 3 affixes, the other group is chosen. That means that we have 1/4 chance to actually get 6 affixes. Did you consider that part?


You can find Tub's algorithm at the Calc in the JavaScript code.


It begins with the 1/4 chance to get 6 affixes and the chances to get the selected affixes within a group, if this group (but not all affixes in it) is selected.
The most interesting thing is then the chance to select the groups which the user selected:
"AddAffix(3, 3, 1 *c6, prefixfreq, suffixfreq, prefixgroups, suffixgroups);"
This function can be found in affix_chances.js

There, the script splits the calculation in the chance for the prefixes and the chance for the suffixes, as they are now (and for 6 required affixes, always) independent.
Prefixchance and suffixchance are then multiplied and the result is multiplied with the 1/4 mentioned above. As prefixes and suffixes are symmetric and 8 is not a perfect square, I don't expect to get the difference from this part. In addition, I would expect a deviation for 3 affixes, too, in that case.

It would be interesting to see your algorithm :).
 
We cannot see the image. I think that the board at baidu.com does not allow linking to images like that.

Just a guess, based on the factor of 8: During the affix generation, the number of affixes is determined first. Let's say this number is 6, as this is the interesting case.
Now, for each affix, the game determines whether this affix becomes a prefix or a suffix. If one of the groups already has 3 affixes, the other group is chosen. That means that we have 1/4 chance to actually get 6 affixes. Did you consider that part?


You can find Tub's algorithm at the Calc in the JavaScript code.


It begins with the 1/4 chance to get 6 affixes and the chances to get the selected affixes within a group, if this group (but not all affixes in it) is selected.
The most interesting thing is then the chance to select the groups which the user selected:
"AddAffix(3, 3, 1 *c6, prefixfreq, suffixfreq, prefixgroups, suffixgroups);"
This function can be found in affix_chances.js

There, the script splits the calculation in the chance for the prefixes and the chance for the suffixes, as they are now (and for 6 required affixes, always) independent.
Prefixchance and suffixchance are then multiplied and the result is multiplied with the 1/4 mentioned above. As prefixes and suffixes are symmetric and 8 is not a perfect square, I don't expect to get the difference from this part. In addition, I would expect a deviation for 3 affixes, too, in that case.

It would be interesting to see your algorithm :).


It is very stirring for me too see your detailed answer, thanks a lot, I havn't check the group selection part, as you mention, I'll provide my algorithm first.

My algorithm is based on ruvanal's affix selection mechanism, but I only got a Chinese version, I'm trying to find the original english version;

But at present, I'll first translate it back to English;
The mechanism is like this:
For rare item:
1.The system will determin how many affix can appear on the item, normally it's 3-6, each have a 1/4 Chace.
(Well, i did a test of 568 rare item, the result is 10.6% for 3 affix, 27.46% for 4 affix,33.36% for five affix,28.52% for 6affix, ilvl from 83-88, the next time I gambled 117 rings, my clvl is 97, so ilvl of these rings are 92-99, the results are:3affix15.38%,4affix,31.6%,5affix,34.2%,6affix,18.8%. So I have to choose the "1/4" for each 3-6 affix)

2.Determin how many Prefix and Suffix.
Chance of rare and craft item affix:
   Prefix (if there aren't already 3 prefixes) 50%
   Prefix (if there are already 3 prefixes) 0%
   Suffix (if there aren't already 3 suffixes) 50%
   Suffix (if there are already 3 suffixes) 0%

3.Determin the certain prefix or suffix.
There are some rules to decide which prefix or suffix can be chosen.
To each affix, the system choose qualified affix from magicprefix.txt and magicsurfix.txt, the qualified conditons are:

1.Prefixes list from magicprefix.txt, suffixes list from magicsurfix.txt
2.affix should be accord with the right item
3.词缀alvl<=物品alvl
   4.maxlvl>=alvl
   5.frequency>0
   6.spawnable=1
   7.version check(version=1is d2c,version=100is d2x,version=0is version before v1.07)
   8.rare=1 (can occur on rare item)
   9.group number can't repeat, if it had already appeared once


Them list all qualified prefixes and suffixes, the system will determin the chance of selecting a affix by Frequency/Total Frequency。

That's it. And my algorithm is base on this , I'll reveal it next.

If you find anything wrong, please point it out.

I made my algorithm into 3 part , Chance of a certain affixes will be A*B*C

A,A1*A2。A1 is the chance of getting 3-6affixes, we use 1/4 for A1;A2 is chance of a certain array of 3-6affixes, for example, 3affixes has a chance of (1/2)^3=1/8, while 4affixes is (1/2)^4=1/16,5 affixes is (1/2)^5=1/32,6 affixes is (1/2)^6=1/64;

So,3 affixes has a A=1/32,4 affixes has a A=1/64,5 affixes has a A=1/128,6 affixes has a A=1/256;
B,The product of each affix; Take 3 affixes for example,when it is 2 Prefixes and 1 Suffix,The product of each affix is:(Frequency of Prefix 1/Total Prefix Frequency)*(Frequency of Prefix 2/Total Prefix Frequency)*(Frequency of Suffix 1/Total Suffix Frequency)

C,Total Array Numbers of each certain affixes type,each type will have a value,which will provide later, take 3 affixes for example, 2prefixes and 1suffix type will have Total Array Numbers (TAN)=3*A(2,2)=6;Here, 3 means 3 types for 2prefixes and 1suffix (PPS PSP SPP),A(2,2)means for 2 prefixes, we can array there location (P1P2 P2P1)

So,A*B*C,is the chance for a certain affix type, but only when the item generated the same affix number. The real chance for a certain affix type is much more bigger, also take 3 affixes for example,when a item have 4-6 affixes, they will also be possible to contain the certain 3 affixes, so the chance have to contain chance of higher affixes. My program considered this.

I'll list my data next. Hope I expressed clear.
 
Zuletzt bearbeitet:
That looks very similar to this explanation, which is probably the source for Tubs german explanation.


Well, i did a test of 568 rare item, the result is 10.6% for 3 affix, 27.46% for 4 affix,33.36% for five affix,28.52% for 6affix, ilvl from 83-88, the next time I gambled 117 rings, my clvl is 97, so ilvl of these rings are 92-99, the results are:3affix15.38%,4affix,31.6%,5affix,34.2%,6affix,18.8%.
This is very interesting. In your test, the probability for 3 affixes is significantly lower than 25% (first one: expected 142+-12, observed 60, probability nearly zero | second one: expected 29+-5, observed 18, that might be). This means that the theory or the test are wrong, or that they measure different things.
How did you generate the 568 rare items?



An interesting question I found while testing this: What happens if the game trys to add a suffix, but all suffix groups are already used? Tests suggest that it takes a prefix in that case. If all suffix and prefix groups are already used, the game somehow detects this and generates the item without additional groups. But how does that work?
In addition, the game seems to actively search for free groups. If there is one group with a high frequency (like 2000) which is already taken and a free group with frequency 1, the game will always use this as next suffix instead of giving up and taking a prefix instead. This is different from the staffmod generation, where the game just tries to assign a staffmod 6 times and checks whether this is possible later.
 
3 affixes:
1.to 3 affixes,chance to appear is 1/4,Chance for every type is 1/4*1/2*1/2*1/2=1/32(A=1/32);
2.affix combination type,4 types:3Prefixes,3Suffixes,1Prefix2Suffixes,2Prefixes1Suffix;
3.array of each type,8 arrayes:1 for 3Prefixes(PPP),1 for 3Suffixes(SSS),3 for 1Prefix2Suffixes (PSS SPS SSP),2Prefixes1Suffix (PSP PPS SPP);

4.Total Array Numbers of each certain affixes type(this is C number):3Prefixes=1*A(3,3)=6,3Suffixes=1*A(3,3)=6,1Prefix2Suffixes=3*A(2,2)=6,2Prefixes1Suffix=3*A(2,2)=6;




4 affixes:
1.to 4 affixes,chance to appear is 1/4,Chance for every type is 1/4*1/2*1/2*1/2*1/2=1/64;(A=1/64);
2.affix combination type,3 types:3Prefixes 1Suffix,1Prefix 3Suffixes,2Prefixes2Suffixes;

3.array of each type,14 arrayes:4 for 3Prefixes 1Suffix(PPPS PPSP PSPP SPPP),4 for 1Prefix 3Suffixes(SSSP SSPS SPSS PSSS), 6 for 2Prefix2Suffixes (SSPP SPSP SPPS PPSS PSPS PSSP);
BTW:There are 16 arrayes in theory but PPPP and SSSS can't appear(there are maximax 3 prefixes or 3 suffixes of a item, in the game)

4.Total Array Numbers of each certain affixes type(this is C number):3Prefixes 1Suffix=4*A(3,3)=24,1Prefix 3Suffixes=4*A(3,3)=24,2Prefixes2Suffixes=6*A(2,2)*A(2,2)=24;

Take a 4 affix weapon for example,the affixes type we need is 2 prefixes 2 suffixes ,suppose the frequency of Prefix 1 is 6, of Prefix 2 is 8, Total Prefix Frequency is 200, the frequency of suffix 1 is 4, of Prefix 2 is 3, Total Prefix Frequency is 80.
Then the chance of getting this weapon at 4 affix rare weapon is:
A=1/64;B=6/200*8/200*4/80*3/80;C=24;
A*B*C=8.4375E-7=1/1185185
 
Ah, I think I see the difference.

BTW:There are 16 arrayes in theory but PPPP and SSSS can't appear(there are maximax 3 prefixes or 3 suffixes of a item, in the game)
This gives an additional PPPS / SSSP pattern in the game, as the forth affixe is forced to be S or P, respectively. So instead of (4,6,4) different patterns you get (5,6,5).
If you just throw away this case, your total probability to get a rare item at all is not 1 any more.
This is even more important for 5 and 6 affixes, of course.


Another difference:
If your first prefix is chosen, the second prefix cannot be in the same group, therefore you have to exclude this group from the frequency sum. This requires to care about the order of the affixes, as the frequency sum for the second item can be 194 or 192 (prefix) in your example.
It even gets more difficult if you consider that additional affixes might get chosen, which you don't care about. That is the reason why our calculator uses the recursive function to "brute force" the problem.
 
That looks very similar to this explanation, which is probably the source for Tubs german explanation.

Unfortunately,I can't open the address of "this explanation", sometimes a too long adress is not correct, happened offen. Would you mind copy the rule to here from that link?

The sencond link of "Tubs German explanation ", I recognize it, some days before I've read it's English version, from this article I know this website has a caculator which can caculate drop chance of rare item.

This is very interesting. In your test, the probability for 3 affixes is significantly lower than 25% (first one: expected 142+-12, observed 60, probability nearly zero | second one: expected 29+-5, observed 18, that might be). This means that the theory or the test are wrong, or that they measure different things.
How did you generate the 568 rare items?

For the first 568 rare item, I choose to identify all rare item dropped by monster, continuously,

3 affixes=12+9+21+22=64,4 affixes=22+20+54+64=160, 5 affixes=31+17+72+70=190, 6 affixes=24+25+49+56=154

a few rare weapen have a vague affix number, like 4/5, because it's hard to tell out whether it's one affix or two affixes of 90ED 130AR. So I used the small one first, and the result is 3affix=11.27% 4affix=28.17% 5affix=33.45% 6affix=27.11%
second I used the maximam one, the result is:
3affix=10% 4affix=26.76% 5affix=33.27% 6affix=29.93%

then I averaged them。

The second time ,I gambled 117 rings,there arn't any vagued affixes, and the result is also not equal to 1/4,
3affix=18times 4affix=37times 5affix=40times 6affix=22times
normally 3 affixes is fewer。

Someone said it's because the sample are too few, maybe identify more than 1000 rare item, we can get a 1/4 chance for each affix. I don't have time to test that, so ,I choose to use the 1/4 chance for my programm first

An interesting question I found while testing this: What happens if the game trys to add a suffix, but all suffix groups are already used? Tests suggest that it takes a prefix in that case. If all suffix and prefix groups are already used, the game somehow detects this and generates the item without additional groups. But how does that work?
In addition, the game seems to actively search for free groups. If there is one group with a high frequency (like 2000) which is already taken and a free group with frequency 1, the game will always use this as next suffix instead of giving up and taking a prefix instead. This is different from the staffmod generation, where the game just tries to assign a staffmod 6 times and checks whether this is possible later..
Thans for give me the item choice webpage, I havn't seen it yet, I'll test it when I have time.

The phenomenon you've found is interesting, I didn't considerd this situation when prefix/suffix is not enough, I think it should happen when a item's affix level is very low.

As for the second phenomenon,when a affix choosed to be a prefix/suffix in the beginning, it has to be a prefix/suffix, as long as there are avalable prefix/suffix, no matter what the chance it is. So it is not base on Frequency/ Total Frequency, there should be a different algorithm, I think we can take it as Frequency /Total Frequency of available at present(apart from those affix that alvl< item alvl but already used)

Ah, I think I see the difference.


This gives an additional PPPS / SSSP pattern in the game, as the forth affixe is forced to be S or P, respectively. So instead of (4,6,4) different patterns you get (5,6,5).
If you just throw away this case, your total probability to get a rare item at all is not 1 any more.
This is even more important for 5 and 6 affixes, of course.


Brilliant!! I didn't consider the total chance must be 1. So my 6 affix chance is much lower than your caculator.
So at this part ,my algorithm is wrong, I can fix the problem soon.


Another difference:
If your first prefix is chosen, the second prefix cannot be in the same group, therefore you have to exclude

this group from the frequency sum. This requires to care about the order of the affixes, as the frequency sum

for the second item can be 194 or 192 (prefix) in your example.
It even gets more difficult if you consider that additional affixes might get chosen, which you don't care

about. That is the reason why our calculator uses the recursive function to "brute force" the problem

From your first to third rows I figured out why the chance is different when I choose 3 different Prefix with the same Frequency 4, because in your programm different order have different Frequency Sum.

We've discussed this question in our forum, the conclusion is Frequency Sum woun't change when choosing each affix . It's based on the ruvanal's affix selection mechanism. It didn't say the Frequency Sum should change if some group can't be choosen(when their affix has been choosen before).

We also get a explanation of choosen step:
a)Choose affix from, magicprefix.txt/magicsurfix.txt择
b)check version
c)check spawnable and rare
d)check item type
e)check alvl
f)Sum Frequency number of all available affix,chance of a affix=Frequency number of this affix/Total Frequency,similar to the usage of rarity。
based on the chance, choose one affix randomly;g)Check group number,if it already used,then go to f)and choose again
h)if the affix genearted ,then goto a).Then another affix generating cycle begins.

This rule should also have a original English version.

If this is true, then I'll insist.

If we need 2 Prefix, 1 for “of the Titan” F number is 4 ,1 for “of Precision”, F number is 3; Assumming the Total Prefix Frequency number(TF) is 100.
Then when generating the first prefix, it has a chance of 4/100 to get “of the Titan” ,when it comes to second prefix, the chance should be 3/100 to get “of Precision”, if the program choosed “of the Titan” or prefix of that group ,the program will go to a) and reselect again.

If it is runned by your rule, the second prefix will have 3/(100-number of strengh's group 31).

All make sense, but I prefer my rule, if there is a better reason for your rule, I'll also choose your rule.

But your rule will result to too many types of condition. I'll study your "brute force" approach later.
:)

Sorry, correction, the reciprocal fourth line ,it's "the program will go to f) and reselect again.", not go to a), only the h) step will go to a).

ae51f3deb48f8c544728308e3a292df5e1fe7f9c.jpg

wtf? :D
edit : affixgenerator by Tub (not online since 2010 ... )

Thanks for helping me post my program interface.:)
 
Zuletzt bearbeitet von einem Moderator:
You're welcome.
I hope mfb is going to post a short translation, because i'm still thinking : wtf ? :D
But of course its very impressing, though i just understand a little bit.
 
You can edit your posts with the button hhttp://planetdiablo.eu/forum/images/PlanetDiablo/buttons/edit.gif in order to avoid multiple posts in a row.

This thread got moved, as you posted it in the "newbie help" forum ;).


@Helkaril: Sobald hier konkrete Ergebnisse da sind.


Here is a shorter link for "this explanation".
If it is still too long, remove the #post3873077 from the URL and scroll down to the 8th post in the thread.
The post is long and contains multiple quotes, so it would be tricky to quote it here.
Or let a search engine look for the text "Imagine that Normal difficulty Pindleskin has dropped Small Charm".


Someone said it's because the sample are too few, maybe identify more than 1000 rare item, we can get a 1/4 chance for each affix.
The deviation from 1/4 is significant, even with the strictest definitions of "significant".
It is possible to modify the singleplayer-game to remove problematic affixes (like enhanced damage + attack rate) and generate rare items in large amounts (cube recipe: Any item -> rare ring or something similar). That leaves just counting as the boring thing.


I think it should happen when a item's affix level is very low.
I noticed it at staffs with itemlevel 1. The algorithm just kept looking for free suffixes in an endless loop.


Sorry, correction, the reciprocal fourth line ,it's "the program will go to f) and reselect again.", not go to a), only the h) step will go to a).
This is equivalent to removing the selected group from the pool of available affix groups. And this is equivalent to a modification of the affix frequency sum.


Thanks for helping me post my program interface.:)

This is what we see:
9qx2lgpo.gif
 
@Helkaril: Sobald hier konkrete Ergebnisse da sind.
Danke.

I was able to see the right Image, but i am not able to post it with the IMG-Function ...
 
You can edit your posts with the button hhttp://planetdiablo.eu/forum/images/PlanetDiablo/buttons/edit.gif in order to avoid multiple posts in a row.

This thread got moved, as you posted it in the "newbie help" forum ;).

No Problem.


Here is a shorter link for "this explanation".
If it is still too long, remove the #post3873077 from the URL and scroll down to the 8th post in the thread.
The post is long and contains multiple quotes, so it would be tricky to quote it here.
Or let a search engine look for the text "Imagine that Normal difficulty Pindleskin has dropped Small Charm".

It's strange, I still can't open the link even after removing the #post3873077.

About the "imagine that Normal difficulty Pindleskin has dropped Small Charm with a suffix only.", I saved a article called "Item Generation Tutorial - Diablo Wiki.htm". It has the same text.
I'll google the text for the address.


The deviation from 1/4 is significant, even with the strictest definitions of "significant".
It is possible to modify the singleplayer-game to remove problematic affixes (like enhanced damage + attack rate) and generate rare items in large amounts (cube recipe: Any item -> rare ring or something similar). That leaves just counting as the boring thing.

If we are looking for rings, they woun't get much vague affixes,just 11+ MF maybe 1 or 2 affixes. If I have time, I'll test again.



I noticed it at staffs with itemlevel 1. The algorithm just kept looking for free suffixes in an endless loop.

Interesting, I'll test it later.




This is equivalent to removing the selected group from the pool of available affix groups. And this is equivalent to a modification of the affix frequency sum.

I still think they are different, my math is not excellence, so I'll take sometime to figure it out. Thanks a lot.;)




This is what we see:
9qx2lgpo.gif

You can try to click the link:
http://imgsrc.baidu.com/forum/pic/item/ae51f3deb48f8c544728308e3a292df5e1fe7f9c.jpg

Hope you can see it.

To mfb and HelKaril, I have to sleep now, it's too later here in China, almost 6am. Hope to see you soon, I've learned a lot here.
 
Zuletzt bearbeitet:
as mfb already stated:

You can edit your posts with the button http://planetdiablo.eu/forum/images/PlanetDiablo/buttons/edit.gif in order to avoid multiple posts in a row.

Please do so. I did put your multiple posts into 1 posting, as we do not like it, when users make multiple posts in a row.
If nobody else answers in between, and you want to add something to your already existing post then use the edit-button.

Also I deleted your last post as it was irrelevant (i.e. Spam). As this is a forum and not a chat, please post only stuff relevant to this topic.
 
akiyqrda.jpg

I reloaded the Image and now everyone should be able to see it.
 
as mfb already stated:


Please do so. I did put your multiple posts into 1 posting, as we do not like it, when users make multiple posts in a row.
If nobody else answers in between, and you want to add something to your already existing post then use the edit-button.

Also I deleted your last post as it was irrelevant (i.e. Spam). As this is a forum and not a chat, please post only stuff relevant to this topic.

OK,I'll be cautious next time. Yesterday I've figured out a more rational algorithm, hope you will be interested in the algorithm, I'll reveal it next.


My original algorithm didn't consider removing the group which have already been chosen. And your algorithm seems to use a New Total Frequency= Original TF - Frequency Sum of groups which have been chosen, I think this is not precise.More detailed context please see floor #8 and #10

Like mfb replied that: This is equivalent to removing the selected group from the pool of available affix groups. And this is equivalent to a modification of the affix frequency sum.


I'll explain my algorithm here, if there are any problem, please tell me.


Let us still take a 2 Prefixes ring for example:
If we need 2 Prefixes, 1 for “of the Titan” F number is 4 , TF(Total Frequency) of Group 31 is 16(apart from the affix which have maxlevel of 4),1 for “of Precision”, F number is 3, TF(of Group 17) is 13; Assumming the Total Prefix Frequency number(TF) is 100.

Then when generating the first prefix, it has a chance of 4/100 to get “of the Titan” .

There are no problem by far.

So when it comes to the second prefix, the chance should be like this, I used a approximate algorithm(this algorithm provides an acceptable precision):
[((100-16)/100)*3/100+16/100*3/(100-16)]

Here's explanation: First, It has the chanse of (100-16)/100 to choose affix besides 'of strenth''s group 31, then “of Precision” has a chance of 3/100 to be choosen.

Secondly, if the programm chose affix of group 31 at beginning,which have the chance of 16/100, then it will go to f) to choose again. Now, I used the approximate algorithm:

If the programm choose affix apart from group 31, then “of Precision” has a chance of 3/(100-16) to be generated, the chance of second part will be 16/100*3/(100-16) , this is not very precise though.

As 3/(100-16) is only an approximate. The precise algorithm is like this:
First, if the programm chose affix of group 31 at beginning,chance of 16/100;

1.If “of Precision” was chosen, chance must be 3/100, result is 16/100*3/100.
2.If Goup 31 was chosen,(chosen again),chance will be 16/100*16/100;

If “of Precision” was chosen next, chance must be 16/100*16/100*3/100. But if Group 31 was chosen for the third time, chance will be 16/100*16/100*16/100, and then the caculation repeat, it should be an endless loop.


So for my "approximate algorithm", I just used 16/100*3/(100-16) as the second part for approximate, maybe this can be improved because I didn't caculate the other loop's sum results yet, maybe there's a formula for this part .

That's it. I hope my algorithm is correct.

@mfb
 
Zuletzt bearbeitet:
>> Then when generating the first prefix, it has a chance of 4/100 to get “of the titan” .
Ok, now the first affix is chosen, group 31 cannot be used again.

With (100-16)/100 probability, an affix in another group is chosen, I agree. But if you restrict the affix to be in other groups, "of precision" now has 3/(100-16) probability.
In other words, after picking "of the Titan", we have (100-16)/100*3/(100-16)=3/100 probability to pick "of precision" and 16/100 to pick group 31, which gives another attempt to find an affix.
The next attempt has the same distribution and so on. As formula, you can write the probability for "of precision" (given "of the titan" for the first affix) as

p=3/100+16/100 * 3/100 + 16^2/100^2 * 3/100 + ...
= 3/100*(1+q+q^2+q^3+...) with q=16/100
= 3/100*(1/(1-q)) <- that is a nice mathematical formula for the infinite sum
= 3/100*(100/84)
= 3/84

Which is exactly the probability to pick "of precision" if you just exclude group 31 from the affix choice.


If we choose two suffixes, using your numbers, what is the probability to get "of the titan" plus "of precision"?

a) first "of the titan": 4/100*3/84 = 1/700
b) first "of precision": 3/100*4/87=1/725
Add both, and you get the total probability of 57/20300 =~ 0.0028
In addition, this example shows how the order of the affixes is important.
 
we have (100-16)/100*3/(100-16)=3/100 probability to pick "of precision"

Correct! I'm wrong here.


and 16/100 to pick group 31, which gives another attempt to find an affix.
The next attempt has the same distribution and so on. As formula, you can write the probability for "of precision" (given "of the titan" for the first affix) as

p=3/100+16/100 * 3/100 + 16^2/100^2 * 3/100 + ...
= 3/100*(1+q+q^2+q^3+...) with q=16/100
= 3/100*(1/(1-q)) <- that is a nice mathematical formula for the infinite sum
= 3/100*(100/84)
= 3/84

Which is exactly the probability to pick "of precision" if you just exclude group 31 from the affix choice.

That's the right algorithm I‘m going to find out. Thanks for deducing it for me. And I didn't expect the result is just the same as what you've said equivalent before. Mainly because I've made a big mistake of the wrong chance of (100-16)/100*3/100. Your logic is very precise!



If we choose two suffixes, using your numbers, what is the probability to get "of the titan" plus "of precision"?

a) first "of the titan": 4/100*3/84 = 1/700
b) first "of precision": 3/100*4/87=1/725
Add both, and you get the total probability of 57/20300 =~ 0.0028
In addition, this example shows how the order of the affixes is important.

I see, my original wrong algorithm all use the same TF for prefix or suffix, so I only considered Total Array Numbers of each certain affixes type.

Now I need to change my code to the right algorithm for every typer of array.

Thanks a lot for your help.

BTW:The affix of Diablo 1.13C is a little different with 1.11, so the chance of a certain affix will be a little different.

Take rare ring at affix level>=86 for example, the rare ring will have Prefix TF=126, Suffix TF=170, while 1.11 have Prefix TF=126, but Suffix TF=167. In China about 80% players use 1.13C.

My programm will based on 1.13C's affix. I hope I'll finish it soon. I'll also write a English Version. And I use visual basic for my programm.
:)
 
Zuletzt bearbeitet:
Zurück
Oben