房間內(nèi) 100 個(gè)人,每人有 100 塊,每分鐘隨機(jī)給另一個(gè)人 1 塊,最后這個(gè)房間內(nèi)的財(cái)富分布是怎樣的?(′?_?`)

簡(jiǎn)評(píng):反直覺(jué)的問(wèn)題,房間內(nèi)每個(gè)人隨機(jī)給于別人 1 元,你猜不到最后會(huì)發(fā)生什么。

--- Update ---
知友 KetoneHu 根據(jù)本文也寫了一篇相關(guān)的回答,推薦給大家:從熱力學(xué)看這個(gè)問(wèn)題
「這個(gè)體系用一句熱力學(xué)的語(yǔ)言來(lái)描述的話是:對(duì)于一個(gè)孤立系統(tǒng),有恒定數(shù)量的粒子和能量(對(duì)應(yīng)人和金錢),這些能量是怎么在粒子之間分布的?」

--- 原文 ---
前幾天我們?cè)賲⒓右粋€(gè)電氣工程與計(jì)算機(jī)科學(xué)的主題會(huì)議,遇到了 Uri Wilensky,他和我們分享了一個(gè)很有趣的分配模擬。

問(wèn)題是這樣的:

想象著,有一個(gè)房間,里面有 100 個(gè)人,每個(gè)人有 100 美元。每過(guò)一會(huì),每個(gè)有錢的人給隨機(jī)的其他人 1 美元,經(jīng)過(guò)一段時(shí)間后,房間內(nèi)的資金分配情況是怎樣

如果,你快速的思考,然后認(rèn)為「或多或少的趨于平均」,你這個(gè)想法并不孤單。

我問(wèn)了 5 個(gè)超級(jí)聰明的博士,他們也都有同樣的第一感覺(jué),認(rèn)為會(huì)趨于平均。

所以,真實(shí)的分布狀況應(yīng)該是如何呢,請(qǐng)看下面這個(gè) gif。

  • gif 的左上角是次數(shù),每次代表著一次財(cái)富的改變。
  • Y 軸顯示的是美元存量,初始 45 美元。
  • X 軸顯示的是 45 個(gè)人。
  • 上圖(紅色圖)顯示每時(shí),每人的財(cái)富。
  • 下圖(藍(lán)色圖)就是把紅色圖遞增排序了一下,方便查看。

不信這個(gè)結(jié)果么?你可以用 R、tidvverse 和 gganimate 代碼自己跑一跑。

不平等可能源于完全無(wú)害的政策和規(guī)則,你要時(shí)刻關(guān)注他們。

library(tidyverse)
library(gganimate)

NUMPLAYERS = 45
ROUNDS = 5000
INITWEALTH = 45

#initialize the bank
#columns wealths of the NUMPLAYERS players
#rows show wealths of each of the ROUNDS ticks of the clocks
bank = matrix(0, nrow = ROUNDS, ncol = NUMPLAYERS)
bank[1,] =  c(rep(INITWEALTH, NUMPLAYERS))

#function to give a dollar to someone other than oneself
get_recipient = function(player) {
  sample(setdiff(1:NUMPLAYERS, player), 1)}

#execute trades and update the ledger 
for (i in 2:ROUNDS) {
  #every player with wealth chooses another person to receive a buck
  recipients = sapply(which(bank[i - 1,] > 0), get_recipient)

  #table of the dollars owed each person
  count_table = table(recipients)
  
  #get the indices of the people owed money
  indices = as.integer(names(count_table))
  
  #everyone gives up a dollar, unless they are at zero
  bank[i,] = ifelse(bank[i - 1,] > 0, bank[i - 1,] - 1, bank[i - 1,])
  
  #selected people receive dollars
  bank[i, indices] = bank[i, indices] + count_table
}

####################Animate it
#Make a suitable long data frame
df = as.data.frame(bank)
names(df) = 1:NUMPLAYERS
df = df %>%
  mutate(frame = 1:ROUNDS) %>%
  gather(person, wealth, 1:NUMPLAYERS) %>%
  mutate(person = as.numeric(person)) %>%
  arrange(frame) %>%
  group_by(frame) %>%
  mutate(rank = rank(wealth, ties.method = "random")) %>%
  ungroup() %>%
  gather(histtype,playerid,c(person,rank)) %>%
  mutate(histtype = sprintf("Ordered by %s", histtype))

p <- ggplot(df, aes(x = playerid, y = wealth, frame = frame, fill=histtype)) +
  theme_minimal() +
  theme(panel.grid.major.x = element_blank(),
        panel.grid.minor = element_blank()) +
  geom_rect(aes( xmin = playerid - .4, xmax = playerid +.4, ymin = 0, ymax = wealth)) +
  scale_x_continuous(breaks = 1:NUMPLAYERS) +
  coord_cartesian(xlim = c(0, NUMPLAYERS), y = c(0, 5 * INITWEALTH)) +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(x='players',y='dollars') +
  facet_wrap( ~ histtype,ncol=1) +
  theme(legend.position = "none")
p

#set options for the animation package. Need ImageMagick installed on your computer
animation::ani.options(nmax = ROUNDS,
                       convert = 'C:\\Program Files\\ImageMagick-7.0.6-Q16')
#save the movie
gganimate(p, "dollar_stacked.mp4", interval = .01)

(R 語(yǔ)言版,Github:give_a_dollar.R

園長(zhǎng):我想,這就是運(yùn)氣吧。

原文:Counterintuitive problem: Everyone in a room keeps giving dollars to random others. You&amp;amp;#x27;ll never guess what happens next. - Decision Science News
延伸閱讀:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容