Counting attackers and defenders, which pieces count? I've heard multiple times the idea of counting attackers and defenders in estimating whether an attack/sacrifice will succeed. However, I think authors are quite loose in counting who is the attacker and who is the defender. And their decision is heavily influenced IMO by the outcome, ie they'll include more attackers and discard more defenders if the attack succeeds.

For example, the game Karpov - Georgiev 1994, white to move. I think it's obvious that white's Q, B, Ne4, Re2 are attackers, but do Nf3 and Re1 count? For black, all pieces/pawns around K count, Ba8 doesn't. How about Rd8, Nd7 and Qb8? 

bq1r1rk1/3n1pb1/1p1P2pp/2p5/P1B1N3/1Q3NP1/4RP1P/4R1K1 w - - 1 29


Edit: Source of the theory

Sokolov mentioned the theory in his book "Sacrifice and Initiative in Chess". On page 91 

"However one theme that is repeated in almost all of these games is the attackers vs defenders ratio. Please keep this in mind! When you have an attack on a castled king and are planning to sacrifice a piece in order to destroy the opponent's defences, do a quick check on the number of your attacking forces vs your opponents defending forces. When you do this check, remember that as Steinitz already correctly claimed, the enemy king counts as a defender. Of course this theory does not always work, but it gives a very good initial indication of whether an attack may work."

So at least Steinitz and Sokolov had such theory, and I think Kasparov mentioned it as well.
First, I think you are looking for a hard-and-fast rule that does not exist since it really depends on the position. There still can be some guiding factors.

In the Karpov game above, which only lasted another 6 moves, it turns out that literally every white piece was an attacker, and was necessary for the attack to succeed, so the original question about whether Nf3 and Re1 were attackers, the answer was "yes", even if the Re1 was indirectly attacking by defending the other rook going to e8.

I would also say that it is not really related to a pure ratio. Sometimes, it can be a simple majority of one more attacker than there are defenders, and not all defenders are equal in every position. That said, if you have a 5 or 6 pieces bearing down on the opposing king position, and there are only one or two defenders, there is almost always going to be something there. You can safely go by instinct in such a case, even if you do not see your attack clearly all the way to the end.

For each position, when trying to figure this out, determining which pieces are attackers is usually not as hard as figuring out which ones are defenders. That is because, depending on the position, sometimes a pawn may be a defender, but other times it really is not, as in the Karpov game above f7 did nothing to defend. Also, you have to consider that the defending king also counts as a defender of itself: If you sacrifice so much material to the point that it is just your queen left, and there is no mate or win of material, the queen, just as in a pure K vs K+Q ending, cannot win without some support against the king it was attacking. You really have to judge what pieces can really help defend, and which ones only appear to be in the vicinity to help. Be especially aware when the opposing queen is way offside, and cannot get back to help. That alone, is often a deciding factor.

You also need to look at how pieces combine. For example, if you have a queen and knight attacking a castled black king with only the three pawns as cover, they can be very powerful with the knight on f5, and the queen on g5, and they might be able to go it alone. If it were instead a bishop on d3, and that same queen, then g6 might stop you cold without maybe many more attackers.

I also use this principle more when worrying about my own king safety rather than my opponents, but that is more that my positional style does not lend itself to attacking Morphy-style. It may also be because all-out attacks do not occur every game, but we always have to think about king safety.

  [Event "Tilburg"]
  [Site "Tilburg"]
  [Date "1994.??.??"]
  [Round "5"]
  [White "Karpov, Anatoly"]
  [Black "Georgiev, Kiril"]
  [Result "1-0"]
  [ECO "D58"]
  [WhiteElo "2780"]
  [BlackElo "2615"]
  [EventDate "1994.09.??"]
  [FEN ""]

  1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 Be7 5. Bg5 h6 6. Bh4 O-O 7. e3 b6 8. Be2 Bb7 9. Bxf6 Bxf6 10. cxd5 exd5 11. b4 c6 12. O-O Qd6 13. Qb3 Nd7 14. Rfe1 Be7 15. Rab1 a5 16. bxa5 Rxa5 17. a4 Re8 18. Bf1 Bf8 19. Qc2 g6 20. e4 dxe4 21. Nxe4 Qf4 22. Bc4 Bg7 23. Re2 c5 24. d5 Raa8 25. Rbe1 Rad8 26. Qb3 Ba8 27. g3 Qb8 28. d6 Rf8 29. Bxf7+ Rxf7 30. Neg5 hxg5 31. Nxg5 Rdf8 32. Re8 Qxd6 33. Qxf7+ Kh8 34. Ne6 1-0