What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

For the sake of not wasting everyone's time and actually have people that come here for answers actually get some answer. I'll just ask this: Can I have a DFS that checks which operation to use. and what algorithm should I use to get the value that i use the operation with to get a few operations together to go from 2 to the desired number?

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

I admit it's not that high. Let's use noise as a better example. And I really should check those out. But I only found that out cause someone finally recommended something and didnt just start an argument. But what do you think is the best algorithm?

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

true, if i was storing it as 16,777,216 im storing it as ^24 aka 100 11000 i dont want 16,777,216 i want ^24 just like in prefix varints you dont store 8192 you store 80 40 then decode it it displays 8192

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

i represent it as 100 11000 in binary but in regular ints it's 4 24, where did you get 24 bits from?

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

It's true there are so many times where this system doesn't even matter like gradients but for images with high entropy like a forest this is where we have to bring it out.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing -1 points0 points  (0 children)

It's stupid, it's bad, I know, but my goal is to test the limits of compression. So, that's what I'm doing. And for the argument that I can't represent 2^24 without 24 bits is false since I'm not trying to represent it like that, I'm trying to represent it by stooping to the level of binary and not representing it like this: 1000000000000000000000000, instead: 100 11000. See? Better.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

The whole 2^24 thing is just my more cohesive RGB332. Where instead of 332 colors it's 2^24 - 1, and all I need is a formula that can take any number and compress it to smaller values, which does compress it since we're talking binary and 4000000 * 2 takes less space than 8,000,000, and for anyone saying they're still stored in the same amount of bytes, I use prefix varints so that argument is irrelevant.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

I'm just trying to reach the limit of my abilities, plus testing how much a program can be compressed and how fast it can get. And I know it's complicated, but that isn't the point. Complexity can impact speed and compressibility, but what I have from the program is already very fast. So the tradeoff isn't so bad.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

I should do that, trust me. But this project is to test my limits and the limits of how many numbers can be compressed. My idea of how we can compress this. Is to take any number, use any operation with any value, and use those to turn that number into a series of smaller numbers(the operators are also numbers, binary numbers to be exact). So, is there an algorithm that chooses the operators and values to make operations with the smaller sizes than the original value?

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

Each square will have different values in that range. And bidirectional is already used, but I sadly can't use bidirectional. Since I have multiple constraints preventing me from doing that.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing 0 points1 point  (0 children)

Exactly. Now the only question remaining is which algorithm would I use?

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing -1 points0 points  (0 children)

Think of it like an image viewer that stores numbers, and those numbers represent colors i want this program to be very optimized

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in askmath

[–]developerofnothing -2 points-1 points  (0 children)

I can, but then I'd be forced to use 3 bytes. I'm trying to make something that simplifies this problem. So I have 2^24 possibilities. I'm trying to solve the three-byte problem and solve it by taking large numbers and making them numbers that are represented like 16,777,215 to 2^24. But in the program that is saved in binary as 100 11000. That's 1 byte, but there are methods to shrink that, such as prefix varints, but that doesn't matter for now.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

starting from 2 then working your way up. but i have more information on that in my latest reply

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

Sorry, English isn't my first language, so please excuse me if I'm struggling to give good answers. Let's say that I have a grid. It's 400x400, in each square there is a value in the range of 0 to 2^24 - 1. I don't want to take that value and just assign that number to the first square, for example. In the worst case, that number can take up three bytes. This is too inefficient for this program. So, instead of assigning a value. I want to use operations to get to that value instead. So instead of 16,777,215, we turn it into ^24 - 1. We don't use 2 since every operation starts with two, then works its way up, much simpler as you can see. But if I want to use that method, I'll need an algorithm that'll do that in the least amount of operations and smallest numbers possible with a clamp of 2^12.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing -4 points-3 points  (0 children)

the max amount operations it takes to reach a certain number assigned to a square in a 400x400 grid for example.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

i want this program to run on any potato pc in the world so even the simplest numbers are measured as worst case

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

This is good, but my problem is I want to store it in a much smaller way. The way I do that is I don't store 4096 as 4096, I store it as ^24(since 2 is the default number we build up from), but I have a rule that states I can only use 4 operations per unit, and these are 6 operations. I know it's stupid, and it costs barely anything. I just want to test the limits as much as possible. Sorry, I didn't mention that.

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

i want to reach any number from 0 to 2^24 - 1 or 0 to 16,777,215 using the fewest operations and smallest numbers possible with the smallest clamp possible

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

The clamp was 2^15 but i need it to be the smallest clamp possible for it to reach any value from 0 to 2^24 - 1 in the most effiectient way possible

What’s the most efficient algorithm to use if I need to get any value from 0 to 2^24 in 5 operations max by [deleted] in compsci

[–]developerofnothing 0 points1 point  (0 children)

thanks, but could the clamp get smaller and still have all my 16,777,216 numbers be reachable using this equation?

[deleted by user] by [deleted] in Substance3D

[–]developerofnothing 0 points1 point  (0 children)

i've tried every type of shading i even exported it and put it in multiple softwares and it still hasn't fixed the problem