游戏王masterduel吧 关注:186,381贴子:8,130,711
  • 10回复贴,共1

关于十连抽UR的期望到底是多少

只看楼主收藏回复

懒得数学推导了,用蒙卡算了一下,基本上在2.26张左右


IP属地:山东1楼2025-01-01 12:13回复
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    // 抽卡函数
    int draw_cards(int ur_cards, int total_cards, int num_cards) {
    int ur_count = 0;
    for (int i = 0; i < num_cards; i++) {
    if (rand() % total_cards < ur_cards) {
    ur_count++;
    }
    }
    return ur_count;
    }
    // 模拟一场十连
    int simulate_game(int *ur_found_last_10) {
    int total_cards = 1000;
    int ur_cards = 25;
    int ur_card_count_in_game = 0;
    for (int round = 1; round <= 9; round++) {
    int ur_cards_in_round = draw_cards(ur_cards, total_cards, 8);
    ur_card_count_in_game += ur_cards_in_round;
    }
    // 第10包逻辑
    if (*ur_found_last_10 == 0) {
    // 上一次十连未抽到UR,第10包保底出1张UR
    ur_card_count_in_game += draw_cards(ur_cards, total_cards, 7);
    ur_card_count_in_game += 1;
    } else {
    // 上一次十连抽到UR,第10包按20%概率出UR
    ur_card_count_in_game += draw_cards(ur_cards, total_cards, 7);
    ur_card_count_in_game += draw_cards(1, 5, 1); // 20%概率
    }
    // 更新当前十连是否有UR
    *ur_found_last_10 = (ur_card_count_in_game > 0);
    return ur_card_count_in_game;
    }
    int main() {
    srand(time(NULL));
    int total_games = 1000000; // 设置模拟的总次数
    long long total_ur_cards = 0;
    int ur_found_last_10 = 1; // 初始化第0次十连状态为“抽到UR”
    for (int i = 0; i < total_games; i++) {
    total_ur_cards += simulate_game(&ur_found_last_10);
    }
    // 计算期望
    double expected_ur_cards = (double)total_ur_cards / total_games;
    printf("每次十连抽到UR的期望数量: %.4f\n", expected_ur_cards);
    return 0;
    }


    IP属地:山东2楼2025-01-01 12:14
    收起回复
      2025-08-25 01:34:17
      广告
      不感兴趣
      开通SVIP免广告
      请问一下30连0ur的概率


      IP属地:广东来自手机贴吧3楼2025-01-01 12:21
      收起回复
        反正我是1000钻2ur。有时候抽的多,但是有的时候抽的少,人家拿概率平衡你。


        IP属地:河北来自Android客户端4楼2025-01-01 12:33
        收起回复
          我感觉没这么高,经常啥都没有,有也不多


          IP属地:重庆来自Android客户端5楼2025-01-01 15:08
          回复
            大概就是一包两个ur


            IP属地:河北来自Android客户端6楼2025-01-01 15:56
            回复
              平均两张差不多


              IP属地:浙江来自iPhone客户端7楼2025-01-01 16:10
              回复
                不知道,我猛猛保底


                IP属地:广东8楼2025-01-01 16:12
                回复