import random


def randomlyInfectRegions(network, regions, age_groups, infected):
    """Randomly infect regions to initialize the random simulation

    :param network: object representing the network of populations
    :type network: A NetworkOfPopulation object
    :param regions: The number of regions to expose.
    :type regions: int
    :param age_groups: Age groups to infect
    :type age_groups: list
    :param infected: People to infect
    :type infected: int
    :return: Structure of initially infected regions with number
    :rtype: dict
    """
    infections = {}
    for regionID in random.choices(list(network.graph.nodes()), k=regions):
        infections[regionID] = {}
        for age in age_groups:
            infections[regionID][age] = infected

    return infections