Page 9 of 10

Posted: Tue Feb 15, 2022 4:12 am
by Charles510
1/4
1/5
1/6

Posted: Tue Feb 15, 2022 7:12 am
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.

Posted: Tue Feb 15, 2022 8:24 am
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.

Posted: Tue Feb 15, 2022 9:16 am
by Charles510
3/4
2/5
3/5
4/5

Posted: Tue Feb 15, 2022 10:18 am
by Scigatt
In post 203, Charles510 wrote:3/4
2/5
3/5
4/5
5/2
4/3
3/5
7/2

Posted: Wed Feb 16, 2022 2:11 am
by StrangerCoug
0.99999

Posted: Wed Feb 16, 2022 9:07 am
by Scigatt
In post 205, StrangerCoug wrote:0.99999
199997/2

Posted: Thu Feb 17, 2022 6:42 am
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.

Posted: Fri Mar 04, 2022 10:30 am
by Jake The Wolfie
The hell is going on here

Posted: Fri Mar 04, 2022 4:13 pm
by StrangerCoug
I should probably come up with a good logic puzzle, come to think of it. Hmm...

Posted: Fri Mar 04, 2022 4:56 pm
by Jake The Wolfie
What lives in the woods, is brown, and is made of concrete?

Posted: Fri Mar 04, 2022 5:07 pm
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?

Posted: Fri Mar 04, 2022 5:24 pm
by Jake The Wolfie
In post 211, StrangerCoug wrote:A cabin?
No

Posted: Fri Mar 04, 2022 5:47 pm
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

Posted: Sun Mar 06, 2022 3:48 am
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.

Posted: Tue Mar 08, 2022 9:31 am
by Kcdaspot
Hey StrangerCoug

Spoiler: This look right to you?
Image

ALL OF THe PAIRS

Posted: Sat Mar 12, 2022 3:51 am
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.

Posted: Sat Mar 12, 2022 9:06 am
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

Posted: Mon Mar 14, 2022 9:53 am
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

Posted: Mon Mar 14, 2022 10:27 am
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 :)

Posted: Sun Mar 20, 2022 10:19 am
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 ;)

Posted: Tue Nov 08, 2022 4:41 am
by Charles510
this one is impossible

Posted: Tue Nov 08, 2022 7:01 am
by StrangerCoug
I think it's fair to just put up another puzzle.

Posted: Tue Nov 08, 2022 7:06 am
by Charles510
yes, please do

Posted: Tue Nov 08, 2022 7:09 am
by StrangerCoug
After work :P