シートバッテングを極める部屋

「シートバッテングを極める部屋」の編集履歴(バックアップ)一覧に戻る

シートバッテングを極める部屋 - (2018/02/24 (土) 13:48:45) のソース

&bold(){シートバッティングを極める部屋}

*&bold(){投手も打者も『ガチ』でシートバッティングしたらどうなるか検証。}
*&bold(){乱数要素100%なので、その辺がわかってない人は今すぐページバックしてね。}

----

**カウントに依らず
**ストライク率・スイング率が一定であるケース

#region(ケース)
***前提条件
1) 打者の勝利条件:ホームラン・ヒット・四球
2) 投手の勝利条件:三振
3) 投手のストライク率(どの程度ストライクを投げるか)は一定
4) 打者のスイング率(どの程度スイングするか)は一定

***プログラム(見たい人だけ)
#region(VBA)
Sub Macro1()
'
' Macro1 Macro

    Dim mat As Integer     '試合数
    Dim win As Integer     '投手勝利回数
    Dim res As Double      '投手勝率
    Dim S As Integer       'ストライク
    Dim B As Integer       'ボール
    Dim PITCH As Double    'ストライク率
    Dim BATER As Double    'スイング率
    Dim x As Double
    Dim y As Double
    
    For i = 0 To 10
        PITCH = ActiveSheet.Cells(23 + i, 7)
        BATER = ActiveSheet.Cells(23 + i, 9)
        mat = 0
        win = 0
        
        For mat = 1 To 10000  '10000回繰返し
        
            '①試合前処理
             S = 0
             B = 0
            
            '②試合中処理
            Do While S < 3 And B < 4
            
                ActiveSheet.Cells(1, 1) = 1  '乱数更新用
                
                '変数読み
                P_S = ActiveSheet.Cells(20, 7)  '乱数(0.00~1.00)
                B_S = ActiveSheet.Cells(20, 9)  '乱数(0.00~1.00)
                P_C = ActiveSheet.Cells(21, 7)  '乱数(0.00~1.00)
                B_C = ActiveSheet.Cells(21, 9)  '乱数(0.00~1.00)
                
                
                If (PITCH >= P_S) Then      '投手・ストライク選択
                    If (BATER >= B_S) Then      '打者・スイング選択
                        If (B_C >= 0.75) Then
                            B = 100
                        Else
                            S = S + 1
                        End If
                    Else                        '打者・見送り選択
                        S = S + 1
                    End If
                    
                Else                        '投手・ボール選択
                    If (BATER >= B_S) Then      '打者・スイング選択
                        S = S + 1
                        If (S >= 3 And B_C >= 0.75) Then S = 2      'ファウル続行
                    Else                        '打者・見送り選択
                        B = B + 1
                    End If
                End If
            Loop
            
            '③試合後処理
            If S >= 3 Then win = win + 1
        Next
        
        mat = mat - 1
        res = win / mat
        ActiveSheet.Cells(23 + i, 11) = res
    
    Next
    
End Sub
#endregion(VBA)

***試行結果(カウント別)
#region(表のみかた)
各カウントについて、
投手のストライク率・打者のスイング率を元に10000回のフリーバッティングを行う。
その結果を、打者の勝利条件(打者の出塁率)基準で数値化する。最小0.000~最大1.000

例えば、0ストライク・0ボールで
投手のストライク率=50%・打者のスイング率=50%とすると、
打者の勝率は0.269(26.9%)。逆に投手の勝率は0.731(73.1%)となる。

投手がどれだけストライクを選択するか
打者がどれだけスイングするのか(経験則で)わかっていれば、
各カウント毎に投手or打者の勝率を求めることができる。
#endregion(表のみかた)

#region(表1)

#region(0ストライク)
#image(https://i.imgur.com/oC43Bgq.png,width=700,height=350)
#image(https://i.imgur.com/9KnyOVh.png,width=700,height=350)
#image(https://i.imgur.com/vSyjA4Q.png,width=700,height=350)
#image(https://i.imgur.com/W2oYXyx.png,width=700,height=350)
#endregion(0ストライク)


#region(1ストライク)
#image(https://i.imgur.com/Zwuh3fa.png,width=700,height=350)
#image(https://i.imgur.com/4muHLY2.png,width=700,height=350)
#image(https://i.imgur.com/MCY9Zbs.png,width=700,height=350)
#image(https://i.imgur.com/3j0EE1U.png,width=700,height=350)
#endregion(1ストライク)


#region(2ストライク)
#image(https://i.imgur.com/b8LyiV7.png,width=700,height=350)
#image(https://i.imgur.com/5g7oT7A.png,width=700,height=350)
#image(https://i.imgur.com/O8JOcix.png,width=700,height=350)
#image(https://i.imgur.com/LwSo1Oe.png,width=700,height=350)
#endregion(2ストライク)

#endregion(表1)

***試行結果(まとめ)
#region(グラフのみかた)
各カウントが推移するとともに、打者or投手の勝率がどの程度変化するか示す。
表1と同じく、打者の勝利条件(打者の出塁率)基準で数値化する。最小0.000~最大1.000
#endregion(グラフのみかた)

#region(グラフ1)
#image(https://i.imgur.com/edvlcHl.png,width=700,height=450)
#endregion(グラフ1)

***反証
&bold(){&color(red){ちょっと待てや 3ボール2ストライクで.330打てるか?}}
&bold(){&color(red){投手にストライク放られたら、逆立ちしても.250しか打てないやんけ!}}
↓
せや!minmax法つかえばええやん。検証が捗るで~
↓
次の章へつづく
#endregion(ケース)

----

**カウントによって
**ストライク率・スイング率が変化するケース

&color(red){(※速報版につき簡易報告)}

***前提条件
1) 打者の勝利条件:ホームラン・ヒット・四球
2) 投手の勝利条件:三振
3) 投手のストライク率(どの程度ストライクを投げるか)はカウント次第で変わる
4) 打者のスイング率(どの程度スイングするか)はカウント次第で変わる
5) [[ストライク率・スイング率の決定には、minmax法を使用する>https://ja.wikipedia.org/wiki/%E3%83%9F%E3%83%8B%E3%83%9E%E3%83%83%E3%82%AF%E3%82%B9%E6%B3%95]]

***プログラム(見たい人だけ)
#region(VBA2)
Sub Macro2()
    Dim mat As Integer
    Dim P_S As Double
    Dim B_S As Double
    Dim P_C As Double
    Dim B_C As Double
    
    Dim S As Integer
    Dim B As Integer
    Dim winP As Integer
    Dim plsS As Integer
    Dim plsB As Integer
    Dim winB As Integer
    Dim res_winP As Double
    Dim res_plsS As Double
    Dim res_plsB As Double
    Dim res_winB As Double
    
    Dim PITCH As Double
    Dim BATER As Double
    Dim x As Double
    Dim y As Double
    
    
     'カウント設定
    S = 0
    B = 0
    
    For i = 0 To 120
        PITCH = ActiveSheet.Cells(23 + i, 7)
        BATER = ActiveSheet.Cells(23 + i, 9)
        mat = 0
        res_winP = 0
        res_plsS = 0
        res_plsB = 0
        res_winB = 0
        
        For mat = 1 To 10000
        
            '①試合前処理
             winP = 0
             plsS = 0
             plsB = 0
             winB = 0
            
            '②試合中処理
            Do While (winP + plsS + plsB + winB) = 0
                
                ActiveSheet.Cells(1, 1) = 1
                
                '変数読み
                P_S = ActiveSheet.Cells(20, 7)
                B_S = ActiveSheet.Cells(20, 9)
                P_C = ActiveSheet.Cells(21, 7)
                B_C = ActiveSheet.Cells(21, 9)
                
                If (PITCH >= P_S) Then      '投手・ストライク選択
                    If (BATER >= B_S) Then      '打者・スイング選択
                        If (B_C >= 0.75) Then
                            winB = 1
                        Else
                            plsS = 1
                        End If
                    Else                        '打者・見送り選択
                        plsS = 1
                    End If
                Else                        '投手・ボール選択
                    If (BATER >= B_S) Then      '打者・スイング選択
                        plsS = 1
                        If (S = 2 And B_C >= 0.75) Then
                            plsS = 0
                        End If
                    Else                        '打者・見送り選択
                        plsB = 1
                    End If
                End If
                
                If S = 2 And plsS = 1 Then      '三振
                    plsS = 0
                    winP = 1
                Else
                    If B = 3 And plsB = 1 Then  '四球
                        plsB = 0
                        winB = 1
                    End If
                End If
                
            Loop
            
            '③試合後処理
            If winP = 1 Then res_winP = res_winP + 1
            If plsS = 1 Then res_plsS = res_plsS + 1
            If plsB = 1 Then res_plsB = res_plsB + 1
            If winB = 1 Then res_winB = res_winB + 1
            
        Next
        
        mat = mat - 1
        res_winP = res_winP / mat
        res_plsS = res_plsS / mat
        res_plsB = res_plsB / mat
        res_winB = res_winB / mat
        
        ActiveSheet.Cells(23 + i, 11) = res_winP
        ActiveSheet.Cells(23 + i, 12) = res_plsS
        ActiveSheet.Cells(23 + i, 13) = res_plsB
        ActiveSheet.Cells(23 + i, 14) = res_winB      
    Next
    Beep
End Sub
(変更概要)
・ループの単位を「1勝負」→「1カウンド変化」へ変更
・結果の単位を「打者の勝敗」→「投手勝利」「ストライク+1」「ボール+1」「打者勝利」へ変更
#endregion(VBA2)

***試行結果(カウント別)
#region(表のみかた)
各カウントについて、
投手のストライク率・打者のスイング率を元に10000回のフリーバッティングを行う。
その結果を、打者の勝利条件(打者の出塁率)基準で数値化する。最小0.000~最大1.000
#endregion(表のみかた)

#region(表1)

#image(https://i.imgur.com/CfCPsaX.png,width=700,height=350)
#image(https://i.imgur.com/XpRD3yc.png,width=700,height=350)
#image(https://i.imgur.com/L3yROkF.png,width=700,height=350)
#image(https://i.imgur.com/Np0s8JF.png,width=700,height=350)
#image(https://i.imgur.com/w2RGbhu.png,width=700,height=350)
#image(https://i.imgur.com/VTCKob8.png,width=700,height=350)
#image(https://i.imgur.com/WSefTl5.png,width=700,height=350)
#image(https://i.imgur.com/9lZzHut.png,width=700,height=350)
#image(https://i.imgur.com/8CnXQmJ.png,width=700,height=350)
#image(https://i.imgur.com/Lkz6txF.png,width=700,height=350)
#image(https://i.imgur.com/1zdl2eY.png,width=700,height=350)
#image(https://i.imgur.com/cpeB0GN.png,width=700,height=350)

#endregion(表1)

***試行結果(まとめ)
#region(グラフのみかた)
各カウントが推移するとともに、打者or投手の勝率がどの程度変化するか示す。
表1と同じく、打者の勝利条件(打者の出塁率)基準で数値化する。最小0.000~最大1.000
#endregion(グラフのみかた)

#region(グラフ1)
#image(https://i.imgur.com/ND5c4Rr.png,width=700,height=450)
#endregion(グラフ1)

#region(グラフのみかた)
【到達xxx%】
 そのカウントに到達する確率。
 開始時は0-0なので100%。
 0-0でのストライク続行確率は0.561なので、1-0の到達確率が56%。
 0-0でのボール続行確率は0.412なので、0-1の到達確率は41%。

【xストライクxボール】
 そのまんまカウント状況

【投手勝・S続行・B続行・打者勝】
 それぞれ、投手勝利・ストライク続行・ボール続行・打者勝利をしめす(ファールはファールしなくなるまで繰返し)
 右欄の数値を合計すると必ず1.000になる。

【投xx%・打xx%】(黄色枠・赤文字)
 各カウントにおける理想的な投手ストライク率、打者スイング率を指す。
 逆に言うと、この数値から離れるほど損をすることになる。
(厳密に言えば、ちょっと得するかもしれないけど、その分を上回るリスクを抱えることになる)

#endregion(グラフのみかた)

#region(グラフ2)
#image(https://i.imgur.com/d8O5w4p.png,width=800,height=285)
#endregion(グラフ2)

***主張
>投手のストライク率30~40%あれば十分。
>だたし、3ボールまで行ってしまったらストライク率80%にすること。

>打者のスイング率40~50%あれば十分。
>だたし、3ボールまで行ってしまったらスイング率80%にすること。

細かい数値は、表1・グラフ2を見てね



***ご意見・ご感想どうぞ
- あ~こ↓れ↑かぁ。ええやん  -- 名無しさん  (2018-02-19 08:30:34)
- 打者にとって五分五分以上の状況が3-0か3-1だけってほんまに投手有利やな  -- 名無しさん  (2018-02-19 13:11:21)
- おつなのかー  -- 名無しさん  (2018-02-21 13:54:00)
- カウントごとに考えたらアカンやろ、勝負は0-0から始まって3ストライクをとられるまでに1回でも勝ったら打者の勝利になるんやから  -- 名無しさん  (2018-02-21 14:08:22)
- ↑ グラフ2で、投手勝利・ストライク続行・ボール続行・打者勝利を明確にしてみました。  -- くろいひと  (2018-02-24 13:48:45)
#comment()