question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
It is often said that hash table lookup operates in constant time: you compute the hash value, which gives you an index for an array lookup. Yet this ignores collisions; in the worst case, every item happens to land in the same bucket and the lookup time becomes linear ($\Theta(n)$). Are there conditions on the data th...
There are two settings under which you can get $O(1)$ worst-case times. If your setup is static, then FKS hashing will get you worst-case $O(1)$ guarantees. But as you indicated, your setting isn't static. If you use Cuckoo hashing, then queries and deletes are $O(1)$ worst-case, but insertion is only $O(1)$ expected...
https://api.stackexchange.com
Is there any resource (paper, blogpost, Github gist, etc.) describing the BWA-MEM algorithm for assigning mapping qualities? I vaguely remember that I have somewhere seen a formula for SE reads, which looked like $C * (s_1 - s_2) / s_1,$ where $s_1$ and $s_2$ denoted the alignment scores of two best alignments and C wa...
Yes, there bwa-mem was published as a preprint BWA-MEM’s seed extension differs from the standard seed extension in two aspects. Firstly, suppose at a certain extension step we come to reference position x with the best extension score achieved at query position y. ... Secondly, while extending a seed, BWA-MEM tries...
https://api.stackexchange.com
I hope this is the right place to ask this question. Suppose I found a small irregular shaped rock, and I wish to find the surface area of the rock experimentally. Unlike for volume, where I can simply use Archimedes principle, I cannot think of a way to find the surface area. I would prefer an accuracy to at least one...
I would ignore answers that say the surface area is ill-defined. In any realistic situation you have a lower limit for how fine a resolution is meaningful. This is like a pedant who says that hydrogen has an ill-defined volume because the electron wavefunction has no hard cutoff. Technically true, but practically not m...
https://api.stackexchange.com
I was watching a nice little video on youtube but couldn't help but notice how snappy smaller animals such as rats and chipmunks move. By snappy I mean how the animal moves in almost discrete states pausing between each movement. Is this a trivial observation or something inherent in the neuro-synapse or muscular make...
Short answer Intermittent locomotion can increase the detection of prey by predators (e.g. rats), while it may lead to reduced attack rates in prey animals (e.g., rats and chipmunks). It may also increase physical endurance. Background Rather than moving continuously through the environment, many animals interrupt the...
https://api.stackexchange.com
Background: I think I might want to port some code that calculates matrix exponential-vector products using a Krylov subspace method from MATLAB to Python. (Specifically, Jitse Niesen's expmvp function, which uses an algorithm described in this paper.) However, I know that unless I make heavy use of functions from modu...
I'm going to break up my answer into three parts. Profiling, speeding up the python code via c, and speeding up python via python. It is my view that Python has some of the best tools for looking at what your code's performance is then drilling down to the actual bottle necks. Speeding up code without profiling is a...
https://api.stackexchange.com
I am currently doing the Udacity Deep Learning Tutorial. In Lesson 3, they talk about a 1x1 convolution. This 1x1 convolution is used in Google Inception Module. I'm having trouble understanding what is a 1x1 convolution. I have also seen this post by Yann Lecun. Could someone kindly explain this to me?
Suppose that I have a conv layer which outputs an $(N, F, H, W)$ shaped tensor where: $N$ is the batch size $F$ is the number of convolutional filters $H, W$ are the spatial dimensions Suppose the input is fed into a conv layer with $F_1$ 1x1 filters, zero padding and stride 1. Then the output of this 1x1 conv layer ...
https://api.stackexchange.com
I was just sitting with my hand next to my nose and I realized that air was only coming out of the right nostril. Why is that? I would think I would use both, it seems much more efficient. Have I always only been breathing out of my right nostril?
Apparently you're not the first person to notice this; in 1895, a German nose specialist called Richard Kayser found that we have tissue called erectile tissue in our noses (yes, it is very similar to the tissue found in a penis). This tissue swells in one nostril and shrinks in the other, creating an open airway via o...
https://api.stackexchange.com
Evolution is often mistakenly depicted as linear in popular culture. One main feature of this depiction in popular culture, but even in science popularisation, is that some ocean-dwelling animal sheds its scales and fins and crawls onto land. Of course, this showcases only one ancestral lineage for one specific species...
I doubt we know the precise number, or even anywhere near it. But there are several well-supported theorised colonisations which might interest you and help to build up a picture of just how common it was for life to transition to land. We can also use known facts about when different evolutionary lineages diverged, al...
https://api.stackexchange.com
I read the definition of work as $$W ~=~ \vec{F} \cdot \vec{d}$$ $$\text{ Work = (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?
While you do spend some body energy to keep the book lifted, it's important to differentiate it from physical effort. They are connected but are not the same. Physical effort depends not only on how much energy is spent, but also on how energy is spent. Holding a book in a stretched arm requires a lot of physical effor...
https://api.stackexchange.com
I have asked a lot of questions on coordination chemistry here before and I have gone through a lot others here as well. Students, including me, attempt to answer those questions using the concept of hybridization because that's what we are taught in class and of course it's easier and more intuitive than crystal field...
Tetrahedral complexes Let's consider, for example, a tetrahedral $\ce{Ni(II)}$ complex ($\mathrm{d^8}$), like $\ce{[NiCl4]^2-}$. According to hybridisation theory, the central nickel ion has $\mathrm{sp^3}$ hybridisation, the four $\mathrm{sp^3}$-type orbitals are filled by electrons from the chloride ligands, and the ...
https://api.stackexchange.com
I put a pot of water in the oven at $\mathrm{500^\circ F}$ ($\mathrm{260^\circ C}$ , $\mathrm{533 K}$). Over time most of the water evaporated away but it never boiled. Why doesn't it boil?
The "roiling boil" is a mechanism for moving heat from the bottom of the pot to the top. You see it on the stovetop because most of the heat generally enters the liquid from a superheated surface below the pot. But in a convection oven, whether the heat enters from above, from below, or from both equally depends on ho...
https://api.stackexchange.com
I know mathematically the answer to this question is yes, and it's very obvious to see that the dimensions of a ratio cancel out, leaving behind a mathematically dimensionless quantity. However, I've been writing a c++ dimensional analysis library (the specifics of which are out of scope), which has me thinking about t...
The answers are no and no. Being dimensionless or having the same dimension is a necessary condition for quantities to be "compatible", it is not a sufficient one. What one is trying to avoid is called category error. There is analogous situation in computer programming: one wishes to avoid putting values of some data ...
https://api.stackexchange.com
Some sources describe antimatter as just like normal matter, but "going backwards in time". What does that really mean? Is that a good analogy in general, and can it be made mathematically precise? Physically, how could something move backwards in time?
To the best of my knowledge, most physicists don't believe that antimatter is actually matter moving backwards in time. It's not even entirely clear what would it really mean to move backwards in time, from the popular viewpoint. If I'm remembering correctly, this idea all comes from a story that probably originated wi...
https://api.stackexchange.com
I'd like to do some hobbyist soldering at home, and would like to make sure I don't poison those living with me (especially small children). Lead-free seems necessary - what other features should I look for in solder? Are the different types of solder roughly the same in terms of safety (breathing the fumes, vapor fa...
What type of solder is safest for home (hobbyist) use? This advice is liable to be met with doubt and even derision by some - by all means do your own checks, but please at least think about what I write here: I have cited a number of references below which give guidelines for soldering. These are as applicable for le...
https://api.stackexchange.com
I was thinking yesterday about insects (as there was a spider in the house, and I couldn't help but think of anything else, even though they aren't insects), and I started to wonder if ants sleep? After thinking about it for a while I decided that they might sleep, but then what would be the purpose of sleeping for th...
A quick search on Web of Science yields "Polyphasic Wake/Sleep Episodes in the Fire Ant, Solenopsis Invicta" (Cassill et al., 2009, @Mike Taylor found an accessable copy here) as one of the first hits. The main points from the abstract: Yes, ants sleep. indicators of deep sleep: ants are non-responsive to contact b...
https://api.stackexchange.com
Carbon is well known to form single, double, and triple $\ce{C-C}$ bonds in compounds. There is a recent report (2012) that carbon forms a quadruple bond in diatomic carbon, $\ce{C2}$. The excerpt below is taken from that report. The fourth bond seems pretty odd to me. $\ce{C2}$ and its isoelectronic molecules $\ce{CN...
Okay, this is not so much of an answer as it is a summary of my own progress on this topic after giving it some thought. I don't think it's a settled debate in the community yet, so I don't feel so much ashamed about it :) A few of the things worthy of note are: The bond energy found by the authors for this fourth bon...
https://api.stackexchange.com
The most notable characteristic of polytetrafluoroethylene (PTFE, DuPont's Teflon) is that nothing sticks to it. This complete inertness is attributed to the fluorine atoms completely shielding the carbon backbone of the polymer. If nothing indeed sticks to Teflon, how might one coat an object (say, a frying pan) with ...
It has to be so common a question that the answer is actually given in various places on Dupont's own website (Dupont are the makers of Teflon): “If nothing sticks to Teflon®, then how does Teflon® stick to a pan?" Nonstick coatings are applied in layers, just like paint. The first layer is the primer—and it's the s...
https://api.stackexchange.com
We know that $\mathbf A$ is symmetric and positive-definite. We know that $\mathbf B$ is orthogonal: Question: is $\mathbf B \cdot\mathbf A \cdot\mathbf B^\top$ symmetric and positive-definite? Answer: Yes. Question: Could a computer have told us this? Answer: Probably. Are there any symbolic algebra systems (like Mat...
Edit: This is now in SymPy $ isympy In [1]: A = MatrixSymbol('A', n, n) In [2]: B = MatrixSymbol('B', n, n) In [3]: context = Q.symmetric(A) & Q.positive_definite(A) & Q.orthogonal(B) In [4]: ask(Q.symmetric(B*A*B.T) & Q.positive_definite(B*A*B.T), context) Out[4]: True Older answer that shows other work So after look...
https://api.stackexchange.com
Oxygen is a rather boring element. It has only two allotropes, dioxygen and ozone. Dioxygen has a double bond, and ozone has a delocalised cloud, giving rise to two "1.5 bonds". On the other hand, sulfur has many stable allotropes, and a bunch of unstable ones as well. The variety of allotropes, is mainly due to the a...
First, a note: while oxygen has fewer allotropes than sulfur, it sure has more than two! These include $\ce{O}$, $\ce{O_2}$, $\ce{O_3}$, $\ce{O_4}$, $\ce{O_8}$, metallic $\ce{O}$ and four other solid phases. Many of these actually have a corresponding sulfur variant. However, you are right in a sense that sulfur has mo...
https://api.stackexchange.com
Related question: State of the Mac OS in Scientific Computing and HPC A significant number of software packages in computational science are written in Fortran, and Fortran isn't going away. A Fortran compiler is also required to build other software packages (one notable example being SciPy). However, Mac OS X does no...
Pick your poison. I recommend using Homebrew. I have tried all of these methods except for "Fink" and "Other Methods". Originally, I preferred MacPorts when I wrote this answer. In the two years since, Homebrew has grown a lot as a project and has proved more maintainable than MacPorts, which can require a lot of PATH ...
https://api.stackexchange.com
In several different contexts we invoke the central limit theorem to justify whatever statistical method we want to adopt (e.g., approximate the binomial distribution by a normal distribution). I understand the technical details as to why the theorem is true but it just now occurred to me that I do not really understan...
I apologize in advance for the length of this post: it is with some trepidation that I let it out in public at all, because it takes some time and attention to read through and undoubtedly has typographic errors and expository lapses. But here it is for those who are interested in the fascinating topic, offered in the...
https://api.stackexchange.com
How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to Wolfram Alpha, but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method. In general, how can ...
No need to use Taylor series, this can be derived in a similar way to the formula for geometric series. Let's find a general formula for the following sum: $$S_{m}=\sum_{n=1}^{m}nr^{n}.$$ Notice that \begin{align*} S_{m}-rS_{m} & = -mr^{m+1}+\sum_{n=1}^{m}r^{n}\\ & = -mr^{m+1}+\frac{r-r^{m+1}}{1-r} \\ & =\frac{mr^{...
https://api.stackexchange.com
I read in this assembly programming tutorial that 8 bits are used for data while 1 bit is for parity, which is then used for detecting parity error (caused by hardware fault or electrical disturbance). Is this true?
A byte of data is eight bits, there may be more bits per byte of data that are used at the OS or even the hardware level for error checking (parity bit, or even a more advanced error detection scheme), but the data is eight bits and any parity bit is usually invisible to the software. A byte has been standardized to me...
https://api.stackexchange.com
I know this question has been asked previously but I cannot find a satisfactory explanation as to why is it so difficult for $\ce{H4O^2+}$ to exist. There are explanations that it is so because of $+2$ charge, but if only that was the reason then existence of species like $\ce{SO4^2-}$ should not have been possible. So...
I myself was always confused why $\ce{H3O^+}$ is so well-known and yet almost nobody talks of $\ce{H4O^2+}$. I mean, $\ce{H3O^+}$ still has a lone pair, right? Why can't another proton just latch onto that? Adding to the confusion, $\ce{H4O^2+}$ is very similar to $\ce{NH4+}$, which again is extremely well-known. Even ...
https://api.stackexchange.com
I have VCF files (SNPs & indels) for WGS on 100 samples, but I want to only use a specific subset of 10 of the samples. Is there a relatively easy way to pull out only the 10 samples, while still keeping all of the data for the entire genome? I have a script that allows me to pull out regions of the whole genome for al...
Bcftools has sample/individual filtering as an option for most of the commands. You can subset individuals by using the -s or -S option: -s, --samples [^]LIST Comma-separated list of samples to include or exclude if prefixed with "^". Note that in general tags such as INFO/AC, INFO/AN, etc are not updated to corresp...
https://api.stackexchange.com
What is the advantage gained by the substitution of thymine for uracil in DNA? I have read previously that it is due to thymine being "better protected" and therefore more suited to the storage role of DNA, which seems fine in theory, but why does the addition of a simple methyl group make the base more well protected...
One major problem with using uracil as a base is that cytosine can be deaminated, which converts it into uracil. This is not a rare reaction; it happens around 100 times per cell, per day. This is no major problem when using thymine, as the cell can easily recognize that the uracil doesn't belong there and can repair i...
https://api.stackexchange.com
In molecular orbital theory, the fact that a bonding and antibonding molecular orbital pair have different energies is accompanied by the fact that the energy by which the bonding is lowered is less than the energy by which antibonding is raised, i.e. the stabilizing energy of each bonding interaction is less than the ...
Mathematical Explanation When examining the linear combination of atomic orbitals (LCAO) for the $\ce{H2+}$ molecular ion, we get two different energy levels, $E_+$ and $E_-$ depending on the coefficients of the atomic orbitals. The energies of the two different MO's are: $$\begin{align} E_+ &= E_\text{1s} + \frac{j_0}...
https://api.stackexchange.com
Thinking about it: You would never find a "Grounded" multimeter as robust and useful if a path to ground through the multimeter were introduced, modifying the circuit's behaviour and possibly damaging the multimeter with currents. Why are so many oscilloscopes earth referenced? Upon reading some educational material, a...
Oscilloscopes usually require significant power and are physically big. Having a chassis that size, which would include exposed ground on the BNC connectors and the probe ground clips, floating would be dangerous. If you have to look at waveforms in wall-powered equipment, it is generally much better to put the isolat...
https://api.stackexchange.com
Which is the fastest library for performing delaunay triangulation of sets with millions if 3D points? Are there also GPU versions available? From the other side, having the voronoi tessellation of the same set of points, would help (in terms of performance) for getting the delaunay triangulation?
For computing three-dimensional Delaunay triangulations (tetrahedralizations, really), TetGen is a commonly used library. For your convenience, here's a little benchmark on how long it takes to compute the terehedralization of a number of random points from the unit cube. For 100,000 points it takes 4.5 seconds on an ...
https://api.stackexchange.com
If you calculate the area of a rectangle, you just multiply the height and the width and get back the unit squared. Example: 5cm * 10cm = 50cm² In contrast, if you calculate the size of an image, you also multiply the height and the width, but you get back the unit - Pixel - just as it was the unit of the height and wi...
Because "pixel" isn't a unit of measurement: it's an object. So, just like a wall that's 30 bricks wide by 10 bricks tall contains 300 bricks (not bricks-squared), an image that's 30 pixels wide by 10 pixels tall contains 300 pixels (not pixels-squared).
https://api.stackexchange.com
I want to understand the difference between pipeline systems and workflow engines. After reading A Review of Scalable Bioinformatics Pipelines I had a good overview of current bioinformatics pipelines. After some further research I found that there is collection of highly capable workflow engines. My question is then b...
Great question! Note that from a prescriptive standpoint, the terms pipeline and workflow don't have any strict or precise definitions. But it's still useful to take a descriptive standpoint and discuss how the terms are commonly used in the bioinformatics community. But before talking about pipelines and workflows, it...
https://api.stackexchange.com
I asked a relatively simple question. Unfortunately, the answers provoke far more questions! :-( It seems that I don't actually understand RC circuits at all. In particular, why there's an R in there. It seems completely unnecessary. Surely the capacitor is doing all the work? What the heck do you need a resistor for? ...
Let's try this Wittgenstein's ladder style. First let's consider this: simulate this circuit – Schematic created using CircuitLab We can calculate the current through R1 with Ohm's law: $$ {1\:\mathrm V \over 100\:\Omega} = 10\:\mathrm{mA} $$ We also know that the voltage across R1 is 1V. If we use ground as our refer...
https://api.stackexchange.com
I know of, and have used f2py2e to wrap some old Fortran 77 code, but my understanding is that it does not work with newer Fortran 95 code. I've researched what I should use, and have come across fwrap and G3 f2py, neither of which seem to give any explanation of their current state, or how to use them (beyond basic us...
You can use the Python builtin ctypes module as described on fortran90.org. It is pretty straight forward and doesn't require any external dependencies. Also, the ndpointer arg type helper is very handy.
https://api.stackexchange.com
A common question, here and elsewhere. Is C++ suitable for embedded systems? Microcontrollers? RTOSes? Toasters? Embedded PCs? Is OOP useful on microcontrollers? Does C++ remove the programmer too far from the hardware to be efficient? Should Arduino's C++ (with no dynamic memory management, templates, exceptions) be c...
Yes, C++ is still useful in embedded systems. As everyone else has said, it still depends on the system itself, like an 8-bit uC would probably be a no-no in my book even though there is a compiler out there and some people do it (shudder). There's still an advantage to using C++ even when you scale it down to somethi...
https://api.stackexchange.com
Fun with Math time. My mom gave me a roll of toilet paper to put it in the bathroom, and looking at it I immediately wondered about this: is it possible, through very simple math, to calculate (with small error) the total paper length of a toilet roll? Writing down some math, I came to this study, which I share with ...
The assumption that the layers are all cylindrical is a good first approximation. The assumption that the layers form a logarithmic spiral is not a good assumption at all, because it supposes that the thickness of the paper at any point is proportional to its distance from the center. This seems to me to be quite abs...
https://api.stackexchange.com
Most of today's encryption, such as the RSA, relies on the integer factorization, which is not believed to be a NP-hard problem, but it belongs to BQP, which makes it vulnerable to quantum computers. I wonder, why has there not been an encryption algorithm which is based on an known NP-hard problem. It sounds (at least...
Worst-case Hardness of NP-complete problems is not sufficient for cryptography. Even if NP-complete problems are hard in the worst-case ($P \ne NP$), they still could be efficiently solvable in the average-case. Cryptography assumes the existence of average-case intractable problems in NP. Also, proving the existence ...
https://api.stackexchange.com
I'd like to learn the differences between 3 common formats such as FASTA, FASTQ and SAM. How they are different? Are there any benefits of using one over another? Based on Wikipedia pages, I can't tell the differences between them.
Let’s start with what they have in common: All three formats store sequence data, and sequence metadata. Furthermore, all three formats are text-based. However, beyond that all three formats are different and serve different purposes. Let’s start with the simplest format: FASTA FASTA stores a variable number of seque...
https://api.stackexchange.com
As someone who holds a BA in physics I was somewhat scandalized when I began working with molecular simulations. It was a bit of a shock to discover that even the most detailed and computationally expensive simulations can't quantitatively reproduce the full behavior of water from first principles. Previously, I had be...
As far as I'm aware, the most accurate methods for static calculations are Full Configuration Interaction with a fully relativistic four-component Dirac Hamiltonian and a "complete enough" basis set. I'm not an expert in this particular area, but from what I know of the method, solving it using a variational method (ra...
https://api.stackexchange.com
Suppose I would like to insert data-cables of varying diameters -- e.g., a cable of 5 mm diameter -- into the 6 mm diameter hole of a plastic enclosure. The wires within the cable are terminated via soldering to a PCB inside the enclosure. What methods are used in the industry to ensure that pulling the cable won't mak...
There are a few industry approaches to this. The first is molded cables. The cables themselves have strain reliefs molded to fit a given entry point, either by custom moulding or with off the shelf reliefs that are chemically welded/bonded to the cable. Not just glued, but welded together. The second is entry points ...
https://api.stackexchange.com
I have many alignments from Rfam Database, and I would like to edit them. I saw that many tools are used for Protein sequence alignments, but there is something specific to edit RNA alignments ? e.g. Stockholm Alignment of Pistol (just few entries). FP929053.1/1669026-1668956 AGUGGUCACAGCCACUAUAAACA-GGGCUU-UAAGCUG...
I would suggest use RALEE—RNALignment Editor in Emacs. It can get for you the consensus secondary structure, you can move left/right sequences and their secondary structures (you can't do it in JalView!), and more. It's an Emacs mode, so could be a bit hard to start off, but just try, you don't have to use all Emacs fe...
https://api.stackexchange.com
Many seem to believe that $P\ne NP$, but many also believe it to be very unlikely that this will ever be proven. Is there not some inconsistency to this? If you hold that such a proof is unlikely, then you should also believe that sound arguments for $P\ne NP$ are lacking. Or are there good arguments for $P\ne NP$ bein...
People are skeptical because: No proof has come from an expert without having been rescinded shortly thereafter So much effort has been put into finding a proof, with no success, that it's assumed one will be either substantially complicated, or invent new mathematics for the proof The "proofs" that arise frequently f...
https://api.stackexchange.com
I've always thought vaguely that the answer to the above question was affirmative along the following lines. Gödel's incompleteness theorem and the undecidability of the halting problem both being negative results about decidability and established by diagonal arguments (and in the 1930's), so they must somehow be two ...
I recommend you to check Scott Aaronson's blog post on a proof of the Incompleteness Theorem via Turing machines and Rosser's Theorem. His proof of the incompleteness theorem is extremely simple and easy to follow.
https://api.stackexchange.com
Is there a standard and accepted method for selecting the number of layers, and the number of nodes in each layer, in a feed-forward neural network? I'm interested in automated ways of building neural networks.
I realize this question has been answered, but I don't think the extant answer really engages the question beyond pointing to a link generally related to the question's subject matter. In particular, the link describes one technique for programmatic network configuration, but that is not a "[a] standard and accepted me...
https://api.stackexchange.com
I heard that the current limit for a USB port is 100mA. However, I also heard that some devices can get up to 1.8A from a port. How do you get past the 100mA limit?
I think I can attempt to clear this up. USB-100mA USB by default will deliver 100mA of current (it is 500mW power because we know it is 5v, right?) to a device. This is the most you can pull from a USB hub that does not have its own power supply, as they never offer more than 4 ports and keep a greedy 100mA for themsel...
https://api.stackexchange.com
This question: Can you get enough water by eating only fish? asks if a person could survive on fish alone. Can a person survive on fish and/ or blood alone of any species if stuck at sea or animal blood as a last resort where there is no water or fire? Obviously if it was a fresh water fish there is water, but there a...
Blood is not a good source of water. 1 liter of blood contains about 800 mL of water, 170 grams of protein and 2 grams of sodium (calculated from the composition of lamb blood). When metabolized, 170 grams of protein yields the amount of urea that requires 1,360 mL of water to be excreted in urine (calculated from here...
https://api.stackexchange.com
Firstly, I am new to DSP and have no real education in it, but I am developing an audio visualization program and I am representing an FFT array as vertical bars as in a typical frequency spectrum visualization. The problem I had was that the audio signal values changed too rapidly to produce a pleasing visual output i...
What you've implemented is a single-pole lowpass filter, sometimes called a leaky integrator. Your signal has the difference equation: $$ y[n] = 0.8 y[n-1] + 0.2 x[n] $$ where $x[n]$ is the input (the unsmoothed bin value) and $y[n]$ is the smoothed bin value. This is a common way of implementing a simple, low-complexi...
https://api.stackexchange.com
Can anyone state the difference between frequency response and impulse response in simple English?
The impulse response and frequency response are two attributes that are useful for characterizing linear time-invariant (LTI) systems. They provide two different ways of calculating what an LTI system's output will be for a given input signal. A continuous-time LTI system is usually illustrated like this: In general, ...
https://api.stackexchange.com
If $n>1$ is an integer, then $\sum \limits_{k=1}^n \frac1k$ is not an integer. If you know Bertrand's Postulate, then you know there must be a prime $p$ between $n/2$ and $n$, so $\frac 1p$ appears in the sum, but $\frac{1}{2p}$ does not. Aside from $\frac 1p$, every other term $\frac 1k$ has $k$ divisible only by prim...
Hint $ $ There is a $\rm\color{darkorange}{unique}$ denominator $\rm\,\color{#0a0} {2^K}$ having maximal power of $\:\!2,\,$ so scaling by $\rm\,\color{#c00}{2^{K-1}}$ we deduce a contradiction $\large \rm\, \frac{1}2 = \frac{c}d \,$ with odd $\rm\,d \:$ (vs. $\,\rm d = 2c),\,$ e.g. $$\begin{eqnarray} & &\rm\ \ \ \ \c...
https://api.stackexchange.com
I am currently looking for a system which will allow me to version both the code and the data in my research. I think my way of analyzing data is not uncommon, and this will be useful for many people doing bioinformatics and aiming for the reproducibility. Here are the requrements: Analysis is performed on multiple ma...
There is a couple of points to consider here, which I outline below. The goal here should be to find a workflow that is minimally intrusive on top of already using git. As of yet, there is no ideal workflow that covers all use cases, but what I outline below is the closest I could come to it. Reproducibility is not jus...
https://api.stackexchange.com
I'm using Python Keras package for neural network. This is the link. Is batch_size equals to number of test samples? From Wikipedia we have this information: However, in other cases, evaluating the sum-gradient may require expensive evaluations of the gradients from all summand functions. When the training set is ...
The batch size defines the number of samples that will be propagated through the network. For instance, let's say you have 1050 training samples and you want to set up a batch_size equal to 100. The algorithm takes the first 100 samples (from 1st to 100th) from the training dataset and trains the network. Next, it take...
https://api.stackexchange.com
What are some surprising equations/identities that you have seen, which you would not have expected? This could be complex numbers, trigonometric identities, combinatorial results, algebraic results, etc. I'd request to avoid 'standard' / well-known results like $ e^{i \pi} + 1 = 0$. Please write a single identity (or ...
This one by Ramanujan gives me the goosebumps: $$ \frac{2\sqrt{2}}{9801} \sum_{k=0}^\infty \frac{ (4k)! (1103+26390k) }{ (k!)^4 396^{4k} } = \frac1{\pi}. $$ P.S. Just to make this more intriguing, define the fundamental unit $U_{29} = \frac{5+\sqrt{29}}{2}$ and fundamental solutions to Pell equations, $$\big(U_{29}\bi...
https://api.stackexchange.com
Find a positive integer solution $(x,y,z,a,b)$ for which $$\frac{1}{x}+ \frac{1}{y} + \frac{1}{z} + \frac{1}{a} + \frac{1}{b} = 1\;.$$ Is your answer the only solution? If so, show why. I was surprised that a teacher would assign this kind of problem to a 5th grade child. (I'm a college student tutor) This girl goes t...
The perfect number $28=1+2+4+7+14$ provides a solution: $$\frac1{28}+\frac1{14}+\frac17+\frac14+\frac12=\frac{1+2+4+7+14}{28}=1\;.$$ If they’ve been doing unit (or ‘Egyptian’) fractions, I’d expect some to see that since $\frac16+\frac13=\frac12$, $$\frac16+\frac16+\frac16+\frac16+\frac13=1$$ is a solution, though not ...
https://api.stackexchange.com
As cited in an answer to this question, the ground state electronic configuration of niobium is: $\ce{Nb: [Kr] 5s^1 4d^4}$ Why is that so? What factors stabilize this configuration, compared to the obvious $\ce{5s^2 4d^3}$ (Aufbau principle), or the otherwise possible $\ce{5s^0 4d^5}$ (half-filled shell)?
There is an explanation to this that can be generalized, which dips a little into quantum chemistry, which is known as the idea of pairing energy. I'm sure you can look up the specifics, but basically in comparing the possible configurations of $\ce{Nb}$, we see the choice of either pairing electrons at a lower energy,...
https://api.stackexchange.com
Which software provides a good workflow from simple plotting of a few datapoints up to the creation of publication level graphics with detailed styles, mathematical typesetting and "professional quality"? This is a bit related to the question of David (What attributes make a figure professional quality?) but the focus...
If you have some experience with Python (or even not), I would recommend using the Python scientific software that is available (SciPy,Pandas),...) together with Matplotlib. Being a programming environment, you have full control over your data flows, data manipulations and plotting. You can also use the "full applicati...
https://api.stackexchange.com
It is fine to say that for an object flying past a massive object, the spacetime is curved by the massive object, and so the object flying past follows the curved path of the geodesic, so it "appears" to be experiencing gravitational acceleration. Do we also say along with it, that the object flying past in reality exe...
To really understand this you should study the differential geometry of geodesics in curved spacetimes. I'll try to provide a simplified explanation. Even objects "at rest" (in a given reference frame) are actually moving through spacetime, because spacetime is not just space, but also time: apple is "getting older" - ...
https://api.stackexchange.com
Suppose that I'm working on a scientific code in C++. In a recent discussion with a colleague, it was argued that expression templates could be a really bad thing, potentially making software compilable only on certain versions of gcc. Supposedly, this problem has affected a few scientific codes, as alluded to in the s...
My problem with expression templates is that they are a very leaky abstraction. You spend a lot of work writing very complicated code to do a simple task with nicer syntax. But if you want to change the algorithm, you have to mess with the dirty code and if you slip up with types or syntax, you get completely unintelli...
https://api.stackexchange.com
The datasheet of the 24LC256 EEPROM states that: The SDA bus requires a pull-up resistor to VCC (typical 10 kΩ for 100 kHz, 2 kΩ for 400 kHz and 1 MHz). I thought that any resistor with a kΩ value would do the job (and it seems that my EEPROM works fine at different frequencies with a 10 kΩ resistor). My questions ar...
The correct pullup resistance for the I2C bus depends on the total capacitance on the bus and the frequency you want to operate the bus at. The formula from the ATmega168 datasheet (which I believe comes from the official I2C spec) is -- $$\text{Freq}<100\text{kHz} \implies R_{\text{min}}=\frac{V_{cc}-0.4\text{V}}{3\...
https://api.stackexchange.com
Given Newton's third law, why is there motion at all? Should not all forces even themselves out, so nothing moves at all? When I push a table using my finger, the table applies the same force onto my finger like my finger does on the table just with an opposing direction, nothing happens except that I feel the opposing...
I think it's a great question, and enjoyed it very much when I grappled with it myself. Here's a picture of some of the forces in this scenario.$^\dagger$ The ones that are the same colour as each other are pairs of equal magnitude, opposite direction forces from Newton's third law. (W and R are of equal magnitude in o...
https://api.stackexchange.com
$$\sum_{n=1}^\infty\frac1{n^s}$$ only converges to $\zeta(s)$ if $\text{Re}(s)>1$. Why should analytically continuing to $\zeta(-1)$ give the right answer?
there are many ways to see that your result is the right one. What does the right one mean? It means that whenever such a sum appears anywhere in physics - I explicitly emphasize that not just in string theory, also in experimentally doable measurements of the Casimir force (between parallel metals resulting from quant...
https://api.stackexchange.com
Adaptive thresholding has been discussed in a few questions earlier: Adaptive Thresholding for liver segmentation using Matlab What are the best algorithms for document image thresholding in this example? Of course, there are many algorithms for Adaptive thresholding. I want to know which ones you have found most effec...
I do not think mine will be a complete answer, but I'll offer what I know and since this is a community edited site, I hope somebody will give a complimentary answer soon :) Adaptive thresholding methods are those that do not use the same threshold throughout the whole image. But, for some simpler usages, it is sometim...
https://api.stackexchange.com
In statistics and its various applications, we often calculate the covariance matrix, which is positive definite (in the cases considered) and symmetric, for various uses. Sometimes, we need the inverse of this matrix for various computations (quadratic forms with this inverse as the (only) center matrix, for example)....
A Cholesky factorization makes the most sense for the best stability and speed when you are working with a covariance matrix, since the covariance matrix will be positive semi-definite symmetric matrix. Cholesky is a natural here. BUT... IF you intend to compute a Cholesky factorization, before you ever compute the co...
https://api.stackexchange.com
In speech recognition, the front end generally does signal processing to allow feature extraction from the audio stream. A discrete Fourier transform (DFT) is applied twice in this process. The first time is after windowing; after this Mel binning is applied and then another Fourier transform. I've noticed however, tha...
The Discrete Fourier Transform (DFT) and Discrete Cosine Transform (DCT) perform similar functions: they both decompose a finite-length discrete-time vector into a sum of scaled-and-shifted basis functions. The difference between the two is the type of basis function used by each transform; the DFT uses a set of harmon...
https://api.stackexchange.com
There are many tutorials that use a pull-up or pull-down resistor in conjunction with a switch to avoid a floating ground, e.g. Many of these projects use a 10K resistor, merely remarking that it is a good value. Given a particular circuit, how do I determine the appropriate value for a pull-down resistor? Can it b...
Use 10 kΩ, it's a good value. For more detail, we have to look at what a pullup does. Let's say you have a pushbutton you want to read with a microcontroller. The pushbutton is a momentary SPST (Single Pole Single Throw) switch. It has two connection points which are either connected or not. When the button is pres...
https://api.stackexchange.com
I've recently heard a riddle, which looks quite simple, but I can't solve it. A girl thinks of a number which is 1, 2, or 3, and a boy then gets to ask just one question about the number. The girl can only answer "Yes", "No", or "I don't know," and after the girl answers it, he knows what the number is. What is the qu...
"I am thinking of a number which is either 0 or 1. Is the sum of our numbers greater than 2?"
https://api.stackexchange.com
It seems that through various related questions here, there is consensus that the "95%" part of what we call a "95% confidence interval" refers to the fact that if we were to exactly replicate our sampling and CI-computation procedures many times, 95% of thusly computed CIs would contain the population mean. It also s...
Part of the issue is that the frequentist definition of a probability doesn't allow a nontrivial probability to be applied to the outcome of a particular experiment, but only to some fictitious population of experiments from which this particular experiment can be considered a sample. The definition of a CI is confusi...
https://api.stackexchange.com
This is something that has been bugging me for a while, and I couldn't find any satisfactory answers online, so here goes: After reviewing a set of lectures on convex optimization, Newton's method seems to be a far superior algorithm than gradient descent to find globally optimal solutions, because Newton's method can ...
Gradient descent maximizes a function using knowledge of its derivative. Newton's method, a root finding algorithm, maximizes a function using knowledge of its second derivative. That can be faster when the second derivative is known and easy to compute (the Newton-Raphson algorithm is used in logistic regression). How...
https://api.stackexchange.com
The process of sleep seems to be very disadvantageous to an organism as it is extremely vulnerable to predation for several hours at a time. Why is sleep necessary in so many animals? What advantage did it give the individuals that evolved to have it as an adaptation? When and how did it likely occur in the evolutionar...
This good non-scholarly article covers some of the usual advantages (rest/regeneration). One of the research papers they mentioned (they linked to press release) was Conservation of Sleep: Insights from Non-Mammalian Model Systems by John E. Zimmerman, Ph.D.; Trends Neurosci. 2008 July; 31(7): 371–376. Published online...
https://api.stackexchange.com
I'll try to make this as brief as possible: Dissolved two teaspoons of table sugar (sucrose) in about 250ml water. Sipped it, and as expected it tasted sweet. I let the rest of it sit in the freezer overnight. Next day, I took out the frozen sugar solution and, well, licked it. Surprisingly, I could barely taste any s...
Where is the sugar? When you freeze a dilute aqueous sugar solution pure water freezes first, leaving a more concentrated solution until you reach a high concentration of sugar called the eutectic concentration. Now you have the pure water that's frozen out, called proeutectic water, and the concentrated eutectic suga...
https://api.stackexchange.com
Here is the article that motivated this question: Does impatience make us fat? I liked this article, and it nicely demonstrates the concept of “controlling for other variables” (IQ, career, income, age, etc) in order to best isolate the true relationship between just the 2 variables in question. Can you explain to me...
There are many ways to control for variables. The easiest, and one you came up with, is to stratify your data so you have sub-groups with similar characteristics - there are then methods to pool those results together to get a single "answer". This works if you have a very small number of variables you want to control ...
https://api.stackexchange.com
Knapsack problems are easily solved by dynamic programming. Dynamic programming runs in polynomial time; that is why we do it, right? I have read it is actually an NP-complete problem, though, which would mean that solving the problem in polynomial problem is probably impossible. Where is my mistake?
Knapsack problem is $\sf{NP\text{-}complete}$ when the numbers are given as binary numbers. In this case, the dynamic programming will take exponentially many steps (in the size of the input, i.e. the number of bits in the input) to finish $\dagger$. On the other hand, if the numbers in the input are given in unary, t...
https://api.stackexchange.com
In Hamming's book, The Art of Doing Science and Engineering, he relates the following story: A group at Naval Postgraduate School was modulating a very high frequency signal down to where they could afford to sample, according to the sampling theorem as they understood it. But I realized if they cleverly sample...
The quoted text in the question is a case of using bandpass sampling or undersampling. Here, to avoid aliasing distortion, the signal of interest must be bandpass. That means that the signal's power spectrum is only non-zero between $f_L < |f| < f_H$. If we sample the signal at a rate $f_s$, then the condition that the...
https://api.stackexchange.com
EDIT: I've now asked a similar question about the difference between categories and sets. Every time I read about type theory (which admittedly is rather informal), I can't really understand how it differs from set theory, concretely. I understand that there is a conceptual difference between saying "x belongs to a set...
To understand the difference between sets and types, ones has to go back to pre-mathematical ideas of "collection" and "construction", and see how sets and types mathematize these. There is a spectrum of possibilities on what mathematics is about. Two of these are: We think of mathematics as an activity in which mathe...
https://api.stackexchange.com
I'm a bit confused about the concept of ground, and perhaps voltage as well, particularly when trying to analyze a circuit. When I learned about Ohm's law in grade school, I learned how to apply the law to calculate current, voltage, and resistance of simple circuits. For instance, if we were given the following circu...
The first time I tried to do the current calculation for a circuit similar to the previous circuit on a simulator, the program complained about not having a ground and "floating voltage sources". Your simulator wants to be able to do its calculations and report out the voltages of each node relative to some reference,...
https://api.stackexchange.com
I was coding a physics simulation, and noticed that I was using discrete time. That is, there was an update mechanism advancing the simulation for a fixed amount of time repeatedly, emulating a changing system. I though that was interesting, and now believe the real world must behave just like my program does. It is ac...
As we cannot resolve arbitrarily small time intervals, what is ''really'' the case cannot be decided. But in classical and quantum mechanics (i.e., in most of physics), time is treated as continuous. Physics would become very awkward if expressed in terms of a discrete time: The discrete case is essentially untractab...
https://api.stackexchange.com
Is there any general guidelines on where to place dropout layers in a neural network?
In the original paper that proposed dropout layers, by Hinton (2012), dropout (with p=0.5) was used on each of the fully connected (dense) layers before the output; it was not used on the convolutional layers. This became the most commonly used configuration. More recent research has shown some value in applying dropo...
https://api.stackexchange.com
What are some recommended resources (books, tutorials, lectures, etc.) on digital signal processing, and how to begin working with it on a technical level?
My recommendation in terms of text books is Rick Lyons's Understanding DSP. My review of the latest edition is here. I, and many others from the ${\tt comp.dsp}$ community and elsewhere, have helped Rick revise parts of the text since the first edition. For self-study, I know of no better book. As an on-line, free r...
https://api.stackexchange.com
It is my understanding that metals are a crystal lattice of ions, held together by delocalized electrons, which move freely through the lattice (and conduct electricity, heat, etc.). If two pieces of the same metal are touched together, why don't they bond? It seems to me the delocalized electrons would move from one...
I think that mere touching does not bring the surfaces close enough. The surface of a metal is not perfect usually. Maybe it has an oxide layer that resists any kind of reaction. If the metal is extremely pure and if you bring two pieces of it extremely close together, then they will join together. It's also called col...
https://api.stackexchange.com
I am working with over a million (long) reads, and aligning them to a large genome. I am considering running my alignment jobs in parallel, distributing horizontally across hundreds of nodes rather than trying to run a single job with dozens of cores. I would like to merge the sorted BAM files together for further down...
samtools merge merged.bam *.bam is efficient enough since the input files are sorted. You can get a bit faster with sambamba and/or biobambam, but they're not typically already installed and IO quickly becomes a bottleneck anyway.
https://api.stackexchange.com
First off, I hope this is the correct Stack Exchange board. My apologies if it is not. I am working on something that requires me to calibrate the camera. I have successfully implemented the code to do this in OpenCV (C++). I am using the inbuilt chessboard functions and a chessboard I have printed off. There are many ...
You have to take images for calibration from different points of view and angles, with as big difference between angles as possible (all three Euler angles should vary), but so that pattern diameter was still fitting to camera field of view. The more views are you using the better calibration will be. That is needed be...
https://api.stackexchange.com
In a multicore processor, what happens to the contents of a core's cache (say L1) when a context switch occurs on that cache? Is the behaviour dependent on the architecture or is it a general behaviour followed by all chip manufacturers?
That depends both on the processor (not just the processor series, it can vary from model to model) and the operating systems, but there are general principles. Whether a processor is multicore has no direct impact on this aspect; the same process could be executing on multiple cores simultaneously (if it's multithread...
https://api.stackexchange.com
We were dealing with the Third Law of Thermodynamics in class, and my teacher mentioned something that we found quite fascinating: It is physically impossible to attain a temperature of zero kelvin (absolute zero). When we pressed him for the rationale behind that, he asked us to take a look at the graph for Charle...
There was a story in my days about a physical chemist who was asked to explain some effect, illustrated by a poster on the wall. He did that, after which someone noticed that the poster was hanging upside down, so the effect appeared reversed in sign. Undaunted, the guy immediately explained it the other way around, ju...
https://api.stackexchange.com
I'm looking for tools to check the quality of a VCF I have of a human genome. I would like to check the VCF against publicly known variants across other human genomes, e.g. how many SNPs are already in public databases, whether insertions/deletions are at known positions, insertion/deletion length distribution, other S...
To achieve (at least some of) your goals, I would recommend the Variant Effect Predictor (VEP). It is a flexible tool that provides several types of annotations on an input .vcf file. I agree that ExAC is the de facto gold standard catalog for human genetic variation in coding regions. To see the frequency distributi...
https://api.stackexchange.com
I have a dataset that has both continuous and categorical data. I am analyzing by using PCA and am wondering if it is fine to include the categorical variables as a part of the analysis. My understanding is that PCA can only be applied to continuous variables. Is that correct? If it cannot be used for categorical data,...
Although a PCA applied on binary data would yield results comparable to those obtained from a Multiple Correspondence Analysis (factor scores and eigenvalues are linearly related), there are more appropriate techniques to deal with mixed data types, namely Multiple Factor Analysis for mixed data available in the FactoM...
https://api.stackexchange.com
I'm considering learning a new language to use for numerical/simulation modelling projects, as a (partial) replacement for the C++ and Python that I currently use. I came across Julia, which sounds kind of perfect. If it does everything it claims, I could use it to replace both C++ and Python in all my projects, since ...
Julia, at this point (May 2019, Julia v1.1 with v1.2 about to come out) is quite mature for scientific computing. The v1.0 release signified an end to yearly code breakage. With that, a lot of scientific computing libraries have had the time to simply grow without disruption. A broad overview of Julia packages can be f...
https://api.stackexchange.com
Software is a fundamental part of computational science, and is increasingly recognized as an essential part of the scientific record. Given the value of using existing and well-tested code, it seems worthwhile to communicate the existence of useful codes as widely as possible and credit their creators. In an academi...
There are some other application-specific journals to list: such as Journal of Computational Physics or Computer Physics Communications, that accept articles both about algorithms as well as the software used to implement them. If you're in the chemistry field, Journal of Chemical Theory and Computation might be anothe...
https://api.stackexchange.com
Both $\ce{SF6}$ and $\ce{SH6}$ and $\ce{SF4}$ and $\ce{SH4}$ have the same central atom and the same hybridization, but my teacher specifically mentioned that $\ce{SH6}$ and $\ce{SH4}$ don't exist. I've looked everywhere but I can't figure out why? I'd appreciate some insight into the problem.
TL;DR Fluorine is electronegative and can support the extra negative charge that is dispersed on the six X atoms in $\ce{SX6}$, whereas hydrogen cannot. First, let's debunk a commonly taught myth, which is that the bonding in $\ce{SF6}$ involves promotion of electrons to the 3d orbitals with a resulting $\mathrm{sp^3d...
https://api.stackexchange.com
Please be kind, I am an electronics nub. This is in reference to getting an LED to emit photons. From what I read (Getting Started in Electronics - Forrest Mims III and Make: Electronics) electrons flow from the more negative side to the more positive side. In an example experiment (involving a primary dry cell, a SPD...
The resistor can be on either side of the LED, but it must be present. When two or more components are in series, the current will be the same through all of them, and so it doesn't matter which order they are in. I think the way to read "the resistor must be connected to the anode" as "the resistor cannot be omitted...
https://api.stackexchange.com
I've thoroughly read the Wikipedia article on DNA sequencing and can't get one thing. There's some hardcore chemistry involved in the process that somehow splits the DNA and then isolates its parts. Yet DNA sequencing is considered to be a very computationally-intensive process. I don't get what exactly is being comput...
Computers are used in several steps of sequencing, from the raw data to finished sequence: Image processing Modern sequencers usually use fluorescent labelling of DNA fragments in solution. The fluorescence encodes the different nucleobase (= “base”) types (generally called A, C, G and T). To achieve high throughput, m...
https://api.stackexchange.com
In physics, "almost everything is already discovered, and all that remains is to fill a few unimportant holes." (See Jolly.) Therefore, on Physics SE, people are veering off into different directions: biology, for example. Thus, it happens that a question about bicycles generates some discussion about evolution in biol...
Wheels are possible on the molecular level — bacterial flagella are rotating cores inside a molecular motor, but wheels larger than the flagellum have not really been found. Defining a wheel as a freely rotating joint that can rotate indefinitely in one direction, a single animal with a wheel is an improbable* develop...
https://api.stackexchange.com
In a recent article of Amstat News, the authors (Mark van der Laan and Sherri Rose) stated that "We know that for large enough sample sizes, every study—including ones in which the null hypothesis of no effect is true — will declare a statistically significant effect.". Well, I for one didn't know that. Is this true? D...
It is not true. If the null hypothesis is true then it will not be rejected more frequently at large sample sizes than small. There is an erroneous rejection rate that's usually set to 0.05 (alpha) but it is independent of sample size. Therefore, taken literally the statement is false. Nevertheless, it's possible that...
https://api.stackexchange.com
It is known that HIV is usually transmitted by direct blood or body fluid contact between an infected individual and a healthy person (like blood transfusion or needle sharing): Suppose a mosquito bites an individual suffering from AIDS and in the process sucks up some T cells infected with HIV along with RBCs. Then it...
No, this is not possible. There are a few reasons for that, but most important are that the only thing a mosquito injects is its own saliva, while the blood is sucked into the stomach where it is digested. To be able to infect other people HIV would need to be able to leave the gut intact and then also be able to repl...
https://api.stackexchange.com
I am working with a set of (bulk) RNA-Seq data collected across multiple runs, run at different times of the year. I have normalized my data using library size / quantile / RUV normalization, and would like to check (quantitatively and/or qualitatively) whether or not normalization has succeeded in removing the batch e...
You should use box plots and PCA plot. Let's take a look at the RUV paper: Before normalization and after UQ normalization: Libraries do not cluster as expected according to treatment. ... for UQ-normalized counts. UQ normalization does not lead to better clustering of the samples... Before normalization, the med...
https://api.stackexchange.com
I have finished developing an app for Android and intend to publish it with GPL -- I want it to be open source. However, the nature of the application (a game) is that it asks riddles and has the answers coded into the string resource. I can't publish the answers! I was told to look into storing passwords securely -- b...
You have at least two options, depending on what problem you want to solve. If you want innocent readers of your code to not get the answers inadvertently, or you at least want to make it a bit difficult so that users are not tempted, you can encrypt the solutions and store the key as part of your code, perhaps a resul...
https://api.stackexchange.com
I'll be generous and say it might be reasonable to assume that nature would tend to minimize, or maybe even maximize, the integral over time of $T-V$. Okay, fine. You write down the action functional, require that it be a minimum (or maximum), and arrive at the Euler-Lagrange equations. Great. But now you want thes...
Could someone please convince me that there is something natural about the choice of the Lagrangian formulation... If I ask a high school physics student, "I am swinging a ball on a string around my head in a circle. The string is cut. Which way does the ball go?", they will probably tell me that the ball goes str...
https://api.stackexchange.com
I'm about to start working on a software library of numerical ODE solvers, and I'm struggling with how to formulate tests for the solver implementations. My ambition is that the library, eventually, will include solvers for both nonstiff and stiff problems, and at least one implicit solver (more or less on par with the...
This is a very broad question and I am going to give you some things to think about (some are already included in your post, but they are repeated here for completeness). Scope of Problems You need to define the interface of how to specify problems. Are you going to allow parameters that can be fixed or can vary for s...
https://api.stackexchange.com
From Wikipedia, there are three interpretations of the degrees of freedom of a statistic: In statistics, the number of degrees of freedom is the number of values in the final calculation of a statistic that are free to vary. Estimates of statistical parameters can be based upon different amounts of information or ...
This is a subtle question. It takes a thoughtful person not to understand those quotations! Although they are suggestive, it turns out that none of them is exactly or generally correct. I haven't the time (and there isn't the space here) to give a full exposition, but I would like to share one approach and an insigh...
https://api.stackexchange.com
Consider this picture of sun beams streaming onto the valley through the clouds. Given that the valley is only (at a guess) 3km wide, with simple trigonometry and the angles of the beams, this gives the result that the position of the light source is being a few tens of km away at most. What is wrong with the analysi...
This picture (source) should pretty much answer your question: The train's destination is not above the ground, but rather far away, and perspective means that the tracks appear not to be parallel but instead to converge to the vanishing point. The same applies to the beams of light above them. The Sun is very far aw...
https://api.stackexchange.com
I've found on multiple sites that convolution and cross-correlation are similar (including the tag wiki for convolution), but I didn't find anywhere how they differ. What is the difference between the two? Can you say that autocorrelation is also a kind of a convolution?
The only difference between cross-correlation and convolution is a time reversal on one of the inputs. Discrete convolution and cross-correlation are defined as follows (for real signals; I neglected the conjugates needed when the signals are complex): $$ x[n] * h[n] = \sum_{k=0}^{\infty}h[k] x[n-k] $$ $$ corr(x[n],h[n...
https://api.stackexchange.com
If I have a signal that is time limited, say a sinusoid that only lasts for $T$ seconds, and I take the FFT of that signal, I see the frequency response. In the example this would be a spike at the sinusoid's main frequency. Now, say I take that same time signal and delay it by some time constant and then take the FFT...
The discrete Fourier transform (DFT), commonly implemented by the fast Fourier transform (FFT), maps a finite-length sequence of discrete time-domain samples into an equal-length sequence of frequency-domain samples. The samples in the frequency domain are in general complex numbers; they represent coefficients that ca...
https://api.stackexchange.com
Many machine learning classifiers (e.g. support vector machines) allow one to specify a kernel. What would be an intuitive way of explaining what a kernel is? One aspect I have been thinking of is the distinction between linear and non-linear kernels. In simple terms, I could speak of 'linear decision functions' an 'no...
Kernel is a way of computing the dot product of two vectors $\mathbf x$ and $\mathbf y$ in some (possibly very high dimensional) feature space, which is why kernel functions are sometimes called "generalized dot product". Suppose we have a mapping $\varphi \, : \, \mathbb R^n \to \mathbb R^m$ that brings our vectors i...
https://api.stackexchange.com