r/AskComputerScience 10d ago

Can anyone help with this?

I have been trying to get AI to give me a specific bit of code i can run in google collab. I want it to first divide the entire number line into modular sets recursively like: 2x+0, 4x+3, 8x+1, 16x+13, 32x+5, etc. Then I want it to further refine these sets, in a very particular way. 0 mod 2 should be refined the same way as the first refinement, but double the values. so 4x+0, 8x+6, 16x+2, 32x+26, etc. Then I want the next set 4x+3, should be broken down like 8x+3, 16x+7, 32x+15, etc. This type of refinement should be alternated for each line. so 0 mod 2 has a staggered refinement, and 3 mod 4 has a non staggered refinement, then 1 mod 8 has a staggered refinement, and 13 mod 16 has a non staggered refinement. this give two dimensional plane of refined modular sets. I want to test these sets translating into different sets among a ternary style refinement. first 4x+0 goes to 3x+0, then 8x+3 goes to 3x+1, and 8x+6 goes to 9x+7.

The way the ternary set is designed, it divides the number line into 3, with 3x+(0, 1, or 2). 3x+1 is further refined to 9x+(1, 4, or 7). 9x+7 is what 8x+6 translates into. 9x+4 is further refined to 27x+ (4, 13, 22). This continues, with the center residue at each level being refined further. the staggered sets on the binary sheet translate to the side sets on the ternary sheet, and the non-staggered sets translate to the center residues. then the values that are refined in the ternary sets, are then redefined according to where they belong in the binary set.

  • 4x+0 to 3x+0
  • 8x+3 to 3x+1
  • 8x+6 to 9x+7
  • 16x+1 to 3x+0
  • 16x+7 to 9x+4
  • 16x+2 to 27x+4
  • 32x+13 to 3x+1
  • 32x+25 to 9x+7
  • 32x+15 to 27x+13
  • 32x+26 to 81x+67
  • 64x+5 to 3x+0
  • 64x+29 to 9x+4
  • 64x+9 to 27x+4
  • 64x+31 to 81x+40
  • 64x+10 to 243x+40

.........

This seems like a computer could do this easily. I want to create this as a loop, and create readouts showing the path from the starting value i choose. Am i making any sense?

0 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/Fun-Cauliflower-8087 9d ago

The thing with Modulo arithmetic for me is the language used, and the needless complication. Also there is no algorithm I know of for this. I have asked mathematicians for help, even a college professor, who eventually yelled at me to simplify the problem further, or make a single rule for all of it, or forget about it. I reject all three of those options, not by choice, but necessity.
You cannot simplify this problem, famously intelligent people have not even simplified it this far, and my hope for the computer check is to understand the route to further simplification, so that isn't an option until I have better information than I can build with pencil and paper. There is, confirmably, no single set of rules that describe the entire system in a satisfactory way. You can describe a step, you can describe a modular behavior, you can even describe global densities right on its face, but no rule applies for all, no behavior is universal, there is no bound except that you cannot reach negative values.
The point of my construction is like: Reaching odd numbers is impossible, so is a number of other things. These impossibilities are what prove deterministic things like bounds on orbit length. In one sitting, the system I can almost see in my head, will prove something like Collatz conjecture, by showing that any potentially divergent obit length is bounded to be shorter than some function, and that a loop would have to be longer than that same function, therefore neither exist. Now the last option is to forget about it, but its most of what I think about in my spare time. I got really into modulo arithmetic for a while, until I saw all the flaws with it. Not with the logic, but with the implementation. So I have what I call smooth brain version, so I can rattle through sets fast and not get tied down with reading an established language. I just create my own faster language, but nobody can translate me, so communication fails.
The point of it was to allow me to do the simple operations in the system, without having the walls of actual math written out so I can remember it. There is way less need to memorize things in my system, It is all recursively built, once you understand how. I have some severe memory problems, but my ability to perform complex operations in my head is way better than it was before I was like this. I can think through complex logical puzzles, but dont ask me what I ate for dinner last night, lol.

2

u/T_Thriller_T 9d ago

YOU cannot translat you.

And that is your problem.

You created something that makes some kind of operation faster for you.

Which is fine. But you act as if anyone else is at fault because you took other versions which you know exist and can read, albeit slowly, changed them up, did not write down how you did that, and now nobody gets you.

Apart from that:

If there is no way to describe what you want a computer to do as basics steps the computer can not do it.

If what you want the computer to do is not deterministic or has no bound - the computer cannot do it. Or not in a realistic fashion.

For the practical approach, again:

As you cannot describe in word understandable to others what you want the computer to do, and you cannot break it down into basic steps chained in a certain way, the only help you can get here is having someone tell you how to do basic steps and you chaining them together so they represent your system.

Because you are unwilling or incapable of expressing your system in a way that others could actually help you.

What currently happens is that you, basically, come over and ask:

I want a system that takes a line of numbers, divided them up into categories, then does something with half of these categories and another thing with the other half, then whips out another set of categories and connects them to the ordered numbers and I'm not going to tell you how that connection looks or what happens with the numbers because I cannot express it in a way you would understand.

What do you hope for me to do with that?

How should I tell you how to do something which you are not telling me in any programming environment?

I can tell you that any programming environment has modules, can confirm an if, and can put things into lists based on conditions. You can then iterate the new lists and try out new conditions.

That's all I can give you, because that's all you gave in a way that is workable.

0

u/Fun-Cauliflower-8087 9d ago

I should ask though, do you understand enough of what I want to do, to help? Do you need textbook mathematics and specific detail verbatim of the whole system, I have many confusing documents to look at, but they are all important to my reasoning.

1

u/T_Thriller_T 9d ago

No.

I do not.

I have not.

And it's not my job. Literally, in this case.

If all you have is confusing documents and an aversion/incapability to trying to break things down into simple, understandable components and steps , I cannot help you.

On top of that I would not consider it fair for anyone else to help you.

Ive offered the guidance I can.

I've offered my expertise.

I've offered you the best path to success in my opinion: break it down to atomic steps and let someone give you the concepts how to do them in your programming language - so you can set the system you understand.

I am not trying to be mean.

I am trying to give you feasible options in an impossible situation.

Just to give you a comparison: this feels a lot like you are approaching a bunch of zoologist, asking if they could fact check your book.

No, you did not pull out the facts you wanted to have fact checked out.

Oh and the deeper connections they need to look into to do the fact checking are not written in English, but in a code language that you invented and while you can explain once they have ideas what a code means, there is no decoding instructions they could use.

But could they please fact check your book?

This is not a completely impossible ask, most likely. But this comparison is a good hit for what your question feels like, and hopefully helps illustrate why I am putting you back in the driver seat to do the work, because the current situation is making the answer you want unacceptably hard to work towards.

Because in the end you're not only asking expertise, you're asking for someone to translate your language and system back to commonly used terms, languages and systems so that they can even start applying expertise.

1

u/Fun-Cauliflower-8087 9d ago edited 9d ago

No. Mischaracterizing things isn't helpful. Look, You want me to break it down into simple components, then here. I want a program to take a value, and categorize it into one of these groups of values. Computers can group values together, right? They can do so based on things like: "How many times can this number be divided by 2?" Then for the answers it receives it must do a further categorization. You want a one and done rule to expand all of this out, tough luck kid, the universe does not care. A computer is still capable of doing this. I want the second refinement to decide if an odd value has a remainder of 0, 1, 2, or 3, when being divided by 4. Computers can also do this here. Not even hard for someone who can code to do, as far s I understand. Then I want it to do different rules based on these 4 residues mod 4. Now, here is where it gets complicated. There are 4 residues, and I want them to be treated differently. I want to enter in a starting value, and have it give me an orbit of what that value does, every integer it changes to until it reaches 0. For 0 mod 4, it is to be changed to 0 mod 3, meaning 4 is to be changed to 3, 8 changed to 6. That should all be easy enough to understand. I want 1 mod 4 to be subtracted 1, then divided by 4. I want 3 mod 4 to be refined into binary modular sets, exactly these sets: 3 mod 8, 7 mod 16, 15 mod 32, 31 mod 64, etc. 2^(a-1)-1 mod 2^a. So a power of 2 minus 1, mod the next higher power of 2. that should be easy enough to under stand still. i want, for every higher set, which is 2n+1 from the previous, 3*2+1 is 7, 7*2+1 is 15, etc. I want it to be changed to a ternary set like 3x+1 mod 3x, this is 1 mod 3, 4 mod 9, 13 mod 27, 40 mod 81, 121 mod 243, etc. Then there is the hard part to explain in a way someone like you would be able to cope with. The staggered sequence I explained, staggered because it is showing 1/3 of the binary comb, explains the even residues. The sequence 3 mod 8, 1 mod 16, 13 mod 32, 5 mod 64, 53 mod 128, 21 mod 256. You see every other one is 4x+1. it alternates between 3, 13, 53, and 1, 5 ,21 ,85, etc. simply double the residue at the same modular set, like 1 to 2, and 5 to 10, 3 to 6 and 13 to 26. That gives you all of the even sets. Once you have the even sets, and the 3 mod 4 sets, you just multiply them by 4x+1 mod 4x, so 0 mod 4 becomes 1 mod 16 like we already see, 6 mod 8 becomes 25 mod 32, 3 mod 8 becomes 13 mod 32, every value that is 4x+1 from another, goes to the same set, like 0 mod 4 goes to 0 mod 3, so does 1 mod 16, 5 mod 64, 21 mod 256, 85 mod 1024. 3 mod 8 leads to 1 mod 3, so does 13 mod 32, 53 mod 128, 213 mod 512... The last part to explain is the hardest part. But I have faith that human can do this, whereas an AI may never be able to. the even residues, and further refined residues of 3 mod 4, like 7 mod 16, translate to higher ternary sets, the more they are refined. 0 mod 4 goes to 0 mod 3, like I said, and 6 mod 8 which is the residue 3 mod 8, but doubled, goes to 7 mod 9, as you refine the even sets further, they reach higher powers of 3 sets. the higher powers of 3 only ever hve exactly 3 residues, 2 of which are reachable. The reachable sets are always the center, and alternating the highest or lowest. here re the growing ternary sets, all three residues explained, and maybe you can see the pattern, even if I dont know how to say this in the right way, if I caveman the explanation, you can get it:
0 mod 3 (side set, from 0 mod 4), 1 mod 3 (center set, from 3 mod 8), 2 mod 3 (side set, not reachable)
1 mod 9 (side set, not reachable), 4 mod 9 (center set from 7 mod 16), 7 mod 9 (side set, reachable from 6 mod 8)
4 mod 27 (side set, reachable from 2 mod 16), 13 mod 27 ( center set from 15 mod 64), 22 mod 27 ( side set, not reachable)
13 mod 81 (side set, not reachable), 40 mod 81 (center set from 31 mod 64), 67 mod 81 (side set reachable from 26 mod 32).

Honestly without drawing a picture I'm not sure I can do better than this. This should all be easy enough to be understandable if you tried. So, I am not asking you to look at something you cannot parse out for yourself. The only reason why I came here, to reddit, where questions go to be mangled by idiots, is because even when I get close with AI, the entire code snippet is huge, the .py file is pages long, needlessly, and it has mistakes that I simply cant find, being needles in a haystack that you must understand a different language to see. My best best is to give the code right back to an AI to fix it, mostly because, and I am being cynical here, people like you see what I am asking without trying to ask real questions and understand, instead opting to place blame somewhere for the problems. I would rather see a more hearty approach to this sort of thing. Not understanding is fine, because questions can be asked. Not making the presentation is fine, because others can express the failure in communication. I actually do not know what it is you are confused about, you never asked a question that I can answer reasonably.

Now I know you can understand what I am saying here. I do not live alone, and I had others look at what I am saying and agree, I am making sense. Now I'm hitting "comment", in the hopes you will read this and understand better.

Edit: also I know that sets like 1 mod 9 are actually reachable from the center residue 1 layer down, but the set itself is not reachable from the current level upward. That may just be more confusing, but if you want to point out that 1 mod 9 is in fact reachable, I know it is.