How to reduce betting blokes that can guarantee max 1 incorrect

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000</SPAN></SPAN>
Hi,
</SPAN></SPAN>

Here I have a question how to reduce betting blokes that can guarantee max 1 incorrect, what I mean this, for example "Euromillions" playing 8 numbers direct we are playing 56 lines it cost 140€ "Formula=COMBIN(8,5)" if out of 8 numbers 5 numbers are correct we get the 1st price guarantee 100%.
</SPAN></SPAN>
But instead 8 numbers direct if played in reduction we play only 5 lines it cost 12.50€ but it guarantee only 4 numbers can be correct if numbers drawn any 5 out of played 8. So far 1 number less.
</SPAN></SPAN>

My question is about to play football reduction...it is difficult how do I explain it but here is my attempt...
</SPAN></SPAN>

Say for in example1 there are 2 teams the can have the end result in a 9 different ways as shown in the cells C6:D14...I can bet all 9 but as it is a money question I want to play less combinations but ensuring 1 must be correct out of any 9 results if I bet 3 lines as shown in the cells H6:I8 there is minimum 1 correct and 1 wrong.
</SPAN></SPAN>

Example1...
</SPAN></SPAN>

Book1
ABCDEFGHIJK
1
2
3
4
5Combi nTeam1Team2Combi nTeam1Team2
6111111
721X2XX
8312321
94X1
105XX
116X2
12721
1382X
14922
15
16
17
18
Sheet2


Say for in example2 there are 3 teams the can have the end result in a 27 different ways as shown in the cells C6:E32...I can bet all 27 but as it is a money question I want to play less combinations but ensuring 1 must be correct out of any 27 results if I bet 6 lines as shown in the cells H6:J11 there is minimum 2 correct and one wrong.
</SPAN></SPAN>

Example2...

Book1
ABCDEFGHIJKL
1
2
3
4
5Combi nTeam1Team2Team3Combi nTeam1Team2Team3
611111111
7211X2XXX
831123222
941X14X11
1051XX5211
1161X261XX
127121
13812X
149122
1510X11
1611X1X
1712X12
1813XX1
1914XXX
2015XX2
2116X21
2217X2X
2318X22
2419211
252021X
2621212
27222X1
28232XX
29242X2
3025221
312622X
3227222
33
34
35
36
Sheet3
</SPAN></SPAN>

The above result I have come up checking one by one it has took 2, 3 days to ensure.
</SPAN></SPAN>
And I guess they are right but not sure 100%
</SPAN></SPAN>

As the team increases lines increases...now I want to work out with 4 teams there would be 81 lines as per example3, is there any macro or VBA can extract only those lines out of 81 which has 3 correct and 1 wrong... manually I think it is not possible for me.
</SPAN></SPAN>

Example3...

Book1
ABCDEFGHIJKLMNO
1
2
3
4
5Combi nTeam1Team2Team3Team4Combi nTeam1Team2Team3Team4
6111111
72111X?
831112?
9411X1?
10511XX?
11611X2?
1271121?
138112X?
1491122?
15101X11?
16111X1X?
17121X12?
18131XX1?
19141XXX?
20151XX2
21161X21
22171X2X
23181X22
24191211
2520121X
26211212
272212X1
282312XX
292412X2
30251221
3126122X
32271222
3328X111
3429X11X
3530X112
3631X1X1
3732X1XX
3833X1X2
3934X121
4035X12X
4136X122
4237XX11
4338XX1X
4439XX12
4540XXX1
4641XXXX
4742XXX2
4843XX21
4944XX2X
5045XX22
5146X211
5247X21X
5348X212
5449X2X1
5550X2XX
5651X2X2
5752X221
5853X22X
5954X222
60552111
6156211X
62572112
635821X1
645921XX
656021X2
66612121
6762212X
68632122
69642X11
70652X1X
71662X12
72672XX1
73682XXX
74692XX2
75702X21
76712X2X
77722X22
78732211
7974221X
80752212
817622X1
827722XX
837822X2
84792221
8580222X
86812222
87
88
89
90
Sheet4
</SPAN></SPAN>


Thank you in advance
</SPAN></SPAN>

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,</SPAN></SPAN>

In other words in the example-3 I want those combinations in the columns J, K, L, M which can pass at least 3 correct out of 4 "with any of one results come out from 81 total combinations out of columns C, D, E, F" </SPAN></SPAN>

Note: As in example-2 if any of 27 combinations columns C, D, E is checked with betting columns H, I, J there are 2 correct always </SPAN></SPAN>

Thank you in advance</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Upvote 0
Hi,</SPAN></SPAN>

May I have not explained it well in the #post1 some time it complicate to explain but may this can describe better my need hope so...
</SPAN></SPAN>

Example...result has come out X-1-1-2 if we check with 81 bets it has passed 4 with combi nº 30 shown highlighted in yellow cells H34:K34 so far betting 81 we sure that always at least 1 of the 4 will passed correct
</SPAN></SPAN>

As we already have the 81 bets of the of 4 triples (3*3*3*3=81) we are going to see what needs to be done to have a smaller combination but that always fails at most one sign, that is to say that it has at least one bet with 3 hits.
</SPAN></SPAN>

Now for example result is a same X-1-1-2 and if I would have bet only 2 out of 81...
</SPAN></SPAN>
1st...1-X-X-X in this one passed only 2
</SPAN></SPAN>
2nd...X-X-2-X in this one passed only 2
</SPAN></SPAN>

So far these are not valid because we need the combinations at least one bet with 3 hits.
</SPAN></SPAN>

Example for 81 bets could be...
</SPAN></SPAN>


Book1
ABCDEFGHIJKLM
1
2
3
4TeamWinDrawLossCombi NP1P2P3P4
511X211111
621X22111X
731X231112
841X2411X1
9511XX
10611X2
1171121
128112X
1391122
14101X11
15111X1X
16121X12
17131XX1
18141XXX
19151XX2
20161X21
21171X2X
22181X22
23191211
2420121X
25211212
262212X1
272312XX
282412X2
29251221
3026122X
31271222
3228X111
3329X11X
3430X112
3531X1X1
3632X1XX
3733X1X2
3834X121
3935X12X
4036X122
4137XX11
4238XX1X
4339XX12
4440XXX1
4541XXXX
4642XXX2
4743XX21
4844XX2X
4945XX22
5046X211
5147X21X
5248X212
5349X2X1
5450X2XX
5551X2X2
5652X221
5753X22X
5854X222
59552111
6056211X
61572112
625821X1
635921XX
646021X2
65612121
6662212X
67632122
68642X11
69652X1X
70662X12
71672XX1
72682XXX
73692XX2
74702X21
75712X2X
76722X22
77732211
7874221X
79752212
807622X1
817722XX
827822X2
83792221
8480222X
85812222
86
87
88
Sheet5


I need to find the few smaller combination but that always fails at most one sign. In the any case any of the 1 result is out of the 81 bets.
</SPAN></SPAN>

Thank you in advance
</SPAN></SPAN>

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN></SPAN></SPAN>
 
Upvote 0
From a mathematical point of view, this is really interesting. I'm sure someone has done some research on this. Mathematically it would be defined something like: "Given a set S containing sets of ordered elements, find a subset T of S containing a minimal number of sets of ordered elements such that every set in S differs by at most 1 element from a set in T." Something in graph theory maybe. Doing a quick web search didn't reveal anything, so I tried coming up with my own algorithm.

First up is a basic "greedy" method. Just go down the list of combinations, and every time you find one that doesn't match your rules in the subset, add it to the subset. It certainly works, but is not guaranteed to find a minimal subset. In your 3-team example, it came up with 8 teams, while you had 6.

Next I tried a brute force method. I figured with a small enough set, a fast computer could find an optimal set. It worked quite well for 1 team. For 2 teams it came up with the same sets you did. For 3 teams, I got this result:


Book1
ABCDEFGHIJK
1Values12X
2Teams3
3
4
5CombinationTeam 1Team 2Team 3Closest to:CombinationTeam 1Team 2Team 3
6111111111
7211215122
8311X111212
94121113221
105122527XXX
11612X5
1271X11
1381X25
1491XX27
15102111
161121211
171221X11
181322113
19142225
201522X13
21162X113
22172X211
23182XX27
2419X111
2520X1211
2621X1X27
2722X2113
2823X225
2924X2X27
3025XX127
3126XX227
3227XXX27
Sheet2


You only need 5 sets instead of the 6 you have.

Looking good so far, but here's where the vast number of combinations kicks in. The macro ran for hours without finding a solution. I do know that it would require at least 8 sets to make it work. I'm trying to find a way to use various symmetries to reduce the number of calculations. I'll let you know if I figure it out.
 
Upvote 0
From a mathematical point of view, this is really interesting. I'm sure someone has done some research on this. Mathematically it would be defined something like: "Given a set S containing sets of ordered elements, find a subset T of S containing a minimal number of sets of ordered elements such that every set in S differs by at most 1 element from a set in T." Something in graph theory maybe. Doing a quick web search didn't reveal anything, so I tried coming up with my own algorithm.

First up is a basic "greedy" method. Just go down the list of combinations, and every time you find one that doesn't match your rules in the subset, add it to the subset. It certainly works, but is not guaranteed to find a minimal subset. In your 3-team example, it came up with 8 teams, while you had 6.

Next I tried a brute force method. I figured with a small enough set, a fast computer could find an optimal set. It worked quite well for 1 team. For 2 teams it came up with the same sets you did. For 3 teams, I got this result:

You only need 5 sets instead of the 6 you have.

Looking good so far, but here's where the vast number of combinations kicks in. The macro ran for hours without finding a solution. I do know that it would require at least 8 sets to make it work. I'm trying to find a way to use various symmetries to reduce the number of calculations. I'll let you know if I figure it out.
Eric, your hunt for reducing down at least minimum to 2 must pass, within the 5 matches you discovery is accurate.</SPAN></SPAN>

Here are the results I did check are spot on!
</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUVWXY
1Values12X
2Teams3
3
4
5CombinationTeam 1Team 2Team 3Closest to:Pass 1Pass 5Pass 11Pass 13Pass 27Check >2CombinationTeam 1Team 2Team 3Check 1Check 5Check 11Check 13Check 27
6111113    3111131110
7211212222512222200
8311X1221121221101
94121122221322122020
10512253327XXX13110
11612X52212011
1271X112221011
1381X252212101
1491XX272211002
15102111222220220
1611212113311310
171221X112210211
1813221133311130
19142225222202220
201522X132201121
21162X1132210121
22172X2112201211
23182XX272200112
2419X1112220111
2520X12112211201
2621X1X272210102
2722X21132211021
2823X2252202111
2924X2X272201012
3025XX1272210012
3126XX2272201102
3227XXX273300003
33
34
Sheet6
Cell Formulas
RangeFormula
H6=IF(T6>1,T6,"")
I6=IF(U6>1,U6,"")
J6=IF(V6>1,V6,"")
K6=IF(W6>1,W6,"")
L6=IF(X6>1,X6,"")
M6=MAX(H6:L6)
T6=SUMPRODUCT(--($C6:$E6=$P$6:$R$6))
U6=SUMPRODUCT(--($C6:$E6=$P$7:$R$7))
V6=SUMPRODUCT(--($C6:$E6=$P$8:$R$8))
W6=SUMPRODUCT(--($C6:$E6=$P$9:$R$9))
X6=SUMPRODUCT(--($C6:$E6=$P$10:$R$10))


Thank you for your assistance may be now looking to your idea I got some clue will try if got some positive results with 4 teams will show here...
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan :)
</SPAN></SPAN>
 
Last edited:
Upvote 0
From a mathematical point of view, this is really interesting. You only need 5 sets instead of the 6 you have. Looking good so far, but here's where the vast number of combinations kicks in. The macro ran for hours without finding a solution. I do know that it would require at least 8 sets to make it work. I'm trying to find a way to use various symmetries to reduce the number of calculations. I'll let you know if I figure it out.
Eric, really your viewpoint has been great to discover a way out of this complicate task, here is the clue I got form you solution it could be VBA solution but don't know how to create also weather it is correct or not. </SPAN></SPAN>
With the 3 teams you got 5 results. Based on those results I made 3 columns to count the 1, X and 2 and then filter as per column K "filter criteria" and found the column as you discovered.
</SPAN></SPAN>

Here are the results...
</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOP
1Values12X
2Teams3
3
4Filter Criteria
5CombinationTeam 1Team 2Team 31X21-X-2Combi nTeam 1Team 2Team 3
611113003-0-01111
721122021-0-22122
8311X2111-0-23212
941212011-0-24221
1051221010-3-05XXX
11612X110
1271X1211
1381X2111
1491XX120
1510211201
1611212101
171221X110
1813221100
1914222001
201522X010
21162X1110
22172X2011
23182XX020
2419X11201
2520X12101
2621X1X110
2722X21100
2823X22001
2924X2X010
3025XX1110
3126XX2011
3227XXX020
33
34
Sheet8
Cell Formulas
RangeFormula
G6=COUNTIF(C6:E6,1)
H6=COUNTIF(D6:F6,"X")
I6=COUNTIF(E6:G6,2)


And here are using the same criteria 8-result for 4 teams...
</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRS
1
2
3
4Filter Criteria
5Combi nTeam1Team2Team3Team41X21-X-2CombinationTeam 1Team 2Team 3Team 4
6111114004-0-011111
72111X3100-4-02XXXX
8311123012-0-231122
9411X13102-0-241212
10511XX2202-0-251221
11611X22112-0-262112
12711213012-0-272121
138112X2112-0-282211
1491122202
15101X11310
16111X1X220
17121X12211
18131XX1220
19141XXX130
20151XX2121
21161X21211
22171X2X121
23181X22112
24191211301
2520121X211
26211212202
272212X1211
282312XX121
292412X2112
30251221202
3126122X112
32271222103
3328X111310
3429X11X220
3530X112211
3631X1X1220
3732X1XX130
3833X1X2121
3934X121211
4035X12X121
4136X122112
4237XX11220
4338XX1X130
4439XX12121
4540XXX1130
4641XXXX040
4742XXX2031
4843XX21121
4944XX2X031
5045XX22022
5146X211211
5247X21X121
5348X212112
5449X2X1121
5550X2XX031
5651X2X2022
5752X221112
5853X22X022
5954X222013
60552111301
6156211X211
62572112202
635821X1211
645921XX121
656021X2112
66612121202
6762212X112
68632122103
69642X11211
70652X1X121
71662X12112
72672XX1121
73682XXX031
74692XX2022
75702X21112
76712X2X022
77722X22013
78732211202
7974221X112
80752212103
817622X1112
827722XX022
837822X2013
84792221103
8580222X013
86812222004
87
88
sheet9
Cell Formulas
RangeFormula
I6=COUNTIF(D6:G6,1)
J6=COUNTIF(D6:G6,"X")
K6=COUNTIF(D6:G6,2)


Please could you check it?
</SPAN></SPAN>

Thank you for your help and guidance
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0
Eric, really your viewpoint has been great to discover a way out of this complicate task, here is the clue I got form you solution it could be VBA solution but don't know how to create also weather it is correct or not. </SPAN></SPAN>Kind Regards,</SPAN></SPAN>Kishan </SPAN></SPAN>
Hi Eric, I were checking it would be 14 not 8 as shown below with 8 there are some with 2 pass the goal is find with minimum 3 within the 4 teams...</SPAN></SPAN>

Correction #post8....
</SPAN></SPAN>


Book1
ABCDEFGHIJKL
1
2
3
4Filter Criteria For 1Filter Criteria For XFilter Criteria For 2
51X2CombinationTeam 1Team 2Team 3Team 4
640011111
72112112X
811231X22
9121412XX
103105X111
112116X121
120407XXXX
131128X212
141219X2X1
1502210X22X
161121121X2
17121122X1X
18121132XX1
19103142221
20
Sheet10


Kind Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Last edited:
Upvote 0
Hi Eric, I were checking it would be 14 not 8 as shown below with 8 there are some with 2 pass the goal is find with minimum 3 within the 4 teams...</SPAN></SPAN>Kind Regards,</SPAN></SPAN>Kishan</SPAN></SPAN>
Hi Eric, sorry for the inconvenience may be following is bit better I guess but do not find the accurate method... </SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
1
2
3
4Filter 1Filter XFilter 2
5Combi nTeam1Team2Team3Team4Pass 1Pass 2Pass 3Pass 4Pass 5Pass 6Pass 7Pass 8Pass 9Check >21X21X2CombinationTeam 1Team 2Team 3Team 4Check 1Check 2Check 3Check 4Check 5Check 6Check 7Check 8Check 9
6111114        440040011111411111111
72111X3222313031021XXX321102210
8311123222310330131222312201120
9411X1322231213104X1X2321210102
10511XX232231212205XX21231201201
11611X2222331212116X21X222300111
1271121322231123017212X312120201
138112X2223311221182X12222111300
149112223223112202922X1213210210
15101X1132223310321021021
16111X1X23223220231012120
17121X1222233211222111030
18131XX123223220231120012
19141XXX44130141111111
20151XX232223121132210021
21161X2122233211222030111
22171X2X32223121132021210
23181X2223223112123120120
2419121132223301312012012
2520121X22233211222003111
2621121223223202213102021
272212X122233211222111003
282312XX32223121132102102
292412X223223112123201012
3025122123223202213021102
3126122X23223112123012201
3227122244103114111111
3328X11132223310300222111
3429X11X22323220210213210
3530X11223223211201312120
3631X1X123223220210321102
3732X1XX23223130120312201
3833X1X244121111411111
3934X12122323211201231201
4035X12X22233121111222300
4136X12223223112102321210
4237XX1123223220210132021
4338XX1X22323130120123120
4439XX1222233121111222030
4540XXX122323130120231012
4641XXXX32223040030222111
4742XXX223223031021321021
4843XX2144121111141111
4944XX2X23223031021132210
5045XX2222323022012231120
5146X21122323211201123012
5247X21X44121111114111
5348X21222323112102213021
5449X2X122233121111222003
5550X2XX22323031021213102
5651X2X223223022012312012
5752X22123223112102132102
5853X22X22323022012123201
5954X22232223013003222111
6055211132223301300111222
6156211X22323211210102321
6257211222233202201201231
635821X122233211210210213
645921XX22323121120201312
656021X232223112111300222
6661212122323202201120312
6762212X44112111111411
6863212222323103102210321
69642X1122323211210021132
70652X1X22233121120012231
71662X1244112111111141
72672XX122233121120120123
73682XXX32223031030111222
74692XX222323022021210132
75702X2132223112111030222
76712X2X22323022021021321
77722X2222233013012120231
7873221122233202201012123
7974221X32223112111003222
8075221222323103102102132
817622X144112111111114
827722XX22233022021102213
837822X222233013012201123
8479222122233103102021213
8580222X22323013012012312
8681222232223004003111222
87
Sheet11
Cell Formulas
RangeFormula
I6=IF(AH6>1,AH6,"")
J6=IF(AI6>1,AI6,"")
K6=IF(AJ6>1,AJ6,"")
L6=IF(AK6>1,AK6,"")
M6=IF(AL6>1,AL6,"")
N6=IF(AM6>1,AM6,"")
O6=IF(AN6>1,AN6,"")
P6=IF(AO6>1,AO6,"")
Q6=IF(AP6>1,AP6,"")
R6=MAX(I6:Q6)
T6=COUNTIF(AC6:AF6,1)
U6=COUNTIF(AC6:AF6,"X")
V6=COUNTIF(AC6:AF6,2)
X6=COUNTIF(D6:G6,1)
Y6=COUNTIF(D6:G6,"X")
Z6=COUNTIF(D6:G6,2)
AH6=SUMPRODUCT(--($D6:$G6=$AC$6:$AF$6))
AI6=SUMPRODUCT(--($D6:$G6=$AC$7:$AF$7))
AJ6=SUMPRODUCT(--($D6:$G6=$AC$8:$AF$8))
AK6=SUMPRODUCT(--($D6:$G6=$AC$9:$AF$9))
AL6=SUMPRODUCT(--($D6:$G6=$AC$10:$AF$10))
AM6=SUMPRODUCT(--($D6:$G6=$AC$11:$AF$11))
AN6=SUMPRODUCT(--($D6:$G6=$AC$12:$AF$12))
AO6=SUMPRODUCT(--($D6:$G6=$AC$13:$AF$13))
AP6=SUMPRODUCT(--($D6:$G6=$AC$14:$AF$14))


Kind Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top