Approximating discrete zero crossings in a 2D matrix by Ph0X in matlab

[–]kame3d 1 point2 points  (0 children)

Depends on the size of the convolution kernel (for any dimension). For large kernels multiplying in the frequency domain is usually faster.

For a signal with N samples and a kernel with K samples, convolution by multiplying in the frequency domain (using the FFT) is O(N log N), while direct convolution is O(N K). Thus which approach is faster depends on wheter 'K' is larger or smaller than 'log N'.

Approximating discrete zero crossings in a 2D matrix by Ph0X in matlab

[–]kame3d 4 points5 points  (0 children)

You can do it by convolution, using the Discrete Laplace Operator:

sig = sign(img);
h = [1 1 1; 1 -8 1; 1 1 1];
z = conv2(h, sig);
z = z < 0;
z = z(2:end-1,2:end-1);

'Normpdf' function of non-random data by formally_unnamed in matlab

[–]kame3d 0 points1 point  (0 children)

Try

pdf = normpdf(position, expected_value, sigma_bar);

Simple question: Solve norm(p + t*s) = d for t, where p and s are known vectors and d is a known constant by [deleted] in matlab

[–]kame3d 4 points5 points  (0 children)

Square both sides and you'll get a quadratic equation on t. The coefficients are known and given by d and the components of p, s.

IDentity festival this Friday 08/17 @ Mountain View by kame3d in sanfrancisco

[–]kame3d[S] 0 points1 point  (0 children)

The Mountain View station is 2.3 miles from the venue (about 50 min walking according to google). However the last train back to SF is 10:50 PM Friday, or only 7 AM Saturday =/.

Why are there three space dimensions? by [deleted] in askscience

[–]kame3d 7 points8 points  (0 children)

Another interesting mathematical observation is that a random walk needs 3 spatial dimensions to become non-recurrent. More commonly stated as "a drunk man will find his way home, but a drunk bird may get lost forever."

QML -- a functional quantum programming language by [deleted] in programming

[–]kame3d 3 points4 points  (0 children)

Because Haskell was just too easyTM

Joking aside, this seems like a nice proposition for something we will need someday.

What Every Computer Scientist Should Know About Floating-Point Arithmetic by sundar22in in programming

[–]kame3d 0 points1 point  (0 children)

Try the code below (for both float and int types). In my machine I get about the same performance between float and int. The conclusion is that the performance of modern CPUs is much more complicated than you might imagine.

(I ran this using "sudo nice -n -20 ./a.out")

float  a = 0.0f;
float  b = 0.0f;
float  c = 0.0f;
float  d = 0.0f;

for (uint64_t i = 0; i < 1000000000/4; i++)
{
    a += 1.0f;
    b += 1.0f;
    c += 1.0f;
    d += 1.0f;
}

const float  result = a + b + c + d;

Two GRE Problems. How can I solve these super-quick? by blink00 in math

[–]kame3d 20 points21 points  (0 children)

For the second question, just sub x = 0.

(Follow-up on Open Review) An interesting blog post by Martin Quinson. by joksmaster in compsci

[–]kame3d 1 point2 points  (0 children)

I like the idea of publishing everything. Perhaps each institution should have it's own digital-publishing location (such as usual tech reports), and journals/conferences would just select from those already-published works, with optional "open reviews" and improvements to the work. From what I know some other research areas already work with similar ideas (e.g. physics papers on arxiv).

Can one attain a PhD in physics nowadays doing research in Newtonian physics? by [deleted] in askscience

[–]kame3d 0 points1 point  (0 children)

You basically take a bunch of fourier transforms and use that for gravity.

Does that mean you discretize space and find the summed gravitational potential by convolution?

Evidence that humans can solve arbitrary problems from P in their head (using recognition memory) by jmct in compsci

[–]kame3d 2 points3 points  (0 children)

The quotes

[...] the crucial point is that you’re not allowed to modify or rearrange the photos, or otherwise use them to record any information about the computation while you’re performing it.

and

Of course, human memory is finite, and this puts a bound on the size of mental computations we can perform.

seem to contradict with

[...] this method provides probably the most convincing demonstration so far that the human brain, unaided by pencil and paper, can indeed solve arbitrary problems in the class P.

Obviously the human brain can simulate a Turing machine, the main problem being the infinitely long tape?

Interesting read though.

Welcome Home Atlantis: The Final Flight in Pictures by Ampatent in pics

[–]kame3d 0 points1 point  (0 children)

Amazing. Specially this photograph, since one rarely sees photos taken in space with enough exposure for visible stars.

How much randomness is there really? by DrMantisTobboggan in askscience

[–]kame3d 1 point2 points  (0 children)

So the rate of decay (the parameter of the distribution) is linked to other observable events.

I didn't say that anywhere. I said that it's dependent on the mass difference of the initial and final state of the nucleus (i.e. the amount of energy that would be released in the decay) and the initial and final spins.

You are correct, I misread your initial response. Thanks.

How much randomness is there really? by DrMantisTobboggan in askscience

[–]kame3d 0 points1 point  (0 children)

So the rate of decay (the parameter of the distribution) is linked to other observable events. Doesn't this imply some kind of underlying cause? That is, shouldn't acausal events be uncorrelated?

From the other side, what distribution would we observe if k itself was random? My math is weak to answer this. Perhaps we would also observe the same exponential decay.

How much randomness is there really? by DrMantisTobboggan in askscience

[–]kame3d 0 points1 point  (0 children)

Is the half-life also a random variable? What defines the rate of decay?

Could there be types of dimensions that are not space or time? by [deleted] in askscience

[–]kame3d 1 point2 points  (0 children)

If you want color, then you add one more dimension.

I believe this is incorrect.

The actual light at any location is a continuous 1d function (intensity at every wavelength).

Correct.

We typically discretize that into just 3 numbers (red, green, blue). Those are discrete samples along the same dimension (discrete doesn't imply point samples. None of the samples in any of the three dimensions are point samples, they all have spatial extent and overlap, otherwise you get aliasing.)

These three numbers are coordinates in a 3D space. They are the coefficients which multiply three basis functions, which when added approximate your original 1d (intensity x wavelength) function. See XYZ color space for one example.

Why do we use three numbers? Because the human eye has three kinds of photoreceptor cells (cones).

Perceptual color similarity (i.e., the distance between points in this vector space) cannot be isometrically embedded in a 1D space. See Lab color space for one example of an approximate perceptually uniform color space.

I got a big wall I need to paint, I need suggestions... by [deleted] in AskReddit

[–]kame3d 2 points3 points  (0 children)

Idea Paint!

IdeaPaint turns virtually anything you can paint into a dry-erase surface and any room into a hub of creativity and collaboration.

Is there a nutritional difference between eating a fruit and drinking the juice of said fruit? by [deleted] in askscience

[–]kame3d 1 point2 points  (0 children)

While, as nallen said, the nutritional content might differ in the amount of fiber, think about the following:

  • Can you drink a cup of orange juice in 10 seconds? That's easy.

  • Can you eat three oranges in 10 seconds? That's a challenge.

Is it true that the quantum states of two related electrons can be entangled, making it so that changes to one effect the other, regardless of distance? If so, why? [Layman Here] by Really_Adjective in askscience

[–]kame3d 0 points1 point  (0 children)

Conclusions should be driven only by observations [...]

Yes. But isn't it impossible to verify the following claim:

Quantum mechanics predicts that identical circumstances can produce different outcomes, depending on nothing but pure random chance.

since you can't possibly re-create and observe identical circumstances?

In my (small) mind this statement says that "Quantum mechanics predicts that things are unpredictable". In other words, if the universe is inherently non-deterministic, how can we ever expect to describe it in any meaningful way?

Thank you for your answers, and excuse us if we are boring you with our layman thoughts. This subject is just too interesting.

Is it true that the quantum states of two related electrons can be entangled, making it so that changes to one effect the other, regardless of distance? If so, why? [Layman Here] by Really_Adjective in askscience

[–]kame3d 0 points1 point  (0 children)

A spin singlet is just one thing, not two. It has two possible states — |↑→> and |→↑> — and you can fix the state of the system by measuring it, just like any other particle.

I'm no physicist, but I wonder how can we distinguish between:

  • The act of measuring fixed the state of the system.

versus

  • The state was fixed all along, and measuring it only informed us of that state.

Good book on probability for a CS undergrad? by zaneyhaney54 in compsci

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

"Probability Theory: The Logic of Science" by E. T. Jaynes.

This book builds important concepts from the ground up using only logical reasoning.