Math and Logic Puzzles: Redux

This forum is for playing games other than Mafia and Mafia variants.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #200 (ISO) » Tue Feb 15, 2022 4:12 am

Post by Charles510 »

1/4
1/5
1/6
User avatar
implosion
implosion
he/him
Polymath
User avatar
User avatar
implosion
he/him
Polymath
Polymath
Posts: 14417
Joined: September 9, 2010
Pronoun: he/him
Location: zoraster's wine cellar

Post Post #201 (ISO) » Tue Feb 15, 2022 7:12 am

Post by implosion »

Spoiler: Answer
p/q in lowest terms is sent to a/b such that a*p = 1 mod (p + q) and a + b = p + q.

In other words, find p's multiplicative inverse in the ring of integers mod p + q (which must exist uniquely since p and q (and thus p and p + q) are relatively prime with p/q in lowest terms). Set the numerator to that value, and set the denominator such that the sum of the numerator and denominator is preserved.
User avatar
Scigatt
Scigatt
Goon
User avatar
User avatar
Scigatt
Goon
Goon
Posts: 833
Joined: January 4, 2008
Location: Vancouver, Canada

Post Post #202 (ISO) » Tue Feb 15, 2022 8:24 am

Post by Scigatt »

In post 200, Charles510 wrote:1/4
1/5
1/6
1/4
1/5
1/6
In post 201, implosion wrote:
Spoiler: Answer
p/q in lowest terms is sent to a/b such that a*p = 1 mod (p + q) and a + b = p + q.

In other words, find p's multiplicative inverse in the ring of integers mod p + q (which must exist uniquely since p and q (and thus p and p + q) are relatively prime with p/q in lowest terms). Set the numerator to that value, and set the denominator such that the sum of the numerator and denominator is preserved.
Spoiler: Response
This answer has no actual resemblance to how I'm actually implementing the function. I think it's possible that the the two methods are equivalent. Proving that they are seems to be quite the task. I'll get to working on it. PM me if you want my implementation.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #203 (ISO) » Tue Feb 15, 2022 9:16 am

Post by Charles510 »

3/4
2/5
3/5
4/5
User avatar
Scigatt
Scigatt
Goon
User avatar
User avatar
Scigatt
Goon
Goon
Posts: 833
Joined: January 4, 2008
Location: Vancouver, Canada

Post Post #204 (ISO) » Tue Feb 15, 2022 10:18 am

Post by Scigatt »

In post 203, Charles510 wrote:3/4
2/5
3/5
4/5
5/2
4/3
3/5
7/2
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #205 (ISO) » Wed Feb 16, 2022 2:11 am

Post by StrangerCoug »

0.99999
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Scigatt
Scigatt
Goon
User avatar
User avatar
Scigatt
Goon
Goon
Posts: 833
Joined: January 4, 2008
Location: Vancouver, Canada

Post Post #206 (ISO) » Wed Feb 16, 2022 9:07 am

Post by Scigatt »

In post 205, StrangerCoug wrote:0.99999
199997/2
User avatar
Scigatt
Scigatt
Goon
User avatar
User avatar
Scigatt
Goon
Goon
Posts: 833
Joined: January 4, 2008
Location: Vancouver, Canada

Post Post #207 (ISO) » Thu Feb 17, 2022 6:42 am

Post by Scigatt »

implosion's answer was basically correct, though my implementation was dissimilar enough that only now can I prove the equivalence.

Spoiler: Explanation of my procedure and proof
What I did with a given input essentially was to find it on the Stern-Brocot tree, making note of the sequence of turns. I then reversed this sequence, and used that to traverse the tree to get the output.

To traverse the Stern-Brocot tree easily, you need to have a left and right 'ancestor' and their 'descendant', which is their mediant. It is possible to calculate the ancestors from the descendant, but it's much easier to just keep track of the ancestors. To go 'left' on the tree, the mediant of the left ancestor and the descendant becomes the new descendant, and the old descendant becomes the right ancestor. To go to the right the process is analogous.

By convention, the left ancestor is taken as smaller than the right. It is more convenient, however, for this proof to reverse this convention.

Since all iterated descendants of two given ancestors are between them, to capture all positive rationals we need to start with 1/0 as the left ancestor and 0/1 as the right ancestor. Also, it will be helpful to keep track of the numerators and denominators of the ancestors in matrix form(numerator on top). Thus the starting point of the tree is:

Code: Select all

[1 0]
[0 1]

The following matrices then represent going left and right on the tree respectively, if we multiply them in on the right:

Code: Select all

[1 1]  [1 0]
[0 1]  [1 1]

Note all the previous matrices have determinant 1, therefore so does the matrix of any path down the tree. Also, the elements of each path matrix are all integers.
The crux of the proof comes down to two lemmas.

Lemma 1:
From path matrix M get M' by path reversal. Then M' is the 'anti-transpose' on M where m'ij = m(n-j+1)(n-i+1), assuming 1-indexing.

This can be proven by induction.

Lemma 2:
Given a 2x2 matrix A, let s be the sum of all elements and ri, kj represent row and column sums respectively. The following equation holds:
rikj = aijs - det(A)*(-1^(ij))

This can be proven directly.

These two lemmas along with some facts we observed earlier, immediately imply that implosion's method is equivalent to to the path reversal method.
User avatar
Jake The Wolfie
Jake The Wolfie
he/they
Mafia Scum
User avatar
User avatar
Jake The Wolfie
he/they
Mafia Scum
Mafia Scum
Posts: 3593
Joined: July 13, 2019
Pronoun: he/they
Location: Floorda

Post Post #208 (ISO) » Fri Mar 04, 2022 10:30 am

Post by Jake The Wolfie »

The hell is going on here
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #209 (ISO) » Fri Mar 04, 2022 4:13 pm

Post by StrangerCoug »

I should probably come up with a good logic puzzle, come to think of it. Hmm...
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Jake The Wolfie
Jake The Wolfie
he/they
Mafia Scum
User avatar
User avatar
Jake The Wolfie
he/they
Mafia Scum
Mafia Scum
Posts: 3593
Joined: July 13, 2019
Pronoun: he/they
Location: Floorda

Post Post #210 (ISO) » Fri Mar 04, 2022 4:56 pm

Post by Jake The Wolfie »

What lives in the woods, is brown, and is made of concrete?
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #211 (ISO) » Fri Mar 04, 2022 5:07 pm

Post by StrangerCoug »

Here's an easy sudoku puzzle I created:

6739
362
951
64
73
14
812
723
1534

Edit:
Sudoku corrected; three of the numbers were one cell too far to the right.
In post 210, Jake The Wolfie wrote:What lives in the woods, is brown, and is made of concrete?
A cabin?
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Jake The Wolfie
Jake The Wolfie
he/they
Mafia Scum
User avatar
User avatar
Jake The Wolfie
he/they
Mafia Scum
Mafia Scum
Posts: 3593
Joined: July 13, 2019
Pronoun: he/they
Location: Floorda

Post Post #212 (ISO) » Fri Mar 04, 2022 5:24 pm

Post by Jake The Wolfie »

In post 211, StrangerCoug wrote:A cabin?
No
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #213 (ISO) » Fri Mar 04, 2022 5:47 pm

Post by StrangerCoug »

If you prefer a little more of a challenge, I've got this sudoku, too:
185
9583
819
29
6
65
371
6419
184
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #214 (ISO) » Sun Mar 06, 2022 3:48 am

Post by StrangerCoug »

Any takers for the Sudoku puzzles? I had a solution to the first one DM'd to me on Discord a couple nights ago, but I can't officially accept it unless and until it's posted here.
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Kcdaspot
Kcdaspot
He/Him
Jack of All Trades
User avatar
User avatar
Kcdaspot
He/Him
Jack of All Trades
Jack of All Trades
Posts: 5275
Joined: November 17, 2010
Pronoun: He/Him
Location: Yes Im Here Still

Post Post #215 (ISO) » Tue Mar 08, 2022 9:31 am

Post by Kcdaspot »

Hey StrangerCoug

Spoiler: This look right to you?
Image

ALL OF THe PAIRS
A question that sometimes drives me hazy: am I or are the others crazy?
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #216 (ISO) » Sat Mar 12, 2022 3:51 am

Post by StrangerCoug »

In post 215, Kcdaspot wrote:
Spoiler: This look right to you?
Image
That is correct :D

The sudoku in #213 is still available to solve.
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #217 (ISO) » Sat Mar 12, 2022 9:06 am

Post by StrangerCoug »

Or, if you want a harder puzzle than the one in #213, here is a Sudoku X puzzle. On top of the normal rules, each corner-to-corner diagonal must also contain each number from 1 to 9 exactly once.
Image
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #218 (ISO) » Mon Mar 14, 2022 9:53 am

Post by Charles510 »

In post 213, StrangerCoug wrote:If you prefer a little more of a challenge, I've got this sudoku, too:
185
9583
819
29
6
65
371
6419
184
Spoiler:

Code: Select all

921348657
467925813
358716294
296587341
175463928
843291765
532674189
684139572
719852436
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #219 (ISO) » Mon Mar 14, 2022 10:27 am

Post by StrangerCoug »

In post 218, Charles510 wrote:
In post 213, StrangerCoug wrote:If you prefer a little more of a challenge, I've got this sudoku, too:
185
9583
819
29
6
65
371
6419
184
Spoiler:

Code: Select all

921348657
467925813
358716294
296587341
175463928
843291765
532674189
684139572
719852436
Looks good to me :)
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #220 (ISO) » Sun Mar 20, 2022 10:19 am

Post by StrangerCoug »

In post 217, StrangerCoug wrote:Or, if you want a harder puzzle than the one in #213, here is a Sudoku X puzzle. On top of the normal rules, each corner-to-corner diagonal must also contain each number from 1 to 9 exactly once.
Image
This puzzle turns not to have a unique solution (not sure why SudokuWiki didn't catch this and gave it a grade anyway), so I'll give you two more clues from the intended solution:
Image
Should still be plenty hard, though ;)
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #221 (ISO) » Tue Nov 08, 2022 4:41 am

Post by Charles510 »

this one is impossible
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #222 (ISO) » Tue Nov 08, 2022 7:01 am

Post by StrangerCoug »

I think it's fair to just put up another puzzle.
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
User avatar
Charles510
Charles510
he
Goon
User avatar
User avatar
Charles510
he
Goon
Goon
Posts: 219
Joined: March 11, 2017
Pronoun: he
Location: San Francisco Bay Area

Post Post #223 (ISO) » Tue Nov 08, 2022 7:06 am

Post by Charles510 »

yes, please do
User avatar
StrangerCoug
StrangerCoug
He/Him
Does not Compute
User avatar
User avatar
StrangerCoug
He/Him
Does not Compute
Does not Compute
Posts: 12457
Joined: May 6, 2008
Pronoun: He/Him
Location: San Antonio, Texas
Contact:

Post Post #224 (ISO) » Tue Nov 08, 2022 7:09 am

Post by StrangerCoug »

After work :P
STRANGERCOUG: Stranger Than You!

Current avatar by PurryFurry of FurAffinity.

What Were You Thinking XV! is in progress.
Post Reply

Return to “The Whole Sort of General Mish Mash”