KQM | Genshin Impact
crafting-refund-vs-increase-at-3n1
621 messages
TiBotWed, September 27, 2023 at 04:17 PM
@Whalien | Despises Crafting - As an author, it is your responsibility to complete the ticket
Guidelines
- You can rename your ticket with
- If this ticket was created by accident or it can be deleted, you can use
- When you are ready to submit the ticket, compile everything into one message following the format below and pin it. Then type
- To add contributors to your ticket you can use
- The ticket will be scrapped if: no activity >1 week or open for >1 month.
Guidelines
- You can rename your ticket with
/rename <ticket name>
or with the button below- If this ticket was created by accident or it can be deleted, you can use
/delete
within the first 5 minutes, otherwise ask a Scholar.- When you are ready to submit the ticket, compile everything into one message following the format below and pin it. Then type
/close
or click the button below; the ticket will automatically be moved to be reviewed.- To add contributors to your ticket you can use
/contributor add <user>
.- The ticket will be scrapped if: no activity >1 week or open for >1 month.
Write-up Format
Theory/Finding/Bug: Title of your submission
Evidence: Explanations with calculations and/or YouTube/Imgur proofs
Significance: Conclusion
Evidence: Explanations with calculations and/or YouTube/Imgur proofs
Significance: Conclusion
Whalien | Despises CraftingWed, September 27, 2023 at 04:19 PM
so previously it was established that "10% chance of extra mat" was only a bit better than "25% chance of refund." the situation was simulated over a large sample size and difference seems to be 1%
(that finding is already on the tcl, under Crafting Refund vs Increase Passives)
(that finding is already on the tcl, under Crafting Refund vs Increase Passives)
This can also be math'd out as
(chance of extra) * (amount of extra)
, where the "10% extra" passive comes out to 0.1 * 1 = 0.1
whereas "25% refund" comes out to 0.25 * 1/3 ~= 0.83
, and thus it's pretty clear why there's only a 1% difference (1.1 vs 1.083)this is fine for very large sample sizes, but it's worth considering refunds when a player's material count is not a multiple of 3
this can be split into two cases, 3n+1 and 3n+2, i'll tackle 3n+2 first since 3n+1 is actually the bulk of this submission
when you're at 3n+2, "10% extra" will still give you 10% extra, for
0.1
expected value. however, "25% refund" will allow you to craft a new book, providing 0.25 * 1 = 0.25
expected valueThus, it's worth crafting one at a time till the 25% refund has kicked in, giving you a multiple of 3, at which point the math reduced to the initial case and you should use the "10% extra"
The more interesting case is 3n+1, where if you have a certain amount or more of mats, it's worth using the "25% refund" till a multiple of three
https://docs.google.com/spreadsheets/d/1ObO6F9NjmSDqJX6Efgo_qV3VoEmqJEfZaMRRXAZXDvo/edit?usp=sharing here's a sheet i made. the chance that you get two mats (starting from 3n+1, then +2 gives you a multiple of 3) only gets higher as you have more chances at it, but clearly you need at least three chances for your odds to be better than 0.1 (what the 10% extra always gives)
three chances while fitting the "3n+1" type, or being congruent to 1 mod 3, means that if you have 10 or more (13, 16, 19, etc) mats, you should use the "25% refund," while if you have 4 or 7 (1 doesn't allow you to craft anything) you should stick with the "10% extra"
Finding: when you have 3n+2 of a material, or when you have 3n+1 of a material and you have 10 or more of it, it is worth using the "25 refund" passive to attain a multiple of 3 before going back to the "10% extra" passive.
Evidence: https://docs.google.com/spreadsheets/d/1ObO6F9NjmSDqJX6Efgo_qV3VoEmqJEfZaMRRXAZXDvo/edit?usp=sharing
Significance: better crafting output, including resin efficiency in relation to items such as weapon materials
Evidence: https://docs.google.com/spreadsheets/d/1ObO6F9NjmSDqJX6Efgo_qV3VoEmqJEfZaMRRXAZXDvo/edit?usp=sharing
Significance: better crafting output, including resin efficiency in relation to items such as weapon materials
25% Craft 3n+1 calcs
Sheet1
Starting Materials,Single Probability,Output,Cumulative,Overall Probability,Probability,Output,Cumulative,Overall Probability,Probability,Output,Cumulative,Overall Probability
0.25,0.3333333333,1.333333333,0.015625
0.25,0.3333333333,1,0.0625
0.75,0,1,0.046875
0.3333333333,0.25,0.333333333...
Starting Materials,Single Probability,Output,Cumulative,Overall Probability,Probability,Output,Cumulative,Overall Probability,Probability,Output,Cumulative,Overall Probability
0.25,0.3333333333,1.333333333,0.015625
0.25,0.3333333333,1,0.0625
0.75,0,1,0.046875
0.3333333333,0.25,0.333333333...
TiBotWed, September 27, 2023 at 04:47 PM
Ticket closed by @Whalien | Despises Crafting. If there are any issues with it - it can be reopened by the owner or staff by using the buttons below or
/open
.nzpiefaceWed, September 27, 2023 at 09:54 PM
no lol
you dont take into acc the refunded mat getting more refunds
TiBotWed, September 27, 2023 at 09:56 PM
Ticket re-opened by @Whalien | Despises Crafting
Whalien | Despises CraftingWed, September 27, 2023 at 10:32 PM
you're right, my statement about the expected value at 3n is incorrect. the value should be
1 + 1/12 + 1/144...
where 1/12 is the expected value of the return of one craft done with the "25% refund" passive, used as the common ratio for a geometric series. this comes out to 1.09 repeatingi dont believe this directly affects anything else in my calcs, the comparisons still stand
nzpiefaceThu, September 28, 2023 at 12:54 AM
ok but what is the value of the refund of the refund if the refund
it does converge
Whalien | Despises CraftingThu, September 28, 2023 at 12:55 AM
That’s the point of the geometric series? I’m taking the limit as the number of summands goes to infinity and the summands themselves goes to 0
The original was 1.083 which was wrong, the updated one is 1.0909 which should be right. Or hopefully more right
nzpiefaceThu, September 28, 2023 at 12:56 AM
wait actually lemme think
actually fuck this
im moving houses
Whalien | Despises CraftingThu, September 28, 2023 at 12:57 AM
nzpiefaceThu, September 28, 2023 at 12:57 AM
@itzsomebody | chris oi
Whalien | Despises CraftingThu, September 28, 2023 at 12:57 AM
Reminds me of doctors
A new doctor might be ass at diagnosing you but they sure as hell can get someone who is good
A guh might not be able to do the math but they can get someone who can
itzsomebody | chrisThu, September 28, 2023 at 04:16 AM
this is close but not quite. you would multiply this series by 0.25 because:
* 1st iteration: 25% chance of 1 book back means 0.25 books
* 2nd iteration: 25% chance of 1/3 of 0.25 books back means 0.25^2 * 1/3
* 3rd iteration: 25% chance of 1/3 of 0.25^2 * 1/3 books back means 0.25^3 * 1/3^2
* <obvious inductive construction of rest of sequence>
so you multiply by 0.25. this gives you 3/11 for expected value for XQ. this also lines up with the 10% because 0.3/(3/11) = 11/10 = 1.1.
edit: oh wait you're doing on blue books whereas im doing it on green books
* 1st iteration: 25% chance of 1 book back means 0.25 books
* 2nd iteration: 25% chance of 1/3 of 0.25 books back means 0.25^2 * 1/3
* 3rd iteration: 25% chance of 1/3 of 0.25^2 * 1/3 books back means 0.25^3 * 1/3^2
* <obvious inductive construction of rest of sequence>
so you multiply by 0.25. this gives you 3/11 for expected value for XQ. this also lines up with the 10% because 0.3/(3/11) = 11/10 = 1.1.
edit: oh wait you're doing on blue books whereas im doing it on green books
itzsomebody | chrisThu, September 28, 2023 at 04:19 AM
this is a clever strategy though (and certainly not one i wouldve thought of). ill take a look soon
Whalien | Despises CraftingThu, September 28, 2023 at 04:20 AM
I’m not seeing where you got the .25 from, my sequence already accounts for the 25% chance once. My calculations are done in terms of the product, where you get 25% chance to get an additional 1/3 of the product
However I am very tired as it is past 11pm so I’m not gonna try to argue rn. Will sleep on it and give a more proper response tomorrow
However I am very tired as it is past 11pm so I’m not gonna try to argue rn. Will sleep on it and give a more proper response tomorrow
itzsomebody | chrisThu, September 28, 2023 at 04:22 AM
part of the reason is because i didn't read carefully and assumed that you used the same approach from the ticket you mentioned (that ticket works with input books used to make new book rather than new book obtained). but also the way i was approaching it would mean that that would be the expected input books returned (which is distinctively different from what you have)
Whalien | Despises CraftingThu, September 28, 2023 at 10:19 AM
Returned is also fine
Let’s start with n green books
Initial generation crafts n/3 times and returns n/12 green books
Next generation crafts n/36 times and returns n/144 green books
Etc
Let’s start with n green books
Initial generation crafts n/3 times and returns n/12 green books
Next generation crafts n/36 times and returns n/144 green books
Etc
itzsomebody | chrisThu, September 28, 2023 at 03:03 PM
thats what i did above, yes (and also what happened in previous ticket)
Whalien | Despises CraftingThu, September 28, 2023 at 04:39 PM
so then i dont think the "multiply by .25" thing works, because in the first iteration you dont get 0.25 books, you get 0.083 books because you only craft .33 times
itzsomebody | chrisThu, September 28, 2023 at 04:51 PM
first iteration you convert 3 green books 1 one blue book. there is always a 25% chance that getting a green book back happens so its 0.25 green books
Whalien | Despises CraftingThu, September 28, 2023 at 04:51 PM
0.25 is the ratio of green books to blue books
at the end of the first iteration
my calcs are about "how much total mats do we have as we craft more and more," where the act of crafting itself doesn't cause the total to increase, but it's the passive kicking in that does
first iteration, you craft (1/3 the number of mats) times, with the passive kicking in 1/4 of that, therefore the number of mats has increased by 1/12
second iteration, you use that 1/12 to craft, which in turns increases your total by 1/12 of that, making it 1/144
your first iteration seems, to me, to craft as many times as you have the "starting" materials
itzsomebody | chrisThu, September 28, 2023 at 04:59 PM
i mentioned this above earlier, we are calcing different things -- mine would be input books returned (as in, im not looking at total books)
hence i (wrongly) assumed what you were looking at
Whalien | Despises CraftingThu, September 28, 2023 at 05:00 PM
right, i'm saying you get 1/12 of the original books returned, you're saying you get 1/4
imo you're not accounting for the fact that you only craft 1/3 as many times as you have input books
imo you're not accounting for the fact that you only craft 1/3 as many times as you have input books
itzsomebody | chrisThu, September 28, 2023 at 05:01 PM
no im also saying 1/12
Whalien | Despises CraftingThu, September 28, 2023 at 05:01 PM
o
itzsomebody | chrisThu, September 28, 2023 at 05:01 PM
look at this again
1/4 * 1/3 = 1/12
its just that my initial starting point is 1/4 instead of 1 due to looking only at returns on green books and not total
so we essentially have same thing but i didnt realize you were using the starting point you used on purpose
1
Whalien | Despises CraftingThu, September 28, 2023 at 05:02 PM
oh i see now, your 0.25 isn't the actual returns
mmmmmmmmmmmmmmmmmmm
itzsomebody | chrisThu, September 28, 2023 at 05:03 PM
i did try simming your approach for 3n + 1 btw
https://docs.google.com/spreadsheets/d/1Otz0-NjufS84_3gFjqJuzUIbSk4wUEoPyiRFnCh-JXk/edit?usp=sharing
https://gist.github.com/ItzSomebody/c9e4f4c15646ee19248f602ac159f0aa
https://gist.github.com/ItzSomebody/c9e4f4c15646ee19248f602ac159f0aa
im not entirely convinced that its better than just using eula but i havent bothered attempting to come up with a good explanation why
Whalien | Despises CraftingThu, September 28, 2023 at 05:05 PM
i want to try simming it too but i can only do java maybe python
maybe at some point i'll figure out how to get shit onto google sheets
itzsomebody | chrisThu, September 28, 2023 at 05:06 PM
for python openpyxl works (can just upload the xslx created)
java also has a spreadsheet lib but i forget what its called
1
can also use google sheets api too but never tried it
Whalien | Despises CraftingThu, September 28, 2023 at 05:07 PM
i tried my hands at just simming normal xq/eula without any strats and my python scripts ran for several hours so im definitely hoping java is better in that regards
will dig around
itzsomebody | chrisThu, September 28, 2023 at 05:08 PM
mine ran at an okayish speed using pypy
1
Whalien | Despises CraftingThu, September 28, 2023 at 05:13 PM
oh you shared your github
i think i see why
im suggesting to craft [1 higher tier book] at a time
till the passive pops once
wait no hm
yours is %3 not /3 i read it wrong
mm, im busy atm so i'll have to try to come back later to this. i want to try seeing, at each iteration, if strat>=eula&strat>=xq, and calculating those odds for each of 1,4,7,10...
SeraphThu, September 28, 2023 at 11:16 PM
huh this was reopened?
well, expected gain on one round of crafting would be 3u x 10% = 30% yield from duplication passive (layla/albedo)
on a single craft for refund passive (XQ/mona), its 1u x 25% = 25% yield
on a single craft for refund passive (XQ/mona), its 1u x 25% = 25% yield
but recrafting the refunds means that for a starting amount of 3N base material, we can perform N initial crafts which yield an average of N/4 as refund
N/4 refunds craft N/12 times, with N/48 refunded
so the actual value of refund passives at any given point is N/4 + N/48 + N/(4x12^2)...
N/4 refunds craft N/12 times, with N/48 refunded
so the actual value of refund passives at any given point is N/4 + N/48 + N/(4x12^2)...
tho i think that the actual value gameplay-wise isnt strictly in the expected yield at large enough numbers, cos in that case we would use dupe passive all the time (sucrose for monster mats)
perhaps a better way to determine the efficiency of crafting is to see how much resin is saved by crafting in certain ways
we spend 20 resin on an uncondensed run for talent/weapon domains, which yield an expected number of material units
and when crafting some materials of quantity 3N+2 with the aim of crafting up as many higher tier materials as possible, its more likely to get 25% chance of refund to hit 3N+3 base and craft N+1, than to get 10% chance of dupe with 2 base left over and N+1 higher tier mats
we spend 20 resin on an uncondensed run for talent/weapon domains, which yield an expected number of material units
and when crafting some materials of quantity 3N+2 with the aim of crafting up as many higher tier materials as possible, its more likely to get 25% chance of refund to hit 3N+3 base and craft N+1, than to get 10% chance of dupe with 2 base left over and N+1 higher tier mats
these are some preliminary thoughts i have, since crafting doesnt exist in a vacuum where we can apply infinite time and resources to get an average over a larger group
rather, i'd say crafting passives exist with the aim of reducing the amount of time spent in a domain or the amount of resin used which is also time-based
so in the above case of 3N+2 base mats, if we only needed the one additional talent/weapon mat of higher tier to ascend a weapon or crown a character, refund is actually 15% higher expected value than dupe, since refund is 25% chance to save 1 run for 25% value, whereas dupe is 10% chance for the same resulting in 10% value
rather, i'd say crafting passives exist with the aim of reducing the amount of time spent in a domain or the amount of resin used which is also time-based
so in the above case of 3N+2 base mats, if we only needed the one additional talent/weapon mat of higher tier to ascend a weapon or crown a character, refund is actually 15% higher expected value than dupe, since refund is 25% chance to save 1 run for 25% value, whereas dupe is 10% chance for the same resulting in 10% value
Whalien | Despises CraftingFri, September 29, 2023 at 12:36 AM
this was the original point of my ticket yea, however chris's sims seem to suggest the strat i suggested doesn't really work so we're looking into that
Whalien | Despises CraftingFri, September 29, 2023 at 12:36 AMeventually i figured out that yall are talking in terms of the "uncrafted" mats while i'm talking in terms of the "crafted" mats
hmm. i thought about the "craft relative to what the user already has" thing
goal of my ticket was to find the best way to craft given any situation
i think the calcs are directly correlated to resin efficiency since in theory every book is worth a fixed amount of resin, and my strat is an answer to any situation
but i feel like there's a crack in that logic somewhere i just dont see it
SeraphFri, September 29, 2023 at 02:06 AM
yeah i figure it relates to resin efficiency, but remember that each run gives a variable amt of books/mats, and there are breakpoints in material amts that would equate to "1 run", so the goal would be to minimize a run
hmm actually, i wonder if we can formulate this as an LP problem and plug into a solver
arti and weapon calcs alr use spreadsheet solvers, which work on similar principles, so could we just come up with a value of runs to minimize when constrained by mats/run, efficiency of crafting, etc?
arti and weapon calcs alr use spreadsheet solvers, which work on similar principles, so could we just come up with a value of runs to minimize when constrained by mats/run, efficiency of crafting, etc?
Whalien | Despises CraftingFri, September 29, 2023 at 02:16 AM
right, im saying that because we're maximizing the amount of output, there's no better way to minimize the number of runs, at least from a crafting perspective
however i think this is expanding to a "how many runs should i try to do" question which is definitely a much bigger topic
however i think this is expanding to a "how many runs should i try to do" question which is definitely a much bigger topic
SeraphFri, September 29, 2023 at 02:18 AM
ah, so like if we have all the materials alr, we technically dont need to do any runs, but we still wanna make sure that we get the most bang for our buck with what we have
hmmmmm
hmmmmm
Whalien | Despises CraftingFri, September 29, 2023 at 02:19 AM
well, even if we dont already have the materials, assuming my strat is actually statistically optimal, there's no way to get "more" mats with a different strats, therefore there's no strategy that causes you to do fewer runs
this is all "runs first think later" tho, not "think first then do runs" which might be a much more interesting question
SeraphFri, September 29, 2023 at 02:21 AM
ok...so our goal is given any N number of materials of some R rarity, we want to maximize our crafting value gained in terms of material units U which is the amt in the lowest tier material
now how tf do we prove this shit works?
Whalien | Despises CraftingFri, September 29, 2023 at 02:22 AM
i think mathematically we came to an agreement that my strat should work, however it didn't work out in sims and we're kinda scratching our heads as to why
SeraphFri, September 29, 2023 at 02:24 AM
your key point is that for 3N+2 its always good to craft refund until reaching 3N, and at large enough 3N+1 it might be good to craft refund until 3N, yeah?
hmm lemme try to work through this
refunding 3N+1 to get another higher tier mat would require a minimum N>=2, since 2 crafts proccing are needed to get another craft back
refunding 3N+1 to get another higher tier mat would require a minimum N>=2, since 2 crafts proccing are needed to get another craft back
at N=2, you need to proc both times, for a 0.25^2 chance of crafting a double
N=3 needs proc 2 times out of 3, so your chances would be 3choose2 (arrange such that any 2 crafts out of 3 proc)x 0.25^2 (chance to hit jackpot twice) x 0.75 (failure once)
N=3 needs proc 2 times out of 3, so your chances would be 3choose2 (arrange such that any 2 crafts out of 3 proc)x 0.25^2 (chance to hit jackpot twice) x 0.75 (failure once)
in addition, if you proc the 2 refunds on N=3, the remaining craft has the capacity now to use double
if we use double on N=3 all the way, chance of getting extra "craft" is 3choose1 x 0.1 x 0.9^2, and the same logic applies that if we succeed on getting the extra "craft" we may continue now using the double to get potentially more
say we proc double on 1st craft, we have 3-1 = 2 remaining crafts to get more doubles, as compared to refund with only 1 chance
say we proc double on 1st craft, we have 3-1 = 2 remaining crafts to get more doubles, as compared to refund with only 1 chance
havent checked the sim, but could it be that yall forgot smth abt the combinatorics, and how doubling technically gives extra chances for even more value?
hmm altho...since doubling passive gives higher tier and not base, the doubling only situation receives 1 higher, but the refund scenario gives another actual craft with its own chance to double
fuck my brain cant brain this shit
Whalien | Despises CraftingFri, September 29, 2023 at 04:09 AM
in order for 25% to be better than 10% you need the odds of you crafting an additional "+1 tier" to be higher
which is (chances of 2 pops) + (chances of 3 pops) which is 15,625%, which is higher than 10%
however i did just realize that if you pop the first two then the third would be crafted with 10% so
Whalien | Despises CraftingFri, September 29, 2023 at 04:13 AM
as to this, im kinda weirded out by the choice to assume only one pop
SeraphFri, September 29, 2023 at 10:15 AM
oh, idk if my logic is 100% right, but essentially im trying to see if theres any equivalent value gained between refund and double, and comparing those odds, so that we might be able to "cancel out" some bits if ever
so the important point is you need 2 refunds for 3N+1 to get another craft of higher tier, whereas an equivalent value for the double would only need 1 hit to duplicate the higher tier
so the important point is you need 2 refunds for 3N+1 to get another craft of higher tier, whereas an equivalent value for the double would only need 1 hit to duplicate the higher tier
1
TiBotFri, October 6, 2023 at 10:15 AM
This channel hasn't been active in the past week!
is_this_maddieFri, October 6, 2023 at 07:06 PM
@Whalien | Despises Crafting maths majors unite
Whalien | Despises CraftingFri, October 6, 2023 at 07:41 PM
oh fuck right i never fixed the python script i was writing
aaaaaaaaaaaaaaaaaaa fuck
i hate python
ok so i modified the program so it counts number of times each one won rather than the sum of products
im not understanding what's happening. i ran the test a few times (not that it actually matters) and getting the same result
gonna see if i can yoink some math major at my uni or something
nzpiefaceTue, October 17, 2023 at 03:39 PM
@Whalien | Despises Crafting bro can you just share your code
Whalien | Despises CraftingTue, October 17, 2023 at 06:03 PM
im gonna mark this as unread and get back to it, going out to touch grass rn
(my brother lost his phone so now i gotta take him to get a new one zzz)
https://gist.github.com/Whalien3520/6b87688487c5c843e05ae1ed79ff6daa
Code to count how often the new strategy is better than simply alwa...
Code to count how often the new strategy is better than simply always using the doubling - crafting.py
first time using github gist, guaranteed i fuck it up somehow
https://docs.google.com/spreadsheets/d/1UtpAAFdBIDvFcWIaiFPd3D8G1ClfRf2rO7thwp9_KI4/edit?usp=sharing
3n+1 strat comparison
Sheet
number,xq,eula,both,both/xq,both/eula,bool_both
9001,48,2528,2425,50.52083333,0.9592563291
9004,49,2538,2416,49.30612245,0.9519306541
9007,66,2514,2425,36.74242424,0.9645982498
9010,62,2532,2408,38.83870968,0.9510268562
9013,68,2487,2449,36.01470588,0.9847205468
9016,69,2478,2458,35.623188...
number,xq,eula,both,both/xq,both/eula,bool_both
9001,48,2528,2425,50.52083333,0.9592563291
9004,49,2538,2416,49.30612245,0.9519306541
9007,66,2514,2425,36.74242424,0.9645982498
9010,62,2532,2408,38.83870968,0.9510268562
9013,68,2487,2449,36.01470588,0.9847205468
9016,69,2478,2458,35.623188...
ssataeiSat, October 21, 2023 at 02:11 AM
@Whalien | Despises Crafting its always better to do refund strat
which is fortunate because refund strat doesnt need to account for usability of green books
at n+1, you need to get two refunds in 7 trials or less, which is a ~0.55505 chance
at n+2, you need to get one refund in 4 trials or less, which is a ~0.6836 chance
cause like assume the bonus crafter will always return int(greenbooks/3)*1.1 blue books, plus greenbooks % 2 * 1/3 blue books (accounting for resin value of green books)
which means u dont need to sim the whole set, you only need to figure out how many crafts your bonus crafter gets to work with
then instead of simming the refund crafter, just assume they always get the required refunds in x trials, and account for probability later
initialBooks [ 0 0 11] attempts: 3
bookswhendonewithrefund [0 3 3]
refundStrat: [0.0, 4.1, 0.0] 4.1
ungabunga: [0.0, 3.3000000000000003, 2.0] 3.96667
============refund strat better============
initialBooks [ 0 0 14] attempts: 4
bookswhendonewithrefund [0 4 3]
refundStrat: [0.0, 5.1, 0.0] 5.1
ungabunga: [0.0, 4.4, 2.0] 5.06667
============refund strat better============
initialBooks [ 0 0 17] attempts: 5
bookswhendonewithrefund [0 5 3]
refundStrat: [0.0, 6.1, 0.0] 6.1
ungabunga: [0.0, 5.5, 2.0] 6.16667
============ungabunga strat better============
initialBooks [ 0 0 20] attempts: 6
bookswhendonewithrefund [0 6 3]
refundStrat: [0.0, 7.1, 0.0] 7.1
ungabunga: [0.0, 6.6000000000000005, 2.0] 7.26667
============ungabunga strat better============
initialBooks [ 0 0 19] attempts: 6
bookswhendonewithrefund [0 6 3]
refundStrat: [0.0, 7.1, 0.0] 7.1
ungabunga: [0.0, 6.6000000000000005, 1.0] 6.93333
============refund strat better============
initialBooks [ 0 0 22] attempts: 7
bookswhendonewithrefund [0 7 3]
refundStrat: [0.0, 8.1, 0.0] 8.1
ungabunga: [0.0, 7.700000000000001, 1.0] 8.03333
============refund strat better============
initialBooks [ 0 0 25] attempts: 8
bookswhendonewithrefund [0 8 3]
refundStrat: [0.0, 9.1, 0.0] 9.1
ungabunga: [0.0, 8.8, 1.0] 9.13333
============ungabunga strat better============
initialBooks [ 0 0 28] attempts: 9
bookswhendonewithrefund [0 9 3]
refundStrat: [0.0, 10.1, 0.0] 10.1
ungabunga: [0.0, 9.9, 1.0] 10.23333
============ungabunga strat better============
tl;dr the number of crafts you can "waste" on your refund crafter and still come out ahead with is 4 at n+2, and 7 at n+1
and since refund strat is always worse once u pass that trial count, u dont actually care how many books there are
as long as there are at least 14 green books for an n+2 value, and 22 green books for a n+1 value
oh also this is the same for purple books (obv) and assumes that if your green book count is divisible by 3, it is always better to use the bonus crafter
Whalien | Despises CraftingSat, October 21, 2023 at 03:21 AM
can you share your code for that, i get the feeling you're doing average resin value for one but not the other, but i cant be sure
ssataeiSat, October 21, 2023 at 03:21 AM
uhhhhhhhhh sure lmao
sec
Whalien | Despises CraftingSat, October 21, 2023 at 03:21 AM
i repurposed the code for the 3n+1 math for 3n+2 (i say repurpose i edited one number)
https://gist.github.com/Whalien3520/61a0d80fdfe368b3fb886858dc69ca0f
https://docs.google.com/spreadsheets/d/13ECCKPUP87t-NT8VyMvqq_6nHlcACdQ3O0ck7OseuCE/edit#gid=1091117399
https://gist.github.com/Whalien3520/61a0d80fdfe368b3fb886858dc69ca0f
https://docs.google.com/spreadsheets/d/13ECCKPUP87t-NT8VyMvqq_6nHlcACdQ3O0ck7OseuCE/edit#gid=1091117399
2mod3.py
GitHub Gist: instantly share code, notes, and snippets.
(this is for test cases of starting mats between 9000 and 10000)
ssataeiSat, October 21, 2023 at 03:23 AM
hf lmao
import numpy as np
#cba typing
refund = "Refund"
bonus = "Bonus"
refundChance = 0.25
bonusChance = 0.1
def asdf(craftType):
tempPurple = 0
tempBlue = 1
tempGreen = -3
if craftType == refund:
if np.random.rand() < refundChance:
tempGreen += 1
elif craftType == bonus:
if np.random.rand() < bonusChance:
tempBlue += 1
return np.array([tempPurple, tempBlue, tempGreen])
def zxcv(bnm):
return np.array([bnm[0], (int(bnm[2]/3)*1.1)+bnm[1], bnm[2] % 3]), (int(bnm[2]/3)*1.1)+bnm[1]+(bnm[2] % 3)/3
def qwer(initialBooks, attempts):
ungabunga = zxcv(np.array(initialBooks))
print("initialBooks", initialBooks, " attempts:", attempts)
initialBooks[1] += attempts
initialBooks[2] += (3-initialBooks[2] % 3)
initialBooks[2] -= attempts*3
print("bookswhendonewithrefund", initialBooks)
# while initialBooks[2] >= 3 and initialBooks[2] % 3 > 0:
# initialBooks += asdf(refund)
hjkl = zxcv(np.array(initialBooks))
print("refundStrat:", list(hjkl[0]),round(hjkl[1], 5))
print("ungabunga:", list(ungabunga[0]),round(ungabunga[1], 5))
if hjkl[1] > ungabunga[1]:
print("============refund strat better============")
else:
print("============ungabunga strat better============")
return hjkl, ungabunga, hjkl[1] > ungabunga[1]
for x in range(1,10):
qwer(np.array([0,0,x*3+1]), x)
# n+2 = 4 trials
# n+1 = 7 trials
ssataeiSat, October 21, 2023 at 03:24 AM
essentially there is no randomness in that output
Whalien | Despises CraftingSat, October 21, 2023 at 03:24 AM
im gonna admit it's 10pm where i am, so i might only get back to you tomorrow on this
ssataeiSat, October 21, 2023 at 03:24 AM
sure np
for tmrw's you, another way of thinking abt it is like,
for n+2, if xq fails 3 crafts and succeeds one (total 4), you get more mats
if xq fails 4 crafts and succeeds one (total 5), you get less mats
for n+2, if xq fails 3 crafts and succeeds one (total 4), you get more mats
if xq fails 4 crafts and succeeds one (total 5), you get less mats
Whalien | Despises CraftingSat, October 21, 2023 at 04:05 AM
ok so i have NOT gotten through the code yet (i really should just re-format it with new variable names) but im gonna actually leave that to tomorrow me
but i think if what you said is actually accurate to what you wrote then it feels like comparing "how many times can this fail before it's worse than the average case of a different strat"
which feels like an apples to oranges comparison
like you're not accounting for the times it succeeds, which is what i strove to do previously
ssataeiSat, October 21, 2023 at 04:08 AM
yeah
ive assumed you get the minimum number of successes in x trials to divide by 3
and if you get more successes:
- 1: it was better to stop refund crafting when u hit a multiple of 3
- 2: refund strat is even better in that case
- 1: it was better to stop refund crafting when u hit a multiple of 3
- 2: refund strat is even better in that case
and the 14/22 numbers are "how many mats do you need to actually do x amt of trials"
i havent done any calcs on average output of each strat, only "when is it better to refund strat"
oh also figured out why newstrat lost to eula in ur code
tl;dr xingqiu committed election fraud
remove xq and it’ll converge to 55%/68%
Veggie | 1.5x+0.75/x-1Sat, October 21, 2023 at 10:14 AM
ssataeiSat, October 21, 2023 at 10:42 AM
shouldn’t y always = 0 when x is divisible by 3?
Whalien | Despises CraftingSat, October 21, 2023 at 11:48 AM
ok so i think i managed to rewrite ssataei's code so it's actually legible
import numpy as np
def refundCraft(initArray):
retTier2 = initArray[0];
retTier1 = int(initArray[2] / 3) * 1.1 + initArray[1];
retTier0 = initArray[2] % 3;
tier1equiv = retTier1 + retTier0/3;
return np.array([retTier2, retTier1, retTier0]), tier1equiv
def compare(initialBooks, attempts):
eula = refundCraft(initialBooks)
print("Initial books:", initialBooks, " Attempts:", attempts)
# round tier 0 mats up to nearest multiple of 3
initialBooks[2] += (3-initialBooks[2] % 3)
initialBooks[1] += attempts
initialBooks[2] -= attempts*3
print("Books after refund: ", initialBooks)
strat = refundCraft(np.array(initialBooks))
print("strat: list(strat[0]), round(strat[1], 5))
print("eula: list(eula[0]), round(eula[1], 5))
if strat[1] > eula[1]:
print("============refund strat better============")
else:
print("============ungabunga strat better============")
return strat, eula, strat[1] > eula[1]
for x in range(1, 10):
compare(np.array(0, 0, x * 3 + 1), x)
(there was a lot of unused code which i just didn't bother rewriting)
yea so my problem with this is that you're assuming nearly the worst case for the strat--you only get x attempts to craft and you assume it pops only once out of those attempts--and comparing it to the average case of the refund fullsend
Whalien | Despises CraftingSat, October 21, 2023 at 11:50 AM
im gonna check that but it takes like an hour to get output so gonna be a bit
Whalien | Despises CraftingSat, October 21, 2023 at 11:51 AM
i think this matches what we've seen, basically the strat seems to do worse so the math vs the stats dont seem to add up
ssataeiSat, October 21, 2023 at 11:58 AM
oh
uh
that code won’t work
refundcraft wasn’t implemented in the final code
Whalien | Despises CraftingSat, October 21, 2023 at 12:00 PM
?
ssataeiSat, October 21, 2023 at 12:00 PM
average case of the eula fullsend
sec
Whalien | Despises CraftingSat, October 21, 2023 at 12:00 PM
refundCraft is the zxcv(bnm)
ssataeiSat, October 21, 2023 at 12:01 PM
oh
Whalien | Despises CraftingSat, October 21, 2023 at 12:01 PM
m
ssataeiSat, October 21, 2023 at 12:01 PM
but yes it assumes worst case for newstrat
aka “at what point is newstrat definitely better than fullsend eula”
to reduce observation space to 7 or less attempts
Whalien | Despises CraftingSat, October 21, 2023 at 12:03 PM
yea so idt that's a fair comparison, it only shows..what it was meant to. how many fails it takes for strat to become worse than eula
which like if you assume strat succeeds first one then pops (refund) on everything after, and compare it to fullsend eula popping 0 times, that's gonna be shit too
ssataeiSat, October 21, 2023 at 12:03 PM
well no this is specifically worst case
Whalien | Despises CraftingSat, October 21, 2023 at 12:04 PM
worst case aside from, well, it literally popping never at all
ssataeiSat, October 21, 2023 at 12:04 PM
2nd part is to hand calc 2-7 attempts for two successes
worst case where it’s still better
Whalien | Despises CraftingSat, October 21, 2023 at 12:05 PM
ill be waiting for that part 2 then, just felt like this was much ado about nothing
ssataeiSat, October 21, 2023 at 12:06 PM
i mean i can already tell you the answer is going to basically be 14/22
Whalien | Despises CraftingSat, October 21, 2023 at 12:07 PM
it looks kinda weird that for higher tier mats, strat does seem to be better, but not when you factor in the low tier mats
(obviously when mats=3n, the strat does jack all)
(obviously when mats=3n, the strat does jack all)
oh shit i think that's it
before all the programming happened, my calcs only cared about the [tier+1] mats that were produced, without factoring in the [tier+0] mat that was left over
Veggie | 1.5x+0.75/x-1Sat, October 21, 2023 at 12:11 PM
Whalien | Despises CraftingSat, October 21, 2023 at 12:11 PM
what is 10^6 in this context
Veggie | 1.5x+0.75/x-1Sat, October 21, 2023 at 12:12 PM
iterations of simulation
Whalien | Despises CraftingSat, October 21, 2023 at 12:12 PM
ah
@itzsomebody | chris i think i misunderstood you while you were active on this ticket, and for that i do apologize. i think veggie's graphs show what's going on
if you factor in the leftover single mat that remains after full-refund, the efficiency of the strat does not overcome the 1/3 "advantage"
if you factor in the leftover single mat that remains after full-refund, the efficiency of the strat does not overcome the 1/3 "advantage"
which i think kinda ties into seraph's point to factor in future crafts?
if you have mats leftover then you should factor in that 'product' if you plan to use it in the future
ssataeiSat, October 21, 2023 at 12:20 PM
Veggie | 1.5x+0.75/x-1Sat, October 21, 2023 at 12:20 PM
I mean technically that graph is nothing new since it assumes lower mats have that value when used for further crafting, and it was already known that bonus is slightly better than refund
ssataeiSat, October 21, 2023 at 12:26 PM
so, from the previous "worst case" stuff, can we assume that for any input greater than 22, newstrat > only eula
Whalien | Despises CraftingSat, October 21, 2023 at 12:28 PM
no?
i thought it was established eula > strat
based on what you did anyways
ssataeiSat, October 21, 2023 at 12:29 PM
uh the conclusion of my findings were:
at 3n+2, if you have at least 14 mats, newstrat > eula
ssataeiSat, October 21, 2023 at 12:29 PM
at 3n+1 if you have at least 22 mats, newstrat > eula
Whalien | Despises CraftingSat, October 21, 2023 at 12:29 PM
this is literally your code but rewritten no?
you're assuming near-worst-case for the strat it should definitely become worse than eula after a point
ssataeiSat, October 21, 2023 at 12:31 PM
mhm
but in the case of 22 mats, you need to hit 2/7 successes
which is a ~0.55505 chance
if you only had 19 mats, you could fail 5 times and still be below the "eula threshold"
but if you failed 5 times, you wouldnt have enough books to reach n+3
aka you only have 6 crafts, and the chance of getting 2/6 successes is 0.46606
Whalien | Despises CraftingSat, October 21, 2023 at 12:34 PM
the only thing i actually understood is 'if you failed 5 times, you cant reach n+3' so im gonna need a step by step
first how did you get 55.505% chance
first how did you get 55.505% chance
Whalien | Despises CraftingSat, October 21, 2023 at 12:35 PM
it was, but your approach is different from mine, and it's not one that i think answers the question
yours is finding "how long before worst case makes it actually worse" while mine is "how long before average case makes it actualyl bettter"
ssataeiSat, October 21, 2023 at 12:36 PM
55% is chance of at least 2 successes in 7 trials, with a probability of 0.25
again, worst case because you would stop if u got two
Whalien | Despises CraftingSat, October 21, 2023 at 12:36 PM
hm, at least 2
ssataeiSat, October 21, 2023 at 12:36 PM
again, worst case
Whalien | Despises CraftingSat, October 21, 2023 at 12:37 PM
ok i get that math now, probability of 0 or 1 is 44.49 which matches
ssataeiSat, October 21, 2023 at 12:38 PM
right, so chance of 2/6 is 46%
which is uh, not good.
so we can assume that if you have at least 7n+1 mats, new strat is better
we just dont know about 6n+1, etc
Whalien | Despises CraftingSat, October 21, 2023 at 12:39 PM
im gonna think about this becuase im just now understanding where you're coming from
but you still have to answer why your code was saying eula(refund) > strat earlier
ssataeiSat, October 21, 2023 at 12:40 PM
it uh, wasnt?
at least what i typed didnt
i take no responsibility for whatever code i posted only god knows what that shit does now
Whalien | Despises CraftingSat, October 21, 2023 at 12:41 PM
what the hell dude
rarepossumSat, October 21, 2023 at 12:41 PM
Welcoming to coding
Past me was an idiot