Module:SummonProbabilitiesGraph

local p = {} local mw = mw local cargo = mw.ext.cargo local s = require 'Module:User:Ale1991/Statistics'

function p.summonProbabilitiesChart local n=(12-6)/0.5 local fromProb=6/100 local dp=0.5/100 local nextProb=fromProb+dp

local t='digraph SummonProbabilities {' local summon=0 local i=0 local from = tostring(i) .. ' 5★ p=' .. tostring(fromProb) local toProb=1

t= t .. '"' .. tostring(summon) .. '_' .. tostring(i) .. '" [label="' .. from .. '"];\n'

for summon=1,n do local nex = tostring(i) .. ' 5★ p=' .. tostring(nextProb) prob=s.BinomialDistribution(5,i,fromProb,1-fromProb) t= t .. '"' .. tostring(summon) .. '_' .. tostring(i) .. '" [label="' .. nex .. '"];\n' t= t .. '"' .. tostring(summon-1) .. '_' .. tostring(0) .. '"->"' .. tostring(summon) .. '_' .. tostring(i) .. '" [label="' .. tostring(prob) .. '"];\n' for i=1,5 do local to = tostring(i) .. ' 5★'			prob=s.BinomialDistribution(5,i,fromProb,1-fromProb) t= t .. '"' .. tostring(summon) .. '_' .. tostring(i) .. '" [label="' .. to .. '"];\n' t= t .. '"' .. tostring(summon-1) .. '_' .. tostring(0) .. '"->"' .. tostring(summon) .. '_' .. tostring(i) .. '" [label="' .. tostring(prob) .. '"];\n' end fromProb=nextProb nextProb=nextProb+dp end t=t .. '}'	return t end

return p