How is Marocco's probability to advance calculated? To measure Marocco's probability to advance (win, score 2nd place) after 4 group matches have been played, we simulate all possible results of last two remaining matches. Assuming not more 5 goals can be scored by one team. So, we simulate results such as: 5:0, 5:1, 5:2, ... 0:0, ... 1:5, 0:5 for both remaining matches and we observe how many results (out of all) give chances to advance (win, be 2nd).
Note, this is not very sophisticated algorithm (e.g. - we assume all results are equally probable regardless of teams skills) - do not use it for betting purposes.
Graphical Analysis of Teams Rankings in Group B after 4 out of 6 matches
Each square represents different scores of both remaining matches in the Group B - Iran vs. Portugal and Spain vs. Morocco. Colors indicate advancing teams (see legend below). Table assumes, not more than 5 goals will be scored by one team.
How to Read This Graph
Portugal - if they don't lose (win or draw against Iran), they will be promoted to the knockout stage as winners (red, gray) or runners-up (orange), depending on Spain - Marocco match result.
They can even lose to Iran and will be promoted (blue and black).
Spain - if they win, they will be promoted as winners (if Portugal lose their match (yellow), draw (orange) or win but score less goals than Spain (orange)).
If Spain draw against Morocco, they advance as winners if Portugal draw their match (orange in the middle). If they lose, they have still chances to advance (if Portugal win (red on the bottom-right) or Portugal lose (green)
Iran - if Iran win their match against Portugal, they will be promoted as a winner (green, blue, black) or runners-up (yellow),
if they lose, they have no chances to advance (orange, red). If they draw against Portugal, they have still chances to advance (gray) but Spain have to lose against Marocco more then 2 goals.