I cleaned up the script a bit and turned to my next point of interest, to see whether it was vantageous in terms of score for responder with a 5m332 to go through some kind Stayman (capable of locating a 3-5 major fit) or just bid in NT.
Initially I look at responder with enough for a thin game (10 HCP) or a safe game (11-12 HCP), as the script isn't ready for invitational yet.
The script assumes that opener is vulnerable, that we can find the 3-5 major fit if we wish and that the opponents keep quiet.
At first sight the results seem to say that in a thin game we are much better off in 4S than in 3NT, but this advantage disappears with safe game strength.
#
# NT vs Spades comparison
#
op_nt1517= hcp(north)>=15 and hcp(north)<=17
rs_weak= hcp(south)>=4 and hcp(south)<=7
rs_invite= hcp(south)>=8 and hcp(south)<=9
rs_thingame= hcp(south)>=10 and hcp(south)<=10
rs_safegame= hcp(south)>=11 and hcp(south)<=12
rs_5m3S32= shape(south, any 5332) and hearts(south)<=3 and spades(south)==3
rs_xfer= spades(south)>=5 or hearts(south)>=5 or clubs(south)>=6 or diamonds(south)>=5
op_s5 = spades(north)==5 and shape(north, any 5332)
produce 10
##### unquote ONE condition below at a time
condition op_nt1517 and op_s5 and rs_thingame and rs_5m3S32
#condition op_nt1517 and op_s5 and rs_safegame and rs_5m3S32
x3N_tricks= tricks(north,notrumps)
x4S_tricks= tricks(north,spades)
x3N_score= score(vul,x3N,x3N_tricks)
x4S_score= score(vul,x4S,x4S_tricks)
outcome = x3N_score == x4S_score ? 0 : (x3N_score > x4S_score ? 1 : -1)
##### unquote ONE action below at a time
action frequency(x3N_tricks,6,13)
#action frequency(x4S_tricks,6,13)
#action frequency(outcome,-1,1)
THIN GAME =======================================================
Frequency of tricks in 3NT
Frequency :
6 7
7 11
8 27
9 20
10 16
11 13
12 6
13 0
Generated 4986840 hands
Produced 100 hands
Initial random seed 1604580564
Time needed 60.142 sec
Frequency of tricks in 4S
Frequency :
6 0
7 0
8 6
9 21
10 41
11 24
12 8
13 0
Generated 4863518 hands
Produced 100 hands
Initial random seed 1604580675
Time needed 56.812 sec
Score is better in 4S / same in both / better in 3NT
Frequency :
-1 54
0 10
1 36
Generated 5100876 hands
Produced 100 hands
Initial random seed 1604580768
Time needed 77.179 sec
SAFE GAME =======================================================
Frequency of tricks in 3NT
Frequency :
Low 1
6 1
7 3
8 10
9 20
10 27
11 26
12 11
13 1
Generated 4162578 hands
Produced 100 hands
Initial random seed 1604581057
Time needed 56.394 sec
Frequency of tricks in 4S
Frequency :
6 0
7 0
8 1
9 14
10 29
11 40
12 15
13 1
Generated 3433173 hands
Produced 100 hands
Initial random seed 1604581164
Time needed 42.272 sec
Score is better in 4S / same in both / better in 3NT
Frequency :
-1 47
0 4
1 49
Generated 3803028 hands
Produced 100 hands
Initial random seed 1604580938
Time needed 64.302 sec