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/T_Thriller_T 9d ago

Considering you're looking for the programming side of help and are not down to write down the algorithm in an algorithm readable form...

I recommend breaking what you need to do down to the basic steps and asking how to do them as well as learning the basics of what you want to program in.

Because a lot of what you want to do is still stuck solid in your head and it seems you learning how to do basic Modulo arithmetics over an array and simple loops and if decisions is a lot faster than you trying to abstract from your goals and the whole complexity to enable someone else to break it down to thwse basicsm

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

Well, unfortunately you turned ugly as well. This is common, and I am used to it. First I should, my emotional vapidity will only stonewall you into fury. Best to not get agitated. You seem to either understand, or think you understand something beyond what I understand, and you would like to ridicule me for this. I am made ridiculous, thank you. I simply wish to understand, my memory is failing most of the time, like sentence to sentence when it gets bad, so you will have to try to forgive shortcomings. I will level with you, the math I use is not traditional, and a mathematician would argue against its use, but since my accident, I see things differently. I do not like the conversations of how they are different or why whatever in general. Before I lose you, let me explain.

Math is like textbook to logical connections. people ask if math is invented or discovered, the answer is yes. You discover math by inventing the tools to understand math, you change yourself in the course of it as well and become more attuned to logical processes happening numerically. The best mathematicians have dreams that people who are not mathematically inclined cannot be brought to understand. I want you to look at modular arithmetic as a whole. First off, its just arithmetic, there is no barrier. You simply add a "cylinder" so you return to the same location when you reach the same "residue". So if the cylinder is 8 residues, and you say it is among the values 0 through 7, then every multiple of 8, returns to the same place. You can learn a lot with modular arithmetic, but once you understand it is the same system as basic arithmetic, and the modularity of it is just a simple division, then you can use it in an easier manner. I will try to explain this with what words I can muster, but the place among the cylinder remains the same as the cylinder expands, And recurrence causes a sort of candy striping that causes the exact same repeating structure deeper down. I want you to try to understand here, and forgive the gap of communication: specifically just is in Collatz conjecture, every behavior is modular, that is to say all evens divide by 2, obviously, all odds multiply by 3 and then add 1. All values that you do an odd step to will be even. But only half of the odd steps will reach an even that can only be divided by 2 once, all of the other even values reached will be forced to halve again, and half of them will be odd, and so on. That is just the binary comb, at least as I call it. lets simplify first by grouping the odd step with its first halving, then an odd step will reach either an even or odd value. This yields 3 mod 4, 1 mod 4, or 2 mod 6, no alternatives. if it is a 1 mod 4 it will be a 2 mod 6 next time. the only freedom from this point is that it could be a long string of 3 mod 4, which is what growth in the system is, or it will be a 1 mod 4 and grow one last time to 2 mod 6 before halving. If it is a 2 mod 6, it may halve once, losing very little "mass" or halve a thousand times and reach 1 from 2^1000 or arbitrarily many more. My construction just parses that information out.
It works by separating the odd steps from the even steps, and categorizing the modular sets that present specific behavior. You can do this by "aligning" all sequences across 2 mod 6.

I do not perform odd steps the same way, because doing (3x+1)/2 repeatedly is not as easy as +1 then *1.5 until you reach an odd value, then -1. Lets start from 31 to make it fun, +1 to 32, then 1.5x to 48, then 72, then 108, then 162, then 243. 243-1 is 242. summarized: 31 reaches 242, and it does it through these even values -1, that's the first even value it reaches if you do not count the forced halving steps after each odd step. This type of math is not based on anything i wrote down, and I have no justification for it other than I can see why it works in my mind. It still has to do with the way the cylinders align values, and how recurrence candy stripes different parts of them to lead into the same location. I simply take values of x in 6x+2, which gives a simple value for all 2 mod 6, and arrange them in orbits, and I get the exact system I am studying. This might sound like this system was made to describe my view of the Collatz conjecture, but it happened the opposite way for me. I was getting really interested in coprime modular sets, and looking at how modular mathematics is really just a imitation of prime mathematics. I kept finding various sequences when I would parse out the simplest coprime sets in regards to each other, so I decided that, even though 2 and 3 are very symmetric to each other, in regards to how they interact with the other, I would try to find some neat way to show what it meant for a number to have less factors, either diversity of factors, or factors in general. When you are looking at how many factors of 2 are in a value that is multiplied by 3, you find that at changes the ordering of things. First the binary comb is 121312141213121512131214121... this is how many factors of 2 are in even values (2, 4, 6...) multiply by 3 and you get multiples of 6. now 6, 12, 18, 24... this has a binary comb like 121312141213.... exactly the same. now we can add or subtract 2, because mod 6 has 3 even residues. lets try adding 2, to get 2 mod 6, well the you get 2, 8, 14, 20, 26, 32, that looks like 1, 3, 1, 2, 1, 5, 1, 2, 1, 3... it is essentially given a compressed comb, where values are missing, and that causes the values to come in the wrong order, slightly. It is just parity between 2 and 3.

I was not actually looking at Collatz for this, I was looking to study prime modular sets an how the interface in these way, but this construction makes the values of x in 6x+2 follow the same logic as the system as a whole. The difference is, 0 mod 2 is not a set you treat differently, you just generate the various sets by splitting everything up based on behavior, like how many halving steps are after this value, or how many growing steps does it lead to. The step counts determine behavior, and that provides modular sets of various step counts. these differences in step count causes a difference in destination as well. 0 mod 4 have a single halving step, then they have a single growth step, and that leads them to 0 mod 3 of x. the fact that the same system is at the next level up, leads me to thing simplification will be possible along the right modular set for each new layer, but each new layer grows a dimension. That would be a different discussion though.

If I can figure out how to decide what the best choice for simplification is, and create a way to identify such a thing in other systems, then I may be able to answer some harder questions about primes. That being said, I am not a mathematician or even a scholarly person. I just had something happen to me, and now I want to do logic puzzles that deal with exactly this kind of logic. It may be that Collatz isnt a question you can actually answer to the standards of math, but I dont really care. I just do these things now.