Tag Info

Hot answers tagged

12

Genetic Algorithms and Neural Networks are not suitable here. They are meta-heuristics for finding a good-enough, approximate solution to a problem. Notably, both require you to find a cost function to rate candidate solutions. Once you have such a cost function, it might be easier to manually come up with an algorithm that optimizes for this cost. This is ...


9

Most compression algorithms are deterministic. Being "adaptive" in no way contradicts being "deterministic": it only means varying behavior based on input, so if the input is the same, so will be the output. You can easily verify this by compressing the same file several times using an algorithm of your choice (zip, gzip, bzip2, 7z, etc.) and comparing the ...


9

You can use simulated annealing. I did something like that before I landed my first job - see https://vimeo.com/20610875 (demo starting at 2:50, algorithm explained from 6:15). Simulated annealing is a type of a genetic algorithm, and maybe it was not suitable in theory (as @amon maintains in his answer), but it worked very well in practice, and it was ...


6

Genetics Algorithms do apply here. During my undergraduate program, one of my colleagues wrote a paper to very similar problem of yours. You can look for Job Shop Scheduling and also Open Shop Scheduling or Flow Shop Scheduling can be interesting starting points To use a genetic algorithm you don't need a perfect solution, you can start with N random ...


5

Since the result of your (fixed) code still confuses you, i try to answer your question: The O-Notation is not an exact formula notation. Only because something is O(1) doesn't mean it takes one single step, only because it is O(n²) doesn't mean it takes n² steps. The O-Notation is an abstract way to define how complex an algorithm is. Sure, you don't get ...


4

After you take off the 13%, you have 87% remaining. You multiply by 0.87 to get your revenue: $230 * 0.87 == $200.10 From this point, it's basic algebra to show if you know the $200 you divide by 0.87 to get $230. So, your formula is: original price / (1 - fees) $200 / (1 - 0.13) = $229.89


4

You say "maximise your damage, attack speed and armour". I think the answer to your question is to accurately define what this means. You can only "maximise" a single value. If you have multiple values you need to provide a function to turn them into this single value you want to maximise. What makes a "good" function for this is entirely application ...


4

The technique your boss has told you to use is one of the common ways of preventing cross site request forgery. I think you're probably getting confused by the multiple meanings of "hash" which in this case probably refers to a secure hash (eg SHA256) rather than a hash that you might use for a hash table.


3

Vector subtraction should be enough. And find the mean (or root mean square) of the absolute differences-- the smaller, the closer match. EDIT: Example: ** Root mean squared = Sqr(Sum(xi²)/n) where xi are Differences


3

Signal processing is a huge topic, and a lot depends on your application, but a good start for your research would be a Kalman filter. It's recursive, so it doesn't require storing the entire history, and is commonly used for tasks like filtering outliers out of a sensor signal.


3

To get you started, you should start reading about Moving Average which is the simplest smoothing method and is being applied to many fields outside signal processing because its explanation is perhaps the most understandable to everyone not having signal processing backgrounds. In particular, all of the Moving Average methods belong to causal systems, ...


2

As amon said, this is theoretically possible with the addition of orientation/rotation sensors. In practice, it really depends on the accurracy required. The calculations are all integrals, so they tend to accumulate errors very fast. This means, the calculated endpoint of the circle in your example will be away from your origin, even if you carefully move ...


2

You can make a window function that takes weighted samples of adjacent elements and creates a second, smoother data set. There are several popular ones. Triangle, square (flat), Hann, Hamming, Blackman, Gaussian, etc. Quite a few resemble a bell curve. Each has a different effect on the signal. The individual sample weights will always equal 1 so your ...


2

There are certainly a lot of algorithms for this. Probably the simplest one would be to change the value at every point to the average within x datapoints in the original. Maybe not the best quality answer, but you can literally just choose from a list here: https://en.wikipedia.org/wiki/Smoothing#Smoothing_algorithms


2

The googleable name for your problem is creating a statistical classifier. It's quite a large topic. You can try a basic vector subtraction like kunthet's answer and see if it works for your application. However, if you end up with a lot of incorrect classifications, there are many considerations that can drastically improve the accuracy of your ...


2

The difference is in usage and properties necessary for the usages. Checksums basically detect (and sometimes correct) small amounts of non-malicious, unintentional data corruption: invalid input transmission errors storage degredation In all uses, a checksum and data are combined so that the original data can be recovered. In most encodings, the ...


1

Everyone who said your utility function needs to track the actual problem domain is correct. Here’s my advice on how, specifically, to do that. The utility of weapons and armor in a D&D-like RPG is that they help you win battles. How useful at the margin better armor or a better weapon are is going to depend on what you’re fighting: more damage is ...


1

Since the data can be considered vectors, vector arithmetic offers a simple solution. This approach has the advantages of either allowing the use of an existing vector library or creating a vector library, which you can then use for other projects. "Closest" is a question of distance. There are various metrics that give distance between Cartesian vectors, ...



Only top voted, non community-wiki answers of a minimum length are eligible