That's what I did early on. It never quite worked out as intended with Factorios way of calculating the percentage for each output separately.
I'm afraid we'll need to use...
MATH.
https://www.youtube.com/watch?v=gENVB6tjq_M
Let's say a recipe has 5 output items.
Each item has a 10% chance to be produced.
Because the percentage is calculated individually, there is a 50% chance you will get at least one of those items.
By adding a 6th item, the chance increases to 60% but we want to keep it at 50%.
So in order to do that, let's apply some math magic.
local resources={"iron","copper","stone","coal","uranium"}
local balanced_resource_count=5
local base_resource_chance=0.1
local chance_ratio = 1/(#resources/balanced_resource_count)
local chance_per = chance_ratio*base_resource_chance
local recipe={}
recipe.results={}
for key,val in pairs(resources)do
table.insert(recipe.results,{type="item",name=val,amount=1,probability=chance_per})
end
ez