Latest Entries
English | 繁體中文
1. Considering the 3 digits from 000 to 999, if 3 identical digits appear, the score can be obtained. What is the average score of these 1,000 numbers? (EX: 111 scores 1 point, 999 scores 9 points)
2. Continuation 1. If 0 can replace other numbers, what will the total average become? (EX:000 can be regarded as 999 to get 9 points)
3. Consider the 5 digits from 00000 to 99999, from left to right consecutively appearing more than 3 of the same number can get their corresponding connection scores, NNNXX can get 3N points, NNNNX can get 4N points, and NNNNN can get 5N points. 0 can replace other numbers. What is the total average of these 100,000 numbers?
Before solving the problem, explain to the reader the connection between these three questions and the slot machine model. If we replace the numbers 1~9 with the pay symbol that appears in the game, and 0 with the wild symbol, then these three questions can be regarded as three slot games.
For the first two questions, readers who are familiar with permutations and combinations should be able to get answers easily. The third question is a little bit more complicated, because there are more cases to be considered, and the amount of calculation will be larger.
Let me explain to you first that when calculating the model of the slot machine, the probability engineer will adjust the model by creating a spreadsheet. The spreadsheet is actually storing the calculation process in an Excel file. The following will demonstrate how to use Excel to create a spreadsheet.
In addition my purpose is to import the model thinking of the slot machine, I will solve the problem from this perspective. Therefore the method given may not be the fastest way to solve these three problems. Readers are also asked to focus on the thinking of solving the problem. This will be more helpful for subsequent learning.
I use I0~I9 to represent the numbers 0-9, and enter the number of times each digit appears in the table on the left, and then calculate how many digits there are in each digit, and how many three-digits combination in total.
In the right part, the number combination that can get the score is listed, and then the number of occurrences of each score combination is calculated. After the score is multiplied, the total score and the total average can be obtained.
Here's why we need to use the table on the left, because when the number of occurrences of each number is not equal (EX: the hundred digits have 3 I1/I3/I4, 2 I6), just change the weight of the table. The data is updated, and the results of this calculation are displayed almost simultaneously.
Followed by the method of the second question, use the form of the first question to expand.
Here is a little explanation of the method of the second question, because 0 can replace other numbers, so the way to get 3 I1 will become I0 or I1. It can be represented by I01 below, and there will be a total of 2*2*2=8 In this way, it also includes I0-I0-I0 where will be specially scored. One reason is that its score is usually different from others, and the other reason is that it is convenient for other score combinations. Deduct the number of points it has scored.
Followed by the practice of the third question, the second question table is expanded.
First X0 represents a number that will not allow 0 to be continuous (1-9 in total 9), X01 represents a number that will not allow I1 to be continuous (2 to 9 in total 8), and then the part of the score combination is 5-digits to 3-digits in sequence, please note the scores of I0-I0-I0-I0-X0. At first glance, it seems to be a set of 4 consecutive scores of I0, but because I0 can replace any number, so regardless of the single digit Which number N appears in X0 will make this group of numbers form a 5-of-a-kind score of N. Therefore it is necessary to compare N's 5-of-a-kind score or I0's 4-of-a-kind score for I1~I9, and deduct the number of repetitions of low scores. This is what the newly added table on the far right is doing.
Note: The reel strips used in the par sheet may not be the real strips of the game.
Parsheet_01 - Basic Concept
1.考慮000~999的3位數字中,出現3個相同的數字可以得到分數,試問這1000個3位數的平均分數是多少?(EX:111得1分,999得9分)
2.延續1.若0可以取代其他數字,則總平均會變成多少?(EX:000可當作999得9分)
3.考慮00000~99999的5位數字,由左至右連續出現3個以上的相同數字可以得到各自的對應連線分數,NNNXX可以得3N分,NNNNX可以得到4N分,NNNNN可以得到5N分,0可以取代其他數字,則這10萬個5位數的總平均是多少?
在解題之前先跟讀者說明一下這三道題目跟老虎機模型的關聯,如果我們把數字1~9換成遊戲出現的得分圖標,0換成是百搭圖標,那這三道題就可以看做是三款老虎機遊戲了。
前兩道題目,對於熟悉排列組合的讀者,應該可以很容易就得到答案。第三題就稍微有一點複雜了,也不是說很難算是要考慮的情況比較多,計算量會比較大。
這邊就要先跟大家說明一下,機率工程師在計算老虎機的模型時,會透過建立試算表來調整模型。所謂的試算表,其實就是把計算的過程存在Excel文件裡面,下面會示範怎麼用Excel建立試算表。
另外因為我的目的是導入老虎機的模型思維,所以會從這個角度去解決問題,因此給出來的作法可能不是解決這3個問題最快速的方法,也請讀者把重點放在解題的思維上面,這對後續的學習會比較有幫助。
首先我將數字0~9用I0~I9表示,並將各別數字在每一位數出現的次數輸入進左邊的表格中,接著計算每一位數共有幾個數字,以及總共有幾個三位數組合。
右側的部分,則是將能夠得到分數的數字組合條列出來,接著計算每一個得分組合出現的次數,乘上分數後就可以取得總得分及總平均。
這邊說明一下為什麼要使用左側的表格,因為當每一個數字出現的次數不等的時候(EX:百位數有3個I1/I3/I4、2個I6),只要更改表格的權重就可以更新數據,並且這個計算結果幾乎是同步顯示的。
接著是第二題的作法,用第一題的表格再去做擴充
這邊稍微說明一下第二題的作法,因為0可以取代其他數字,所以拿到3個I1的方式會變成I0或I1都可以,用下方I01來表示,總共會有2*2*2=8種方式,其中還包刮了3個都是I0的情況,3個都是I0的情況會特別拿出來計分,一個原因是通常他的分數會跟別人不同,另一個原因是方便其他得分組合扣掉它的得分次數。
接著是第三題的作法,將第二題的表格進行擴充。
首先X0代表不會讓0連續的數字(1~9共9個),X01代表不會讓I1連續的數字(2~9共8個),然後得分組合的部分5位數到3位數依次排好,這邊需要特別注意的是I0-I0-I0-I0-X0的得分,乍看之下好像是一組I0的4連續得分,但因為I0可以取代任意數字,所以不論個位數的X0出現哪一個數字N,都會讓這組數字形成N的5連線得分。因此必須針對I1~I9去比較N的5連線分數高還是I0的4連線分數高,將低分的重複次數扣掉,這就是最右邊新增的表格在做的事。
注意:試算表中使用滾輪未必為遊戲真實滾輪。
模型教學01 - 基本概念
Game Instructions
Before starting to learn the slot machine model, there are a few math questions, please read and think about it:1. Considering the 3 digits from 000 to 999, if 3 identical digits appear, the score can be obtained. What is the average score of these 1,000 numbers? (EX: 111 scores 1 point, 999 scores 9 points)
2. Continuation 1. If 0 can replace other numbers, what will the total average become? (EX:000 can be regarded as 999 to get 9 points)
3. Consider the 5 digits from 00000 to 99999, from left to right consecutively appearing more than 3 of the same number can get their corresponding connection scores, NNNXX can get 3N points, NNNNX can get 4N points, and NNNNN can get 5N points. 0 can replace other numbers. What is the total average of these 100,000 numbers?
Before solving the problem, explain to the reader the connection between these three questions and the slot machine model. If we replace the numbers 1~9 with the pay symbol that appears in the game, and 0 with the wild symbol, then these three questions can be regarded as three slot games.
For the first two questions, readers who are familiar with permutations and combinations should be able to get answers easily. The third question is a little bit more complicated, because there are more cases to be considered, and the amount of calculation will be larger.
Let me explain to you first that when calculating the model of the slot machine, the probability engineer will adjust the model by creating a spreadsheet. The spreadsheet is actually storing the calculation process in an Excel file. The following will demonstrate how to use Excel to create a spreadsheet.
In addition my purpose is to import the model thinking of the slot machine, I will solve the problem from this perspective. Therefore the method given may not be the fastest way to solve these three problems. Readers are also asked to focus on the thinking of solving the problem. This will be more helpful for subsequent learning.
Model Descriptions
Game Calculation
I use I0~I9 to represent the numbers 0-9, and enter the number of times each digit appears in the table on the left, and then calculate how many digits there are in each digit, and how many three-digits combination in total.
In the right part, the number combination that can get the score is listed, and then the number of occurrences of each score combination is calculated. After the score is multiplied, the total score and the total average can be obtained.
Here's why we need to use the table on the left, because when the number of occurrences of each number is not equal (EX: the hundred digits have 3 I1/I3/I4, 2 I6), just change the weight of the table. The data is updated, and the results of this calculation are displayed almost simultaneously.
Followed by the method of the second question, use the form of the first question to expand.
Here is a little explanation of the method of the second question, because 0 can replace other numbers, so the way to get 3 I1 will become I0 or I1. It can be represented by I01 below, and there will be a total of 2*2*2=8 In this way, it also includes I0-I0-I0 where will be specially scored. One reason is that its score is usually different from others, and the other reason is that it is convenient for other score combinations. Deduct the number of points it has scored.
Followed by the practice of the third question, the second question table is expanded.
First X0 represents a number that will not allow 0 to be continuous (1-9 in total 9), X01 represents a number that will not allow I1 to be continuous (2 to 9 in total 8), and then the part of the score combination is 5-digits to 3-digits in sequence, please note the scores of I0-I0-I0-I0-X0. At first glance, it seems to be a set of 4 consecutive scores of I0, but because I0 can replace any number, so regardless of the single digit Which number N appears in X0 will make this group of numbers form a 5-of-a-kind score of N. Therefore it is necessary to compare N's 5-of-a-kind score or I0's 4-of-a-kind score for I1~I9, and deduct the number of repetitions of low scores. This is what the newly added table on the far right is doing.
Simulation Result
File Download
Here is the par sheet of this game, if you are interested, you can download the par sheet file for research.Note: The reel strips used in the par sheet may not be the real strips of the game.
Parsheet_01 - Basic Concept
特色說明
在開始學習老虎機的模型之前,有幾道數學題先請各位讀著思考看看:1.考慮000~999的3位數字中,出現3個相同的數字可以得到分數,試問這1000個3位數的平均分數是多少?(EX:111得1分,999得9分)
2.延續1.若0可以取代其他數字,則總平均會變成多少?(EX:000可當作999得9分)
3.考慮00000~99999的5位數字,由左至右連續出現3個以上的相同數字可以得到各自的對應連線分數,NNNXX可以得3N分,NNNNX可以得到4N分,NNNNN可以得到5N分,0可以取代其他數字,則這10萬個5位數的總平均是多少?
在解題之前先跟讀者說明一下這三道題目跟老虎機模型的關聯,如果我們把數字1~9換成遊戲出現的得分圖標,0換成是百搭圖標,那這三道題就可以看做是三款老虎機遊戲了。
前兩道題目,對於熟悉排列組合的讀者,應該可以很容易就得到答案。第三題就稍微有一點複雜了,也不是說很難算是要考慮的情況比較多,計算量會比較大。
這邊就要先跟大家說明一下,機率工程師在計算老虎機的模型時,會透過建立試算表來調整模型。所謂的試算表,其實就是把計算的過程存在Excel文件裡面,下面會示範怎麼用Excel建立試算表。
另外因為我的目的是導入老虎機的模型思維,所以會從這個角度去解決問題,因此給出來的作法可能不是解決這3個問題最快速的方法,也請讀者把重點放在解題的思維上面,這對後續的學習會比較有幫助。
模型說明
遊戲算法
首先我將數字0~9用I0~I9表示,並將各別數字在每一位數出現的次數輸入進左邊的表格中,接著計算每一位數共有幾個數字,以及總共有幾個三位數組合。
右側的部分,則是將能夠得到分數的數字組合條列出來,接著計算每一個得分組合出現的次數,乘上分數後就可以取得總得分及總平均。
這邊說明一下為什麼要使用左側的表格,因為當每一個數字出現的次數不等的時候(EX:百位數有3個I1/I3/I4、2個I6),只要更改表格的權重就可以更新數據,並且這個計算結果幾乎是同步顯示的。
接著是第二題的作法,用第一題的表格再去做擴充
這邊稍微說明一下第二題的作法,因為0可以取代其他數字,所以拿到3個I1的方式會變成I0或I1都可以,用下方I01來表示,總共會有2*2*2=8種方式,其中還包刮了3個都是I0的情況,3個都是I0的情況會特別拿出來計分,一個原因是通常他的分數會跟別人不同,另一個原因是方便其他得分組合扣掉它的得分次數。
接著是第三題的作法,將第二題的表格進行擴充。
首先X0代表不會讓0連續的數字(1~9共9個),X01代表不會讓I1連續的數字(2~9共8個),然後得分組合的部分5位數到3位數依次排好,這邊需要特別注意的是I0-I0-I0-I0-X0的得分,乍看之下好像是一組I0的4連續得分,但因為I0可以取代任意數字,所以不論個位數的X0出現哪一個數字N,都會讓這組數字形成N的5連線得分。因此必須針對I1~I9去比較N的5連線分數高還是I0的4連線分數高,將低分的重複次數扣掉,這就是最右邊新增的表格在做的事。
模擬結果
檔案下載
以上就是這一款遊戲的模型教學,有興趣的可以自行下載試算表研究注意:試算表中使用滾輪未必為遊戲真實滾輪。
模型教學01 - 基本概念
留言
由模型怎么得出模拟结果的
回覆刪除要另外寫模擬程式來驗證喔
刪除模拟程式有教程吗?该怎么写?谢谢指导
刪除最近想学这个,希望你可以指导下
刪除目前文章以模型計算為主,程式驗證的部分之後會另外教學。
刪除