Mathematical function where slow increase at start and fast increase at end [closed] - algorithm

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have number x=[0,n], where n>0.
I want to construct a function y=f(x) such that the value increase slowly from 0 and increase very fast when approaching n, and when reach n, y is infinity. What is a good function to model this?

1/(n-x) - 1/n will work.
There are plenty of other functions log, atan, x^(-k),... that goes to infinity at some point.
a^y is another set of functions with fast grows - maybe more suitable for coding as it can reach arbitrary large (but finite) values.

Related

How to align long texts? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to align a pair of long texts with ~20M chars each.
I've used in the past Smith-Waterman algorithm but (from my limited understanding) it requires creating a 2-dimensional array with the size of the texts (20M by 20M array) - which is not practical.
So I'm looking for an algorithm to align a pair of long texts that will keep a practical memory size and execution time.
UPDATE
I've also tried Myers and Miller using this implementation: https://www.codeproject.com/Articles/42279/Investigating-Myers-diff-algorithm-Part-of
But I still got out of memory exception on "not so large" texts (1MB).

What takes less time to complete, comparing two variables, or assigning a new value to a variable? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Basically what I'm saying is, which operation takes less time to complete? I know the time it takes to complete 1 of these operations is too fast to measure, but I would assume that there would be some way to explain what happens that could explain which one is faster.
Also, I would assume that comparing two variables would be more taxing on the CPU and assigning a value would be more RAM taxing. Is that correct?
In American football, this would be like asking which is faster:
A running play?
A passing play?
It's too vague, too general to have any kind of sensible answer.

Algorithm for maximum value of a continuous function [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Are there any algorithms for finding the maximum value of a continuous function, which is proofed to be bounded upside?
For example, a function similar to sin.
I think Newton's method and Mid-point method are for finding a fixed value, any other methods for finding maximum value?
For general functions that are "Lipschitz-continuous" (meaning that the output changes by at most a constant factor times the change in input) see e.g. http://link.springer.com/article/10.1007%2FBF00938542#page-1 and http://link.springer.com/article/10.1007%2Fs10898-012-9937-9#page-1 . If your function is arbitrary continuous and not Lipschitz-continuous, then in theory the function could change to an arbitrarily high or low value over an arbitrarily small region, so provable global optimization is very hard.

Energy in simulated annealing algorithm? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Am I correct in saying the energy in the simulated annealing algorithm is equal to the change in cost?
So I can calculate it with the follow:
energy = cost(prevSolution) - cost(currentSolution);
The term 'energy' can have various definitions, but it usually means the current objective value, or the cost of the current state, that is cost(currentSolution).
The difference you defined, along with some transition function, usually specifies the transition probability from one state to another.

Howto use mutil-images to simulate the slow shutter speed of the SLR camera [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
When you use slow shutter speed of the SLR camera to take photo . You can get special effect. for example http://img.photobucket.com/albums/v157/Oilfan94/Rocky%20Mountains%20-%202007/5856-FR-web.jpg.
Are there any possibilities that I use mutil-images to simulate these result. I mean take a series of photos from the same scene. Then merge these photos. I have tried to merge these images . but the effect is so bad
Since a pixel value in a photograph corresponds to the amount of light that reached that point on the sensor while the shutter was open, I'd assume you could just do (pseudocode)
out(i, j) = sum(frame_n(i, j) for each n) / n
to get the average over the time interval.

Resources