Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-2024-05-13· OpenAIAi2 WildChat-4.8M (AI2)

iSkillBonus = MINMAX(-30, (int) (gauss_random(0, 5) + 0.5f), 30); if (abs(iSkillBonus)…

  1. User

    iSkillBonus = MINMAX(-30, (int) (gauss_random(0, 5) + 0.5f), 30);

    if (abs(iSkillBonus) <= 20) iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4); else iNormalHitBonus = -2 * iSkillBonus + number(1, 5);

    is the probability of rolling %60 average damage is equal to rolling %12 average damage? Or probability of rolling %27 is equal to probability of rolling %-10?

  2. Assistant

    To determine if the probability of specific damage outcomes is equal, such as %60 average damage vs. %12 average damage or %27 vs. %-10, we need to first understand how the iNormalHitBonus is computed based on the iSkillBonus.

    The computation of iSkillBonus involves:

    1. Using gauss_random(0, 5) which presumably generates a random value from a Gaussian distribution with a mean of 0 and a standard deviation of 5.
    2. Clipping the result to the interval ([-30, 30]).

    Once iSkillBonus is determined, iNormalHitBonus is calculated differently based on the magnitude of iSkillBonus.

    Case 1: |iSkillBonus| ≤ 20

    [ iNormalHitBonus = -2 \cdot iSkillBonus + \text{abs}( \text{random in } (-8,8) + \text{random in } (-8,8)) + \text{random in } (1,4) ]

    Case 2: |iSkillBonus| > 20

    [ iNormalHitBonus = -2 \cdot iSkillBonus + \text{random in } (1,5) ]

    Given the complexity of these formulas, the distributions of outcomes for iNormalHitBonus can be rather intricate and would depend on the interactions between iSkillBonus, the additional random variables, and the conditional logic.

    Probability Comparisons:

    1. 60% vs 12% Average Damage: These percentage damage outcomes correspond to distinct and potentially distant values of iNormalHitBonus. They are not guaranteed to have symmetric probabilities due to the non-uniform and conditionally scattered nature of the distribution.

    2. 27% vs -10% Average Damage: Similarly, these represent specific outcomes in another range of iNormalHitBonus. Differences in symmetry and probability density functions make it non-trivial to assert equality without further statistical analysis or explicit computation.

    Gaussian Influence:

    Since gauss_random(0, 5) introduces a Gaussian component with a mean centered at 0, more frequently occurring values of iSkillBonus will be closer to 0 due to the bell-shaped nature of the distribution. Extreme values (like -30 or 30) will be less probable.

    Hit Bonus Distribution:

    For different |iSkillBonus| values, the sums and additional terms yield different distributions, potentially with different variance and central tendencies. Thus probabilities for specific outcomes (e.g., %60 vs %12) will generally differ.

    Conclusion:

    • You cannot straightforwardly state that probabilities for specific damages (like 60% vs. 12% or 27% vs. -10%) are equal without performing thorough statistical evaluation or simulations.
    • The varied nature of iNormalHitBonus based on |iSkillBonus| and additional randomness points towards differing probabilities for these specific damage percentages.

    In summary, the complexity in the provided code's random number generation and conditional logic prevents easy assertion of equivalence in probability between specific average damage outcomes. Detailed probabilistic analysis or computational simulations would be required to determine the exact probabilities for each damage outcome.