import random


def random_initial_values(p_mag, m_mag=5):
    """Returns tuple of random initial values of mass `m`, and positional
    coordinates `x` and `y`.

    Prefers initial positions above the fixed end.
    Function `round` is used to get reproducible simulation results.

    Args:
        p_mag (float): magnitude of the maximum allowed position coordinate
        m_mag (float): magnitude of the highest allowed mass

    Returns:
        tuple (m, x, y)
    """
    m = round(random.random() * m_mag + 1, 2)
    x = round(random.random() * p_mag * random.choice([-1, 1]), 2)
    y = round((random.random() - 0.2) * p_mag, 2)
    return (m, x, y)