import random


def shuffle_tuple(x):
    """x is a tuple (a, b), we swap a and b with 50% probability"""
    a, b = x
    if random.randint(0, 1) == 1:
        return (a, b)
    else:
        return (b, a)