This is impossible to know for sure, but you can do some estimations
So we we are going to treat is like a Fermi problem, and do some broad estimations and hopefully end up in an order of magnitude of the correct answer. Depending on your world, you can change any of these numbers to tweak your answer.
For the ease of math, we will start with a city with 10 Million people over 1,000 Square Km. For the purposes of this problem gangs will operate in cells, with large gangs consisting of multiple cells under a citywide franchise and small gangs being a single cell.
- 10,000,000 People live in the city
- 10% of them are in the correct age bracket to join a gang, so 1,000,000 young adults
- 1% of young adults join a gang, so 10,000 gang members city wide
- The average cell size of a gang is 20 members leaving 500 cells
- Assuming a city size of 1,000 km
- 50% of the city is both valuable and can be controlled (e.g. not landfills or the heavily policed financial district) leaving 500 square km of controllable space
- Each cell could control 1 km.
- Going by an 80/20 rule, 80% all cells will be in one of the 4 biggest gangs.
- Each of the super-gangs has on average 100 cells, 2,000 members, and controls 100 km squared.
- The remaining gangs are on average 2 cells (the majority are single cell, but there are a few mid-sized gangs), leading to 50 gangs with an average of 40 members controlling 2 square km.
So you have 54 gangs in your city operating in 500 cells.
Also, as the math is listed above, if there are any numbers you think are incorrect for your world, just replace the numbers and re-run the calculations.