Following their first two matches – a win and a loss - the most points Ghana can get is 6.
Senegal already has 4 points, so if they beat Algeria will be on 7 points. That leaves Algeria on 3 points and South Africa on one point.
*Under those circumstances, and if Ghana beat South Africa, then the Black Stars will stay second in the group and advance to the quarter finals.
*Under those circumstances, and if Ghana draw with South Africa, then Black Stars will stay second in the group and advance because it would have four points, Algeria will have three points while South Africa will have two.
However, a victory for Algeria over Senegal and a defeat or draw for Ghana at the hands of South Africa would mean Senegal finish with 4 points while Algeria will top the group with 6 points. So with its better head to head record over Ghana, Senegal would qualify ahead of the Black Stars even though both are tied at 4 points
If Algeria beat Senegal, Bafana still have to score three clear goals LESS whatever goals Algeria score against Senegal, to finish second.