5,194 karma · joined May 2, 2012
It's not hard to remember that `__add__` is using extra resources when I'm working with big matrices in NumPy.
Rust is really appealing as a C++ replacement, but it has too many rules to replace Python for one-off scripts. Still need to try Nim and Swift, I guess...
> Here's how to make an image in html:
I think you meant "markdown" instead of "html".> there might be an even faster linear algorithm,
but
> it's possible to do selection of an unsorted list in O(n) time. At one point, we didn't know whether that was even possible.
For me, the moment of clarity was understanding that theoretical CS mainly cares about problems, not algorithms. Algorithms are tools to prove upper bounds on the complexity of problems. Lower bounds are equally important and cannot be proved by designing algorithms. We even see theorems of the form "there exists an O(whatever) algorithm for <problem>": the algorithm's existence can sometimes be proven non-constructively.
So if the median problem sat for a long time with a linear lower bound and superlinear upper bound, we might start to wonder if the problem has a superlinear lower bound, and spend our effort working on that instead. The existence of a linear-time algorithm immediately closes that path. The only remaining work is to tighten the constant factor. The community's effort can be focused.
A famous example is the linear programming problem. Klee and Minty proved an exponential worst case for the simplex algorithm, but not for linear programming itself. Later, Khachiyan proved that the ellipsoid algorithm was polynomial-time, but it had huge constant factors and was useless in practice. However, a few years later, Karmarkar gave an efficient polynomial-time algorithm. One can imagine how Khachiyan's work, although inefficient, could motivate a more intense focus on polynomial-time LP algorithms leading to Karmarkar's breakthrough.
A few thousand elements is still small for a computer. I would be curious to see a benchmark comparing sorted arrays of intervals against the fancier structures.
Also, its tools for editing embedded videos are quite less capable than PowerPoint's.
Not sure if PowerPoint can do the table cell thing. But overall, I still feel the perfect slide making software doesn't exist yet.
> the function which maps sample space outcomes to numbers,
the "numbers" referred to in the codomain are not probabilities. Similarly, in the Wikipedia definition,
> a measurable function from a sample space... to a measurable space,
the "measurable space" codomain has nothing to do with probability of events. Random variables are related to probability distributions/measures, but they are not the same kind of mathematical object.
As a concrete example, consider gambling on a fair coin flip. We can bet 1 unit of money on Heads and define a random variable for the amount of money we win/lose. First we set up the probability space. The sample space is the 2-element set of coin sides, Ω = {H, T} (Heads and Tails). The event set (aka sigma-algebra) F is the power set of Ω: F = {{}, {H}, {T}, {H, T}}. The probability measure assigns probability 0 to the event {}, probability 0.5 to each of the events {H}, {T}, and probability 1 to the event {H, T}.
Now, we can define the random variable of our winnings by the function X mapping Ω to the real numbers by Χ(ω) = 1 if ω = H, -1 if ω = T.
So, within the setting of the probability space (Ω, F, P), the random variable is defined by the function X, which does not map anything to a probability. It maps coin sides to real numbers, including negative ones!
We have not yet constructed any object that gives the probabilities of the possible values of X. The only thing that "maps an outcome to a probability" in our setup so far is the measure P, but that is defined independently of our numeric random variable. If we want to talk about the probabilities that X takes the values -1 and 1, we are talking about the pushforward measure of P by X. This is another mathematical object, distinct from the random variable X itself.
This is one of the points of the article. Suppose we define another random variable Y for the winnings of the person we are gambling against: Y(ω) = -1 if ω = H, 1 if ω = T. Now X and Y are two different random variables, but they have the same distributions! The pushforward measures of P by X and Y both put probability 0.5 on the measurable sets {-1} and {1}.
This is simply wrong. Random variables are not defined this way.
slerp(A, B, t) = exp(t log(B A^T)) A
Something more complex like splines, I am not familiar with the algorithms used for quaternions. I would bet they use Lie algebraic operations, but do they actually use anything specific to quaternions?Not disagreeing that quaternions have some computational advantages over matrices, but most of the points people repeat as "advantages of quaternions" are really "advantages of proper Lie group/algebra operations over Euler angles" that are independent of matrix vs. quaternion representation.
If I used timers I would have to carefully subtract the desired wake up time from the current time. It's not the same at all.
> Scatter a bunch of points in a plane. Connect some of them with lines. That’s all a graph is.
This may mislead the uninitiated reader to think that the definition of a graph includes vertex locations in R^2.
> Over the years, mathematicians worked to reduce the number of edges Hamiltonian graphs had to have.
The article is about showing that certain graph properties guarantee the existence of a Hamiltonian cycle. But the logical structure of this sentence implies the converse: showing that the existence of a Hamiltonian cycle guarantees other properties. But all it guarantees is |E| >= |V|.
What if the comment were indented? In most editors, the wrapped part would start at column 0 and break the appearance of indentation.