#๐Ÿ”’ Domino problem.

48 messages ยท Page 1 of 1 (latest)

clever hound
#

Hello! Could anyone please help me solve the following problem about dominos. (I'm personally not a great programmer, I only know the basics, this is actually an exercise I have to complete in Maths, but I figured that It's very solveable with Python. I've been trying to do it manually for like the past 4 hours and I still haven't got the solution. (I'm moving dominos IRL, but since there are so many ways to arrange them, its kind of useless)

noble ferryBOT
#

@clever hound

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

clever hound
#

Also AI wasn't able to solve it, and Im not strong enough in Python to do so myself, perhaps someone could help me?

lilac hare
#

im interested

#

could you help explain to me what the question means lol, having trouble comprehending it

clever hound
#

Yea ok

#

Basically you only take the 21 dominos that dont have equal amount of points on each side (so no 0;0 , 1;1 , 2;2, 3;3 , 4;4 , 5;5, 6;6) - dont use these. Then you have to put the rest of the 21 dominos into this 6x7 grid. And basically you must put them in such a way, that in no line or column there is even one box, where you have the same amount of points.

#

This is the closest i got, however i cant put the last domino in

#

because the last domino is a 0;2 and then 0 would appear in one of the lines twice, which isnt allowed

lilac hare
#

so kinda like sudoku?

clever hound
#

i guess

lilac hare
#

i see

clever hound
#

my friend got this, but theres a problem that this answer is unbuildable with dominos, I tried it, but I always end up in a situation, where I need to use a domino, thats already been used

lilac hare
#

hm well

#

can there be duplicate dominos?

clever hound
#

no

#

you must use every single one once

lilac hare
#

so you cant have 2 pairs like (1, 6) (6, 1)

#

type of thing

clever hound
#

nope

clever hound
lilac hare
#

alr alr

#

i will think of an idea this is tough

lilac hare
#

i like your friends approach but hard to manually tell if arranging the dominos like that is even possible

#

i will try to write an algorithm to figure that out

brave patio
#

is this hw?

clever hound
#

yea, well i must be slow then, cause im still trying to do it by hand

#

i always have 3 or 1 that i cant put in

clever hound
brave patio
#

i'll try and guide you to my solution then

clever hound
#

alright

brave patio
#

let's start with looking at

0 1 2 3 4 5 6
1 2 3 4 5 6 0
2 3 4 5 6 0 1
3 4 5 6 0 1 2
4 5 6 0 1 2 3
5 6 0 1 2 3 4
6 0 1 2 3 4 5
#

this is a 7x7 grid of numbers

#

if we get rid of any row, then if that resulting grid is tileable by the dominoes, we're done

#

right?

clever hound
#

yea

brave patio
#

k

#

now notice that any permutation of that 7x7 grid still has that property

#

that if you remove any row and the grid is still tileable, we're done

clever hound
#

right

#

ok ill try it for a bit i have an ideda

#

cause before i was kind of randomly building it

brave patio
#

i'll give a hint: ||my solution is entirely made up of vertical dominoes||

#

another hint is that ||you might want to look at separating the dominoes into three categories based on the difference between the two numbers||

clever hound
#

hmm alright, thanks for the tips... i gotta eat lunch now and ill try to complete it afterwards, thanks

noble ferryBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.