def total_probability(fixed_symbol: str, varying_symbol_template: str, n: int, start_at: int = 1) -> str:
    """
    Returns a string for law of total probability.

    **Parameters**

    - `fixed_symbol`: str

        The symbol that stays the same in the summation.

    - `varying_symbol_template`: str

        A template for the varying symbol that includes a replacement field (`{}`) for the index.

    - `n`: int

        The number of values for the varying symbol.

    - `start_at`: int

        The index at which `varying_symbol_template`starts.

    **Returns**

    - `out`: str

        TeX compatible string.
    """

    return '+'.join([f'p({fixed_symbol},{varying_symbol_template.format(i)})' for i in range(start_at, start_at+n)])