1

Image

There are 15 dominoes arranged in 3 rows of 5 dominoes.

Imagine each domino as representing a fraction, where the numerator is the number of dots on the top part of the domino, and the denominator is the number of dots on the bottow part of the domino. For example the domino on the top left would be 3/4

In the current arrangement, the fractions for each row of dominoes adds up to 2.5

I need to rearrange them so that each row adds up to 10

I am allowed to flip dominoes, which would invert the fraction (For example : 3/4 -> 4/3)

What I tried: Knowing that there are 15 dominoes, there should be 15! ways to arrange them by displacement but there each of the 15 dominoes could be flipped, so there are 15! * 2^15 arrangements I think.

First I could just worry about the flipping part of the dominoes, I could find and arrangement of flip such that the sum of all dominoes is 30. There are only 2^15 possibilites, around 32K, this could be found with a computer.

However, even if I found that there is only one arrangement of flips to get a total sum of 30, there would still be 15! arrangements of displacement, around 10^12. This would be too large to find out with a computer.

Am I missing any clue that could help me lower the number of possible arrangements that work?

Jean Marie
  • 81,803
Asd Ttt
  • 11
  • 1
    Your combinatorics are a bit off, because we don't care what order the dominoes come in in any given row, and we don't care about which order the rows come in. So that alone makes it a factor of $5!^3\cdot 3!\approx 10^7$ smaller. Of course, I still wouldn't go for a full brute force by hand. I think you should focus not on all three rows at the same time, but on a single row at a time. Try to make 10 by using five of your fifteen dominoes. Once you've done that, try to make 10 with five of the remaining ten. Then see whether the remaining five can make 10. Maybe you're lucky. – Arthur Jan 09 '24 at 08:58
  • Is it compulsory we use the dominoes displayed on the image and not any other one ? – Jean Marie Jan 09 '24 at 10:53
  • The sum of all the domino fractions must be $30$. – paw88789 Jan 09 '24 at 12:17
  • Please answer my question. – Jean Marie Jan 10 '24 at 14:27

1 Answers1

0

After a little coding, I found 2232 solutions. Here is one of them: $$ \frac2 1 + \frac6 5 + \frac6 2 + \frac3 1 + \frac4 5\\ \hphantom5\\ \frac3 4 + \frac1 4 + \frac3 6 + \frac6 1 + \frac5 2\\ \hphantom 5\\ \frac4 2 + \frac5 1 + \frac4 6 + \frac2 3 + \frac5 3 $$ And here is the python script. The first part is just a class that represents a fraction, with a few helper methods to accommodate addition, equality, flipping it upside-down, and printing the thing to paste into this very answer. Then I make a list of all the domino-fractions.

Finally I loop through every possible combination of flippings and check whether they sum to 30 (there are 29 of these). Then I do basically what I said in my comment: I try to choose five of them that add to 10, and then five more that add to 10, and the remaining five must then also add to 10.

I recommend you paste this into an actual editor before trying to read. Syntax highlighting is such a help.

from math import gcd
from itertools import combinations

class Fraction: def init(self, num, den): self.num, self.den = num, den

def shorten(self):
    g = gcd(self.num, self.den)
    self.num //= g
    self.den //= g

def __add__(self, other):
    f = Fraction(self.num*other.den + self.den*other.num,
                 self.den*other.den)
    f.shorten()
    return f

def flip(self):
    return Fraction(self.den, self.num)

def __eq__(self, other):
    return self.num*other.den == self.den*other.num

def __str__(self):
    return f"\\frac{self.num} {self.den}"

fracs = [ Fraction(3, 4), Fraction(1, 4), Fraction(3, 6), Fraction(1, 2), Fraction(2, 4),

    Fraction(5, 6),
    Fraction(2, 6),
    Fraction(1, 3),
    Fraction(4, 5),
    Fraction(1, 5),

    Fraction(4, 6),
    Fraction(1, 6),
    Fraction(2, 3),
    Fraction(3, 5),
    Fraction(2, 5)]

There are 2**15 different ways to flip the fractions

for i in range(2**15): # Representing i as binary to decide which fractions to flip this iteration s = f"{i:015b}" new_fracs = [g.flip() if s[k] == "1" else g for (k, g) in enumerate(fracs)]

if sum(new_fracs, start=Fraction(0, 1)) == Fraction(30, 1):
    # Trying to pick out ten that add to 20, which leaves five that add to 10
    for l1 in combinations(new_fracs, 10):
        if sum(l1, start=Fraction(0,1)) == Fraction(20,1):
            # From the ten, try to pick out five that add to 10
            for l2 in combinations(l1, 5):
                if sum(l2, start=Fraction(0,1)) == Fraction(10,1):
                    print(" + ".join([str(g) for g in l2]))
                    print(" + ".join([str(g) for g in l1 if g not in l2]))
                    print(" + ".join([str(g) for g in new_fracs if g not in l1]))
                    print()

This code runs very quickly on my laptop (the bottleneck might actually be the printing of the solutions, for all I know), so it turns out brute force wasn't so hard after all, at least with a little pruning as we go.

Arthur
  • 199,419