text stringlengths 1 1.11k | source dict |
|---|---|
matlab, fft, frequency-spectrum
unit_pulse = zeros(length(t),1);
unit_pulse(1) = 1;
b = [1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8];
ir_filter = filter(b,1,unit_pulse);
nfft = length(ir_filter); %length of the time domain signal
%in order to obtain a good frequency resolution, pad the signal with zeros
%such that the length of the signal is a power of 2
no_zeros = (2^nextpow2(nfft)-nfft)/2;
padding = zeros(no_zeros,1);
signal = vertcat(padding, ir_filter, padding);
windowed_signal = signal .* blackman(length(signal));
spectrum_2side = real(fftshift(fft(windowed_signal))) ./ nfft;
f_2side = linspace(-fs/2, fs/2, length(windowed_signal));
spectrum_1side = 2*spectrum_2side(end/2+1:end);
f_1side = f_2side(end/2+1:end);
fig2 = figure();
hold on
grid on
plot(f_1side, spectrum_1side, 'b');
plot(f_2side, spectrum_2side, 'r');
This is a figure of what the impulse response looks like: Luk the following modified line corrects the DFT magnitude scale problem:
signal = vertcat(padding, fftshift(ir_filter), padding); | {
"domain": "dsp.stackexchange",
"id": 6892,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, fft, frequency-spectrum",
"url": null
} |
quantum-mechanics, homework-and-exercises, angular-momentum, atomic-physics, orbitals
$$\max(M_l)=0\implies L = 0$$
$$\therefore S = \frac{3}{2}\space \text{and} \space L = 0$$
I am trying to do homework problems similar to this and can not figure out how they reasoned $L = 0$ and was hoping to gain some clarification if at all possible.When moving to atoms with partially filled $\space f$ and $\space d$ orbitals I don't know where to start and I think it is because I am not sure how they approached this problem. Any help clarifying this process would be much appreciated. The given spin state requires all the spins to be parallel, which means that that state (and the whole $S=3/2$ manifold by extension) is symmetric under exchange. However, the global state needs to be antisymmetric, which means that the orbital component also needs to be antisymmetric. Within a p shell, this can only be achieved by putting one electron each on the $m_L=1$, $0$ and -$1$ states (since any repetitions would vanish under antisymmetrization), and that then gives you $M_L=0$. | {
"domain": "physics.stackexchange",
"id": 45121,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, angular-momentum, atomic-physics, orbitals",
"url": null
} |
### Series expansions
Since none of the functions discussed in this article are continuous, none of them have a power series expansion. Since floor and ceiling are not periodic, they do not have uniformly convergent Fourier series expansions.
x mod y for fixed y has the Fourier series expansion[18]
$x \,\bmod\, y = \frac{y}{2} - \frac{y}{\pi} \sum_{k=1}^\infty \frac{\sin\left(\frac{2 \pi k x}{y}\right)} {k}\qquad\mbox{for }x\mbox{ not a multiple of }y.$
in particular {x} = x mod 1 is given by
$\{x\}= \frac{1}{2} - \frac{1}{\pi} \sum_{k=1}^\infty \frac{\sin(2 \pi k x)} {k}\qquad\mbox{for }x\mbox{ not an integer}.$
At points of discontinuity, a Fourier series converges to a value that is the average of its limits on the left and the right, unlike the floor, ceiling and fractional part functions: for y fixed and x a multiple of y the Fourier series given converges to y/2, rather than to x mod y = 0. At points of continuity the series converges to the true value. | {
"domain": "wikipedia.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9944450741438985,
"lm_q1q2_score": 0.8035784554982278,
"lm_q2_score": 0.8080672089305841,
"openwebmath_perplexity": 4164.757721247511,
"openwebmath_score": 0.9321497678756714,
"tags": null,
"url": "https://en.wikipedia.org/wiki/Floor_and_ceiling_functions"
} |
fluid, forces
I need to calculate the angle at different heights and the submerged fraction of the second ball from the left for each angle.
I tried to calculate the submerged fraction of each ball individually using the angle (and thereby neglecting the gravitational forces).
But by doing the angle does not reduce when the water level falls since I only include the buoyancy forces. This is not right as the rod should follow the water level.
I don't know how to include the downwards forces for each ball.
This is a problem because (looking at the second ball from the left) the ball has the forces $F_{g2}$ and $F_{B2}$ acting on it but there will also be some force acting on this from the rest of the systems right?
So my question is how do I set up the forces acting on the middle ball?
I think the moment equation should be something like | {
"domain": "engineering.stackexchange",
"id": 4940,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid, forces",
"url": null
} |
$f(p):\!\!\equiv\Big{(}\;{\lambda}x.\,\;\big{(}\Box\;:P(x)\big{)}\;,\;\Box\;:% \mathchoice{{\textstyle\prod_{(x:A)}}}{\prod_{(x:A)}}{\prod_{(x:A)}}{\prod_{(x% :A)}}Q(x)\;\Big{)}.$
Now “we have $P(x)$ and $Q(x)$” invokes the hypothesis, obtaining $p(x):P(x)\times Q(x)$, and “hence we have $P(x)$” implicitly applies the appropriate projection:
$f(p):\!\!\equiv\Big{(}\;{\lambda}x.\,\mathsf{pr}_{1}(p(x))\;,\;\Box\;:% \mathchoice{{\textstyle\prod_{(x:A)}}}{\prod_{(x:A)}}{\prod_{(x:A)}}{\prod_{(x% :A)}}Q(x)\;\Big{)}.$
The next two sentences fill the other hole in the obvious way:
$f(p):\!\!\equiv\Big{(}\;{\lambda}x.\,\mathsf{pr}_{1}(p(x))\;,\;{\lambda}x.\,% \mathsf{pr}_{2}(p(x))\;\Big{)}.$ | {
"domain": "planetmath.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750477464142,
"lm_q1q2_score": 0.8002466466258932,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 210.31961275263185,
"openwebmath_score": 0.9204012751579285,
"tags": null,
"url": "http://planetmath.org/111PropositionsAsTypes"
} |
I notice something really odd - the volume(assuming half cylinders) for the inner half of A is $$\frac{\pi}{6000000000}$$ larger than the result I got from shell integration, and the outer half of B was exactly $$\frac{\pi}{6000000000}$$ smaller.
Why is this? These two toruses clearly have different $$R$$, and I don't see any reason why the volume inaccuracies for the inner half of $$A$$ and the outer half of $$B$$ (when you calculate them as half cylinders) would be the same and cancel each other out if we add them?
Thanks, Max0815 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429107723175,
"lm_q1q2_score": 0.8430501086181742,
"lm_q2_score": 0.8558511506439708,
"openwebmath_perplexity": 333.9106226213065,
"openwebmath_score": 0.9708139300346375,
"tags": null,
"url": "https://math.stackexchange.com/questions/4258161/why-do-two-half-toruses-add-up-to-the-same-volume"
} |
java
You should introduce constants with meaningful names:
public static final in LOWEST_INDEX = 0;
public static final in ZERO_BASED_INDEX_CORRETION = 1;
// ...
int choice = generateRandomIntRange(LOWEST_INDEX, size - ZERO_BASED_INDEX_CORRETION);
//...
int range = (max - min) + ZERO_BASED_INDEX_CORRETION;
visibility scopes
carefully chose the visibility of your methods (and classes, properties should be private anyway...).
Methods meant to be called by other code should be public
Methods meant to be called (or overridden by) subclasses should be protected | {
"domain": "codereview.stackexchange",
"id": 27744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
With the two-suit result in hand, you can finish the problem. The number of single-suit hands, as you argued, is $4\times{13\choose 5}=5148.$ The number of four-suit hands is $4\times 13^3\times{13\choose 2}=685464.$ Therefore, the number of three-suit hands (the only remaining possibility) is ${52\choose 5}-5148-379236-685464=1529112.$ To double-check this, note that a three-suit hand has $(1,2,2,0)$ or $(3,1,1,0)$ cards per suit. There are $12$ ways to choose the "loner" (first) and "excluded" (last) suits. For each (ordered) pair of suits, there are $13\times{13\choose 2}^2 + {13\choose 3}\times 13^2=127426$ ways to make a hand; the result is $12\times 127426 = 1529112$ again. The associated probabilities are: $$\begin{eqnarray} P_1 &=& \frac{5148}{2598960} &=& 0.198\% \\ P_2 &=& \frac{379236}{2598960} &=& 14.592\% \\ P_3 &=& \frac{1529112}{2598960} &=& 58.836\% \\ P_4 &=& \frac{685464}{2598960} &=& 26.375\% \\ \end{eqnarray}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9908743634192694,
"lm_q1q2_score": 0.8661007353492949,
"lm_q2_score": 0.8740772466456689,
"openwebmath_perplexity": 370.4676223005469,
"openwebmath_score": 0.7736230492591858,
"tags": null,
"url": "http://math.stackexchange.com/questions/224974/probability-for-suits-in-5-card-poker-hand"
} |
fluid-dynamics, waves, water, scaling
This is difficult
The simplest, most intuitive way to summarize the challenge here is to say: water doesn’t scale.
The most important parameters defining the fluid are viscosity and density. A secondary or even tertiary factor is resistance to rotation. Fluid analysis sometimes assumes inviscid, irrotational, or both.
This is not an easy problem at all. Fluids are analyzed using computational fluid dynamics because the interconnections are so complex and multidimensional.
It’s extremely difficult to say anything useful/qualitative just looking at such a situation.
The short answer is that water doesn’t scale. The situations just will not be analogous in any way once we are at factors of five or ten. But within those scale regions, there is some basis for comparison.
So what would someone actually do? | {
"domain": "physics.stackexchange",
"id": 81974,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, waves, water, scaling",
"url": null
} |
of the secant line as $\Delta x$ approaches zero. Also, in giving me a point on the line, they have given me an x-value and a y-value for this line: x = –1 and y = –6. Slope of the tangent line is. In general, the average speed from time a to time b is the slope of the secant line through the distance graph at t = a and t = b. f(1) (C) The equation of the tangent line at (1,f(1)) (A) The slope of the secant line through the points (1,f(1)) and (1+h,f(1 + hy), h#0, is (B) The slope the graph at (1. Recall that a secant line is any line that connects two points on a curve. (See below. 5) Graph your results to see if they are reasonable. 8 average = −33. When we want to find the equation for the tangent, we need to deduce how to take the derivative of the source equation we are working with. We know how to calculate the slope of the secant line. This abstract concept has a variety of concrete realizations, like finding the velocity of a particle given its position and finding the rate of | {
"domain": "otticamuti.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9873750496039277,
"lm_q1q2_score": 0.8291323699645727,
"lm_q2_score": 0.8397339696776499,
"openwebmath_perplexity": 238.17182620148998,
"openwebmath_score": 0.7098960280418396,
"tags": null,
"url": "http://oogo.otticamuti.it/find-the-slope-of-the-secant-line-through-the-points.html"
} |
java, programming-challenge
public static void main(String[] args) {
TopByOrderK<String> topper = new TopByOrderK<>(3, 5, null);
String many[] = {
"for", "int", "offset", "n", "k", "order", "apply", "many",
// "runnersUp", "top", "candidates",
// "offsets", "trickle", "down", "x", "z"
};
topper.topByOrderK(many);
System.out.println(Arrays.asList(topper.candidates[topper.t_])
.subList(topper.k_t, topper.k));
System.out.println(topper.calls + " calls");
}
} ... non-descendingly. */
I prefer "monotonic ascending", which is easily mentally shortened
to just "ascending".
Matter of taste.
Humans tend to deal better with positive definitions than negative ones.
dead stores in ctor
t_ = top -1;
...
k_ = k - 1;
k_t = k - top;
I don't get it.
We compute these locals, and then never use them?
Better to just elide them.
int offsets[], t, t_, k, k_, k_t; | {
"domain": "codereview.stackexchange",
"id": 45279,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, programming-challenge",
"url": null
} |
hint
$$g(x)=f(x)e^{-x}$$
$$g(0)=g(1)$$
Rolle?
• How do you get that idea of defining function like that... Any easier way?plz help – Cloud JR Dec 5 '18 at 19:21
• From the difference $$f'(x)-f(x)=0$$ – hamam_Abdallah Dec 5 '18 at 19:22
• And you think how to make that , also $f'(x)=f(x)$ suggest using e^x ...your answer(hellHound ) is very enlightening – Cloud JR Dec 5 '18 at 19:25
• You mean $e^{-x}$. If we had $$f'(x)+f(x)=0$$ we think $e^x$. – hamam_Abdallah Dec 5 '18 at 19:29
Look at $$g(x)=f(x) \cdot \exp (-x)$$. Then $$g$$ is also differentiable on $$(0,1)$$ with derivative $$g'(x) = (f(x)-f'(x)) \exp (-x)$$. Noting that $$g(0) = g(1) = 0$$, Rolle's theorem applies and you get a $$c \in (0,1)$$ such that $$g'(c) = 0$$. This implies $$f(c) = f'(c)$$.
• Yes I realised and edited it, thank you. It seems like we have posted our answer at almost the same time. – hellHound Dec 5 '18 at 19:21
• Also the same answer lol...idk which one to accept – Cloud JR Dec 5 '18 at 19:22 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668668053619,
"lm_q1q2_score": 0.8300106964278952,
"lm_q2_score": 0.8459424431344437,
"openwebmath_perplexity": 795.5135489789297,
"openwebmath_score": 0.8799372911453247,
"tags": null,
"url": "https://math.stackexchange.com/questions/3027494/the-equation-fx-fx-admits-a-solution"
} |
Now imagine you have a sequence of length $k-1$. If it has an odd number of $0$s, then you can append a $0$ to the end of it. If it has an even number of $0$s, you can append a $1$ to it.
Assume then that it is true that, for words of length $k$, there are $2^{k-1}$ words with an even number of $0$s.
To those $2^{k-1}$ which have an even number of $0$s you add a $1$, making $2^{k-1}$ words of length $k+1$ that have an even amount of $0$s. To the other $2^{k-1}$ that have an odd number of $0$s, you add a $0$, making another $2^{k-1}$ words that have an even number of $0$s and length $k+1$. Therefore, you have a total of $2^{k-1} + 2^{k-1} = 2\cdot2^{k-1} = 2^k$ words, of length $k+1$, with an even number of $0$s, concluding your proof.
What you are considering are numbers $0000\dots0$ to $1111\dots1$ in binary. Indeed in total there are $2^n$ numbers.
Now, notice it is true for $n=1$. Assume it might be true for the number before your favourite natural number $k-1$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9840936068886641,
"lm_q1q2_score": 0.8422376457970385,
"lm_q2_score": 0.8558511506439707,
"openwebmath_perplexity": 199.09606043887263,
"openwebmath_score": 0.8525063395500183,
"tags": null,
"url": "https://math.stackexchange.com/questions/2095057/amount-of-even-zeros-in-a-0-1-alphabet-n-length-word/2095073"
} |
c++, object-oriented, sudoku, opencv, gtk
return check;
}
void sudoku :: solve ( int arr[9][9] )
{
for ( int i = 0 ; i < 9 ; i++ )
{
for ( int j = 0 ; j < 9 ; j++ )
{
if ( arr[i][j] == 0 )
{
for ( int k = 1 ; k <= 9 ; k++ )
{
if ( isValid (arr,i,j,k) == true )
{
arr[i][j] = k;
whenDone();
solve(arr);
arr[i][j] = 0;
}
if ( k == 9 )
{
arr[i][j] = 0;
return;
}
} | {
"domain": "codereview.stackexchange",
"id": 38419,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented, sudoku, opencv, gtk",
"url": null
} |
homework-and-exercises, conformal-field-theory, stress-energy-momentum-tensor
& = \left(\frac{\partial w}{\partial z} \right)^2 T'(w) + \frac{1}{12} \left(\frac{w^{(3)}}{w^{(1)}} - \frac{3}{2} \left( \frac{w^{(2)}}{w^{(1)}} \right)^2 \right) \tag{4}
\end{align}
where $w^{(n)}$ refers to the n-th derivative, and where I skipped the first steps of the calculation. Now my problem is: how do you get from line (3) to line (4)? I tried expanding, but I cannot reproduce the result with the higher order derivatives.
Thank you very much in advance. The Quick Answer
The big yellow book (namely Di Francesco et al) that the OP quotes, largely obscures the distinction between what I call (b) and (c) below. If the OP is just interested in deriving the result in the fastest way he can Taylor-expand in $\delta$ the quantities $w(z+\delta/2)$, etc., and take the limit $\delta\rightarrow 0$. E.g.,
$$
w(z+\delta/2)\simeq w(z)+\frac{\delta}{2}\partial_zw(z)+\frac{1}{2!}\Big(\frac{\delta}{2}\Big)^2\partial_z^2w(z)+\frac{1}{3!}\Big(\frac{\delta}{2}\Big)^3\partial_z^3w(z)+\dots
$$
$$ | {
"domain": "physics.stackexchange",
"id": 58641,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, conformal-field-theory, stress-energy-momentum-tensor",
"url": null
} |
The Enlightened Elephant. Unit 6 Review Worksheet. Exponential Functions (Day 1) Complete these tables below, graph each set of points. • Distinguish between additive and multiplicative change and construct and interpret arithmetic sequences as linear functions and geometric sequences as exponential functions. • Graphing Functions 139 • Modeling 140 • Families of Functions 140 • Functions in Equivalent Forms 142 • Factoring Quadratics 143 • Completing the Square 143 • Exponential Functions 143 • Comparing Functions 144. A logarithmic equation is an equation that involves the logarithm of an expression containing a variable. If there are just two independent variables, the estimated regression function is 𝑓(𝑥₁, 𝑥₂) = 𝑏₀ + 𝑏₁𝑥₁ + 𝑏₂𝑥₂. IXL brings learning to life with over 200 different algebra skills. ⃣Substitute convenient values of x to generate a table and graph of an exponential function ⃣Classify exponential functions in function notation as growth or decay ⃣Determine the domain, | {
"domain": "mozzicristina.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682458008671,
"lm_q1q2_score": 0.8012947608936889,
"lm_q2_score": 0.8104789086703225,
"openwebmath_perplexity": 1190.0006006151593,
"openwebmath_score": 0.3766786456108093,
"tags": null,
"url": "http://www.mozzicristina.it/linear-vs-exponential-functions-guided-notes.html"
} |
reprap, 3d-printing, linear-bearing
This resource has some limited information but does not help with which would be best suited for this particular application.
What material is best suited for this purpose? For ball bearings, you almost always want to use the hardest, smoothest material you can find. Stainless steel would do nicely. Aluminium will be far too soft, and will simply be worn down the the steel ball bearings.
Plastic bearings like these Drylin from Igus can use aluminium rails: | {
"domain": "robotics.stackexchange",
"id": 2093,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reprap, 3d-printing, linear-bearing",
"url": null
} |
computability
$$\psi_{g(e)} = h^{-1} \varphi_{hg(e)}h ~.$$
By definition of $g$, we have $h g = h h^{-1} g' = g'$, so
$$\psi_{g(e)} = h^{-1} \varphi_{g'(e)}h ~.$$
By definition of $g'$
$$\psi_{g(e)} = h^{-1} h \varphi_e h^{-1} h ~,$$
and thus
$$\psi_{g(e)} = \varphi_e ~. ~~\Box$$ | {
"domain": "cs.stackexchange",
"id": 11380,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability",
"url": null
} |
ethology, predation
Title: Are there any pairs of animal species that regularly prey on other? I don't mean cannibalism within a single species - I mean, are they are any pairs of species A and B such that members of species A regularly prey on members of species B, and also members of species B regularly prey on members of species A? I'm considering adults preying on other adults of the other species, not on individuals early in their life cycle.
Caiman and Anacondas - though each hunts the other at a stage of development when the hunter is larger.1 2
Occasionally this occurs with Orcas and Sharks.3
Some species of shark3
Spiders and mantids4
Alligators and catfish (catfish prey on infant alligators)
Many species of predatory fish
Some species of constrictor and venomous snake.
Some frogs and Epomis circumscriptus / Epomis dejeani5
Some amphipods6
In Antiquity, hominids and lions7 8
Big cats preying on eachother, among other large predators: | {
"domain": "biology.stackexchange",
"id": 8695,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ethology, predation",
"url": null
} |
quantum-field-theory, particle-physics, symmetry, neutrinos, beyond-the-standard-model
In general, since these are only global symmetries, they need not be respected by the mass terms.
For general Yukawa matrices, the $U(3)$ symmetries can then be used to simplify these matrices.
For example, in the quark sector we can use the $U(3)^3$ symmetry to diagonalize one matrix through a bi-unitary transformation.
Trying to do the same with the other Yukawa matrix would require an overall $U(3)^4$ symmetry, which is not there. We are stuck with one unitary matrix mixing different mass eigenstates in interactions - the CKM matrix.
In the lepton sector, things are similar. We have a global $U(3)^3$ symmetry that we can use to simplify the mass matrices.
As an example, we can use the freedom to re-define the right-handed electrons and left-handed lepton doublets in oder to diagonalize the charged lepton mass matrix right away.
This leaves us with only the $U(3)$ symmetry of the right-handed neutrinos to simplify the neutrino masses overall. | {
"domain": "physics.stackexchange",
"id": 36034,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, symmetry, neutrinos, beyond-the-standard-model",
"url": null
} |
machine-learning
In the unsupervised world, you'll have to think really hard about the mapping of the unsupervised outputs to the label you've decided to use for evaluation. A lot of this is going to come down to how you structure that unsupervised problem. Like, if you're going to be using unsupervised clustering, then maybe you run the model, see what the clusters look like, and see if there's a way to map those clusters the label you're evaluating. | {
"domain": "datascience.stackexchange",
"id": 3498,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning",
"url": null
} |
c, bioinformatics
This would run even faster if the compiler did one wider load and unpacked it with ALU instructions instead of loading each string byte separately. Running this in a loop is going to bottleneck on 2 loads per clock on mainstream Intel/AMD CPUs, so about 1 nucleotide per clock cycle, which is not bad. The overhead of checking the index for in-range (to detect bogus nucleotide characters) should be negligible compared to the string loads + table lookups. Especially on CPUs that can only do one load per clock.
(Related this Q&A for more about tweaking your C source to hand-hold the compiler into making better asm. You could do that here, but only at the cost of readability, I think. You'd probably have to do a dodgy pointer-cast or a safe memcpy and read 4 bytes as a uint32_t and unpack that.) | {
"domain": "codereview.stackexchange",
"id": 30142,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c, bioinformatics",
"url": null
} |
machine-learning, supervised-learning, probability
\begin{equation*}
p(\mathbf{x},y)=p(\mathbf{x}|y)\cdot p(y)
\end{equation*}
From the above two equations, we obtain
\begin{equation*}
p(y|\mathbf{x})=\dfrac{p(\mathbf{x}|y)\cdot p(y)}{p(\mathbf{x})}
\end{equation*}
In the context of supervised learning, the variable $y$ is used to denote the class labels, and the vector $\mathbf{x}$ for measurement vector or feature vector. For the purpose of discussion, let us assume that the class label $y$ takes values in the set $\{1,2\}$, where $1$ denotes male and $2$ denotes female. Similarly, $\mathbf{x}$ is a measurement vector on two variables say, $(x_{1},x_{2})$, where $x_{1}$ stands for height and $x_{2}$ stands for weight of individuals.
$p(y|\mathbf{x})$ denote the posterior density for $y$ given the observation $\mathbf{x}$. For example, $p(1|\mathbf{x})$ means that given the observation $\mathbf{x}$, what is the probability that sample belongs to the class males. Similarly, we can interpret $p(2|\mathbf{x})$. | {
"domain": "datascience.stackexchange",
"id": 1240,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, supervised-learning, probability",
"url": null
} |
classical-mechanics, kinematics, differential-geometry, rotational-kinematics, spinors
\end{align}
Now, pulling back both sides along $\gamma$ gives
\begin{align}
\dot{\gamma}(t)=\left((r^i\circ \gamma)’(t)+\omega^i_{\,j}[\dot{\gamma}(t)]\,(r^j\circ\gamma)(t)\right)\xi_i(t),
\end{align}
or in classical notation, $\dot{\mathbf{r}}(t)=\left(\dot{r}^i(t)+\omega^i_{\,j}(t)r^j(t)\right)e_i(t)$. Now, let me warn you that we are only able to talk about $\mathbf{r}$, the identity function, and treat it also as a “position vector” because the target space $V$ is a vector space. In more general situations, we do not have this. So, we can’t speak of the component functions $r^i$. But, what we can still do is interpret $d\mathbf{r}$ accordingly; namely it is simply the identity map on the tangent bundle of the manifold, $\mathbf{1}_{TM}$. Afterall, notice what $d\mathbf{r}$ is really trying to do: it takes in a tangent vector $k_x$ and spits out the same thing $v_x$. | {
"domain": "physics.stackexchange",
"id": 95743,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, kinematics, differential-geometry, rotational-kinematics, spinors",
"url": null
} |
quantum-mechanics, quantum-field-theory, wavefunction, quantum-interpretations
EDIT: After searching I found Reality, Measurement and Locality in Quantum Field Theory helpful, it analyzes the EPR experiment from the QFT point of view, and discusses collapse explicitly. On interpretational issues of QFT more broadly Against Field Interpretations of Quantum Field Theory gives a nice overview. The Born rule (and hence any discussion of collapse in the sense of the Copenhagen interpretation) is relevant only when an observer has made a distinction between a (tiny, observed) system and its (huge, observing) environment (= everything else, containing in particular the measurement equipment). | {
"domain": "physics.stackexchange",
"id": 41595,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, wavefunction, quantum-interpretations",
"url": null
} |
particle-physics, wavefunction, antimatter, pauli-exclusion-principle
I read in this question that the wave functions of the Neutron and anti-Neutron could interact and this could in theory happen at any distance though in practice, it's much more likely to happen when close.
My question is, any Neutron-antiNeutron interaction would probably need to happen via the strong force, which is very short range, but in theory, the up and down quarks and an anti-quark's in the Neutron have wave functions which creates some uncertainty on their precise location so interaction could happen at greater distance. | {
"domain": "physics.stackexchange",
"id": 25795,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, wavefunction, antimatter, pauli-exclusion-principle",
"url": null
} |
array, assembly
SetFinalBytesLoop:
mov byte ptr [rcx], 0 ; Sets the last byte of the array to 0
inc rcx
dec r8d
jnz SetFinalBytesLoop
Finished:
ret
SetupLessThan8Bytes:
mov r8d, edx ; Mov the value of edx into r8d so the same code can be used in SetFinalBytesLoop
jmp SetFinalBytesLoop
ZeroArray endp
end Shave off a byte
cmp edx, 0
jle Finished ; Check if count is 0
Using cmp is certainly not wrong, but the optimal way to check for any inappropriate counter value would be to use the test instruction.
test edx, edx
jle Finished ; Check if count is 0
Bypassing when the counter is zero is fine, but perhaps a negative counter value should rather be considered an error and handled accordingly?
Don't loose yourself in jumping around | {
"domain": "codereview.stackexchange",
"id": 27732,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "array, assembly",
"url": null
} |
quantum-state, error-correction, quantum-operation, trace-distance
Title: Is the restriction of a strictly contractive channel (SCC) to a subspace necessarily still SCC? (impossibility of perfect QEC for SCCs) This paper shows the impossibility of perfect error correction for strictly contractive quantum channels, i.e., for channels such that $||\mathcal{E}(\rho)-\mathcal{E}(\sigma) ||\leq k ||\rho-\sigma||$, for $0\leq k <1$.
The requirement for perfect error correction of a subspace $K$ is that there exists a channel $S$ such that $S$ is the inverse of the restriction of $\mathcal{E}$ to the subspace $K$.
The proof of impossibility uses the fact that this would require $||S\mathcal{E}(|u\rangle\langle u|)-S\mathcal{E}(|v\rangle\langle v|)|| = |||u\rangle\langle u|-|v\rangle\langle v|||$, for some basis vectors $u,v$, which would contradict strict contractivity. | {
"domain": "quantumcomputing.stackexchange",
"id": 1788,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-state, error-correction, quantum-operation, trace-distance",
"url": null
} |
area under the curve, Brightstorm. Say I asked you to find the (signed) area under [math]f(x)=[/math. We do, in fact, have a formula for finding areas of regions enclosed by polar curves. Calculate the area of region defined by the inequalities:$$-1 {-1, 3}] I'd like to shade the region that lies inside the circle but outside of the cardioid. The symmetry of polar graphs about the x-axis can be determined using certain methods. Know how to find the area of a surface of revolution. Polar Area Moment of Inertia and Section Modulus. The perpendicular distance from (αβγ,, ) to. Hypocycloids and pedal curves. Here we have the area between 2 curves. In calculus, the evaluate the area between two curves, it is necessary to determine the difference of definite integrals of a function. Find the area of the region bounded by the graph of the lemniscate r 2 = 2 cos θ, the origin, and between the rays θ = –π/6 and θ = π/4. Representations of a Line in Two Dimensions. Order of Operations Factors & | {
"domain": "wokpark.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676454700793,
"lm_q1q2_score": 0.8032229674639569,
"lm_q2_score": 0.8198933293122506,
"openwebmath_perplexity": 622.0202468597455,
"openwebmath_score": 0.8173930644989014,
"tags": null,
"url": "http://wokpark.it/oxzk/area-between-polar-curves-calculator.html"
} |
detailed algorithm that is very close to a computer language. Find the local optimal solution at each step, instead of considering the entire sequence of steps. When we evaluate the complexity of the binary search algorithm, 4:55. In fractional knapsack, you can cut a fraction of object and put in a bag but in 0-1 knapsack either you take it completely or you don't take it. com Free Programming Books Disclaimer This is an uno cial free book created for educational purposes and is not a liated with o cial Algorithms group(s) or company(s). To solve a problem based on the greedy approach, there are two stages. Algorithms are described in English and in a pseudocode designed to be readable by anyone who has done a little programming. • The first version of the Dijkstra's algorithm (traditionally given in textbooks) returns not the actual path, but a number - the shortest distance between u and v. It is a greedy algorithm in graph theory as it finds a minimum spanning tree for a connected | {
"domain": "puntoopera.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347860767304,
"lm_q1q2_score": 0.8011696831464599,
"lm_q2_score": 0.822189123986562,
"openwebmath_perplexity": 806.7616996057025,
"openwebmath_score": 0.5701478719711304,
"tags": null,
"url": "http://puntoopera.it/rsls/greedy-algorithm-pseudocode.html"
} |
c#, beginner, .net, unit-testing
Logic
No logic in your test! Instead use multiple tests to test the different scenarios. For reasons: see above.
Misc
I have no idea what SemverPart does or means; refactor this into a name in the form of [action][context] (for example: GetVersion()). | {
"domain": "codereview.stackexchange",
"id": 7896,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, beginner, .net, unit-testing",
"url": null
} |
regular-languages, context-free, undecidability
If you take a close look at any proof for the fact that the intersection of a CFL with a RL is a CFL, you will find that the proof is constructive or can be made to be constructive easily, giving that there is an algorithm to construct the CFL for a given PDA. Here "constructive" means the same as "algorithmic". It is just by convention or history, we tend to use the word "constructive" instead of "algorithmic" to describe a proof.
You can check your textbook, or this and this.
Exercise. Is the following problem decidable? | {
"domain": "cs.stackexchange",
"id": 14174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "regular-languages, context-free, undecidability",
"url": null
} |
2-DOF rotation graphs. $\begingroup$ with 4 vertices all graphs drawn are isomorphic if the no. Two graphs with different degree sequences cannot be isomorphic. Distance Between Vertices and Connected Components - … Note − In short, out of the two isomorphic graphs, one is a tweaked version of the other. For higher number of vertices, these graphs can be generated by a number of theorems and procedures which we shall discuss in the following sections. The list does not contain all graphs with 8 vertices. They may also be characterized (again with the exception of K 8) as the strongly regular graphs with parameters srg(n(n − 1)/2, 2(n − 2), n − 2, 4). If all the edges in a conventional graph of PGT are assumed to be revolute edges, the derived graph is its parent graph. Trains ( PGTs ) have extensive application in various kinds of mechanical equipment test some non isomorphic graphs with 8 vertices... By the long standing conjecture that all Cayley graphs graph at the graph the... | {
"domain": "bahaiweddings.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9572777975782055,
"lm_q1q2_score": 0.8155555001096286,
"lm_q2_score": 0.8519528000888386,
"openwebmath_perplexity": 825.6381228822925,
"openwebmath_score": 0.49871379137039185,
"tags": null,
"url": "http://bahaiweddings.com/nick-portokalos-baflxrj/article.php?page=bcab69-non-isomorphic-graphs-with-8-vertices"
} |
Return value :
0 on success, otherwise -1. In this case, address.host will be INNADDR_NONE. This can happen if the address is invalid or leads to nowhere
#### SDLNet_AllocPacket
Allocates a UDP_Packet and returns a pointer to it.
Parameters :
• int size – size of the packet in bytes. 0 is invalid.
Return value :
A valid pointer to UDPpacket, NULL on error ( such as out of memory )
The size of the packet determines how much data we get every time. It’ll never be more than this size, but it can be less. You can also expect that some packages gets mfSerged or split up into different segments. This is something we’ll need to handle.
After allocation space for a packet, we can finally fill that packet up with something. Which is kinda the point of this ordeal.
#### SDLNet_UDP_Send
Sends a UDPpacket
Parameters : | {
"domain": "headerphile.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.989830340446144,
"lm_q1q2_score": 0.8226906122311185,
"lm_q2_score": 0.831143054132195,
"openwebmath_perplexity": 992.7625765702774,
"openwebmath_score": 0.42407405376434326,
"tags": null,
"url": "http://headerphile.com/tag/game-programming/"
} |
mvc, objective-c, interview-questions, ios, web-scraping
-(void) allWordsFromURL:(NSURL *)url
onSuccess:(void (^)(NSArray *words))success
onFailure:(void (^)(NSError *))failureBlock
{
[self fetchFrom:url
onSuccess:^(id response) {
if ([response isKindOfClass:[NSString class]]) {
NSString *responseString = (NSString *)response;
success([self _wordsFromString:responseString]);
}
} onFailure:^(NSError *error) {
failureBlock(error);
}] ;
}
@end | {
"domain": "codereview.stackexchange",
"id": 5607,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mvc, objective-c, interview-questions, ios, web-scraping",
"url": null
} |
$\Longrightarrow$
In this direction, we show that if $X$ is scattered, then $X$ is countable. We also show the contrapositive: if $X$ is uncountable, then $X$ is not scattered. Suppose $X$ is uncountable. By Theorem 2, all but countably many points of $X$ are limit points of $X$. After discarding these countably many isolated points, we still have a compact space. So we can just assume that every point of $X$ is a limit point of $X$. Then by Theorem 3, $X$ contains an uncountable closed set $C$ such that every point of $C$ is a limit point of $C$. This means that $X$ is not scattered. $\blacksquare$
____________________________________________________________________
Remarks | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357195106374,
"lm_q1q2_score": 0.8049185740550521,
"lm_q2_score": 0.8198933359135361,
"openwebmath_perplexity": 100.52160425469535,
"openwebmath_score": 0.9672622084617615,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/compact-space/"
} |
mechanical-engineering, manufacturing-engineering
A secondary assembly that lays out the components and make a drawing out of that.
If all the parts go to the same design you may do this layout as a explode state.
Let the CAM module lay them out (this is best as it gives manufacturing much more flexibility, also most likely it can be auto optimized)
the benefit of this is that the instructions are associative with the actual designs and not a self contained drawing | {
"domain": "engineering.stackexchange",
"id": 4368,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mechanical-engineering, manufacturing-engineering",
"url": null
} |
javascript, algorithm, chess
function isObstacle(row, col) {
for (let o of obstructions) {
if (o[0] === row && o[1] === col) {
console.log(o[0] + ',' + o[1]);
return true;
}
}
}
function checkUp(row, col) {
if (row >= 0) {
console.log(row);
if (isObstacle(row,col)) {
return;
} else {
counter++;
checkUp(row-1,col);
}
}
}
function checkDown(row, col) {
if (row < boardLength-1) {
if (isObstacle(row,col)) {
return;
} else {
counter++;
checkDown(row+1,col);
}
}
}
function checkLeft(row, col) {
if (col >= 0) {
if (isObstacle(row,col)) {
return;
} else {
counter++;
checkLeft(row,col-1);
}
}
}
function checkRight(row, col) {
if (col < boardLength-1) {
if (isObstacle(row,col)) {
return;
} else {
counter++;
checkRight(row,col+1);
}
}
} | {
"domain": "codereview.stackexchange",
"id": 29225,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, algorithm, chess",
"url": null
} |
optics, reflection, geometric-optics, telescopes
Their corresponding potentials are $gz$ and $-\frac{1}{2} \omega^2 r^2$ and
total potential is therefore
$$
U(r, z) = gz - \frac{1}{2} \omega^2 r^2.
$$
Mercury will form a shape which has constant potential on the whole surface
(if the potential wasn't constant, mercury would want to move around);
and since potential is defined up to an additive constant,
we can choose it so that the potential is zero on the surface of the mercury.
The shape of the surface is thus given by a line whose explicit equation we can obtain from
$$
gz - \frac{1}{2} \omega^2 r^2 = 0
\Rightarrow
z = \frac{\omega^2}{2g} r^2.
$$ | {
"domain": "physics.stackexchange",
"id": 94525,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, reflection, geometric-optics, telescopes",
"url": null
} |
java, performance, strings, parsing
}
return false;
} I find that it is not good practice to pass in a argument by its implemented name if it has a backing interface. ArrayList<T> is a good example, it is based on the interface List<T> and is just as capable as ArrayList. It is useful this way because if you decide to pass in an immutable List, or a different type of List you don't have to worry about fixing compiler errors down the road.
Having nested for loops and if statements makes it difficult to know where and what to do. I find it often easier to take the contents inside a for loop and put them in a extracted method giving it a good name.
This little bit of code is hard to read. plus comparing a boolean is not good practice.
Boolean result = smallerTOkenValue.contains(",");
if (result == true) { | {
"domain": "codereview.stackexchange",
"id": 14759,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, strings, parsing",
"url": null
} |
fourier-transform, phase, fourier
(odd function component).
When we express $f(t)$ in terms of its Fourier Transform, we are
essentially representing it as a sum (or integral, in the case of
the continuous Fourier Transform) of these sine and cosine waves.
Each sine and cosine wave is a "frequency component" of $f(t)$. The
complex exponential form $e^{-j\omega t}$ (where $j$ is the
imaginary unit) is often used because it compactly represents both
sine and cosine terms through Euler's formula. | {
"domain": "dsp.stackexchange",
"id": 12428,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fourier-transform, phase, fourier",
"url": null
} |
differential-geometry, tensor-calculus
I'm familiar with the treatment of vectors as elements of a tangent space of a manifold and dual vectors as linear operators on vectors, if that's the sort of explanation that motivates the cobasis most effectively, although I don't have a good intuition with that sort of thing quite yet. I think maybe you are just wondering why we need covectors at all. Once you accept that we need covectors, it makes sense to have cobases for your covectors just like you have bases for your vectors. | {
"domain": "physics.stackexchange",
"id": 13732,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "differential-geometry, tensor-calculus",
"url": null
} |
homework-and-exercises, newtonian-mechanics, classical-mechanics
Title: Why is Work not equal to 625 Joules in this case? A variable force $\vec{F} = 3x^2y \vec{i}$ (unit vector) is acting on an object that travels on a square loop in a clockwise direction starting from the origin to (0,5) then (5,5) then (5,0) then back to (0,0). How much work is done on the particle by the force during one complete trip around the square?
It should be 625 Joules because when the particle is on the $x$-axis, $x=0$ so there's no force, and when the particle is moving up or down the force is not in its direction? This is like calculating a line integral only.
Work done, $W= \oint_C \vec F\cdot d\vec r = \oint_C 3x^2ydx=\int_I 3x^2ydx +\int_{II} 3x^2ydx +\int_{III} 3x^2ydx +\int_{IV} 3x^2ydx$
Now for path I, (0,0) to (0,5): $dx = 0$
$$\int_I 3x^2ydx = 0$$
Now for path II, (0,5) to (5,5): $y=5$
$$\int_{II} 3x^2ydx = 15\int^5_0 x^2 dx=5(5^3-0) = 625$$
Now for path III, (5,5) to (5,0): $dx = 0$
$$\int_{III} 3x^2ydx = 0$$
Now for path IV, (5,0) to (0,0): $y=0$ | {
"domain": "physics.stackexchange",
"id": 25665,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, classical-mechanics",
"url": null
} |
image-processing, fft
Title: How do I obtain the frequencies of each value in a 2D FFT and what do they mean? My goal is to analyze the frequencies in an image representing water simulation data before and after, for example, a Gaussian filter. The direction of these frequencies is not important to me. Ideally, I think I want to plot these frequencies in a 2D graph, where x represents the frequency, ranging from 0 to 0.5, and y represents the amplitude.
I understand how to obtain the 1D frequencies, as is explained here:
https://stackoverflow.com/questions/4364823/how-do-i-obtain-the-frequencies-of-each-value-in-a-fft. From this, I also understand how to obtain the frequencies in x- and y- direction.
What I do not fully understand is what the direction-independent frequencies of my output values are. Intuitively, I would expect to calculate them like so:
// from output to frequencies to periods
fx = kx / N; fy = ky / M
px = 1/fx; py = 1/fy | {
"domain": "dsp.stackexchange",
"id": 2599,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, fft",
"url": null
} |
vqe
The VQE uses as many qubits in parallel as terms in the Hamiltonian
To obtain the expectation value for each Hamiltonian term you need to perform the blue background algorithm part several times, each time starting with the same ansatz parameters
Once expectation values are all estimated for the first used ansatz parameters, the expectation value of Hamiltonian can be classically computed from Eq. 1. To optimize the ansatz parameters, the previous steps need to be performed again with a priori other random ansatz parameters until one retrieves a map of $\langle H\rangle$ with respect to ansatz parameters and is able to numerically approach $\langle H\rangle$ partial derivative with respect to these ansatz parameters.
Am I understanding VQE correctly? Disclaimer: most of my comprehension of VQE comes from Musty Thoughts, and I highly recommend his articles to get a deeper explanation of VQE.
The VQE uses as many qubits in parallel as terms in the Hamiltonian | {
"domain": "quantumcomputing.stackexchange",
"id": 4867,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vqe",
"url": null
} |
electromagnetism, magnetic-fields, potential, voltage, electromagnetic-induction
Picture 1 (a) "Voltage is by definition (Definition 2) the difference in electric potential between two points." No, you are defining potential difference, a concept that can't be usefully applied to this situation.
(b) If there is a potential difference between two points A and B then a test charge taken from one point to the other will have work done on it by an electric field of an amount independent of the path taken from A to B. This is clearly not the case here. If you choose any two points on the ring, positive work will be done on the test charge if you take it from A to B in one sense round the ring, and negative work if you take it in the other sense. The concept of electric potential is inapplicable. | {
"domain": "physics.stackexchange",
"id": 93861,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, magnetic-fields, potential, voltage, electromagnetic-induction",
"url": null
} |
javascript
Title: Generate table of contents form HTML I've written a small bit of JavaScript which parses some HTML and generate a table of contents based on the various heading tags. The table of contents needs to be nested (E.g. H2 tags appear under H1).
My code is currently working well but I'm not sure the my method of storing all the headings is the best (it's been awhile since I've had to do much JS). The headings are being stored in a series of nested objects. The objects are made up of two properties (#title and #id) to store the heading title and anchor link. It can then contain incrementally numbered sub-heading objects.
A large portion of my code seems to be dealing with finding the last item in the object to append the next heading to. I don't know if there would be an easier way of doing this with nested arrays. | {
"domain": "codereview.stackexchange",
"id": 16278,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript",
"url": null
} |
algorithms, sorting
"caching" is put before "counting" since "caching" is a more distinguishing feature of the algorithm. It is better to make the name less similar to the existing counting sort.
This is not a very cohesive name, since there is no strong coupling between the two techniques used in that sort. The technique of caching could be applied to almost all kinds of sort. The technique of counting could be applied to almost all kinds of sort as well independently. The only meaningful connection between them is that if this caching technique improves the speed a lot, it is more likely that there are lots of duplicates, then the counting technique might be even more useful.
"Caching and counting insertion sort" or "caching-counting insertion sort" is, in fact, more like a description instead of a proper name. | {
"domain": "cs.stackexchange",
"id": 14297,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, sorting",
"url": null
} |
kinect, openni-camera, transform
Originally posted by Martin Peris with karma: 5625 on 2012-08-13
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 10593,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinect, openni-camera, transform",
"url": null
} |
python, programming-challenge, python-2.x, time-limit-exceeded, pathfinding
def answer(grid):
width = len(grid[0])
height = len(grid)
ones = [(x,y) for x in range(width) for y in range(height) if grid[y][x] == 1]
min_length = float('inf')
for x,y in ones:
newgrid = deepcopy(grid)
newgrid[x][y] = 0
min_length = min(min_length, get_path_length(newgrid))
return min_length | {
"domain": "codereview.stackexchange",
"id": 31294,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, programming-challenge, python-2.x, time-limit-exceeded, pathfinding",
"url": null
} |
particle-physics, supersymmetry, beyond-the-standard-model, large-hadron-collider, mssm
With regards to possible supersymmetric loop contributions to the anomalous magnetic moment of the muon, the well-known $3\sigma$ variation is consistent with some regions of the pMSSM parameter space, although it is difficult to reconcile with CMSSM (the latter is also under severe pressure from the various LHC measurements of e.g. light squark and gluino masses, Higgs mass, SUSY breaking mechanisms, etc.). Nevertheless, the BMW lattice calculations may be correct anyway and consistent with the SM itself.
However, the MSSM is not even remotely ruled out, let alone supersymmetry as a whole. Although there is no direct evidence for weak-scale supersymmetry yet, MSSM models with e.g. >2 TeV gluino and squark masses, and even a large space of pMSSM models with these masses below 1 TeV, are completely consistent with all experiments thus far, though not immediately falsifiable. | {
"domain": "physics.stackexchange",
"id": 80775,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, supersymmetry, beyond-the-standard-model, large-hadron-collider, mssm",
"url": null
} |
long-short-term-memory, objective-functions, pytorch, learning-curve
def forward(self, question, length):
B = length.size(0)
embed = self._wemb(question)
hidden = self._lstm(embed)[0][length-1, torch.arange(B)]
return self._final(hidden) It turns out that the zig-zag pattern is an inherent effect of using a word embedding layer. I don't fully understand the phenomenon, but I believe it has a strong correlation with the embeddings acting as a sort of memory slots, which can change relatively quickly, and the LSTM generating a summary of the sequence, so that the model can remember past combinations.
I found this plot of a training loss curve of word2vec and it exhibits the same per-epoch pattern. | {
"domain": "ai.stackexchange",
"id": 1283,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "long-short-term-memory, objective-functions, pytorch, learning-curve",
"url": null
} |
ros, navigation, ros-kinetic, pgm, amcl
Originally posted by bob-ROS with karma: 525 on 2020-06-10
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by kopop8 on 2020-06-10:
Thanks for the quick answer! So it's not a good idea to edit a map and draw aisles in a big empty room for example?
Comment by bob-ROS on 2020-06-10:
I will make it worse for sure, but you can circumvent this problem by just having the edited map being used for the path planning, while the original being just by AMCL for localization.
Comment by kopop8 on 2020-06-10:
Thank you so much!! I will do that! :)
Comment by bob-ROS on 2020-06-10:
To be more specific: the /map topic is generally used for the AMCL map as well as the occupancy grid for the global costmap's static layer. Create an additional map server so you have e.g. /map_edited that the layers subscribes to instead. | {
"domain": "robotics.stackexchange",
"id": 35093,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, navigation, ros-kinetic, pgm, amcl",
"url": null
} |
quantum-mechanics, optics, quantum-information, quantum-optics, quantum-computer
Title: What optical element can you use to implement a square root of NOT gate How do you implement a square root of NOT gate in an optical quantum computing circuit? What optical element or combination of elements would you use - especially, if you want to manipulate polarization qubits?
The square root of not gate has the following matrix representation:
$$ \sqrt{X} = \sqrt{NOT} = \frac{1}{2} \begin{bmatrix} 1+i & 1-i \\ 1-i & 1+i \end{bmatrix}. $$ For a polarization qubit, you need to rotate the polarization. This is done with a waveplate. A $\lambda/2$ plate implements a NOT gate. Thus, a $\lambda/4$ plate will implement a square root of the NOT gate. | {
"domain": "physics.stackexchange",
"id": 80129,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, optics, quantum-information, quantum-optics, quantum-computer",
"url": null
} |
organic-chemistry, carbohydrates
Whereas compounds in the inositol family fit the molecular formula requirement, but are not considered to be sugars because they are incapable of forming a carbonyl. | {
"domain": "chemistry.stackexchange",
"id": 1940,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, carbohydrates",
"url": null
} |
Combinatorics Example Problem
Ten weight lifters are competing in a team weightlifting contest. Of the lifters, 3 are from the United States, 4 are from Russia, 2 are from China, and 1 is from Canada.
Part 1
If the scoring takes account of the countries that the lifters represent, but not their individual identities, how many different outcomes are possible from the point of view of scores?
This part I understand: 10! / [ 3! 4! 2! ] = 12,600
Part 2 (don't understand this part)
How many different outcomes correspond to results in which the United States has 1 competitor in the top three and 2 in the bottom three?
This part I'm confused. Here you have 10 slots.
The first three slots must be of some order: US, US, or [Russia, China, Canada].
The last three slots must be of some order US, [Russia, China, Canada], [Russia, China, Canada].
I thought the answer would be this: $\binom{3}{2} \binom{1}{1} * \frac{7!}{4!\ 3!\ 2!}$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303443461076,
"lm_q1q2_score": 0.8353129799535567,
"lm_q2_score": 0.8438951025545426,
"openwebmath_perplexity": 336.420611191182,
"openwebmath_score": 0.7334111332893372,
"tags": null,
"url": "http://math.stackexchange.com/questions/366920/combinatorics-example-problem"
} |
signal-analysis, continuous-signals, cross-correlation, correlation
timeseries | {
"domain": "dsp.stackexchange",
"id": 6336,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, continuous-signals, cross-correlation, correlation",
"url": null
} |
python, neural-network, tensorflow, regression
spfnet = get_spfnet()
#spfnet.summary()
hist = spfnet.fit(X_train, y_train, batch_size=32, epochs=250, verbose=2)
the accuracy and loss graphs are:
plt.plot(hist.history['calc_accu'])
plt.title('Model Accuracy')
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.show()
plt.plot(hist.history['root_mean_squared_error'])
plt.title('Model error')
plt.xlabel('Epochs')
plt.ylabel('error')
plt.show()
after 50 epochs nothing seems to improve, neither curve seems to overfit on the data
I tried other models like reducing layers and removing kernel regularizes, using
kernel_initlizers='normal' and 'he-normal' | {
"domain": "datascience.stackexchange",
"id": 8359,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, neural-network, tensorflow, regression",
"url": null
} |
Number of positive integers $\le n$ with different digits.
An integer $m$ is acceptable iff in it's decimal representation all digits are different. For example $9876543210$ is the largest acceptable integer. For each $n\in \Bbb N$, $\theta(n)$ is the number of all acceptable positive integers not greater than $n$.
Is there a simple formula for $\theta(n)$? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305339244013,
"lm_q1q2_score": 0.8047632515563247,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 863.9021533569648,
"openwebmath_score": 0.6532816886901855,
"tags": null,
"url": "http://math.stackexchange.com/questions/332364/number-of-positive-integers-le-n-with-different-digits/332702"
} |
php, html, validation, form
there is no HTML output, so it makes no sense convert html characters.
empty spaces do no harm whatsoever
stripslashes always has been useless in the business of preventing any malicious use, while nowadays it's absolutely useless at all
I don't know what harm could be done to the code like this - may be it's better to ask on the security-related site of the network. May be it would be useful to check the input data length and to validate the email address.
Validation
Is another matter. You could validate the email address, so it won't allow a bogus email. Same goes for the date - whether it is correct and could be understood.
But, as it was said before, it's entirely up to you, whether to bother with validation or not. | {
"domain": "codereview.stackexchange",
"id": 32112,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, html, validation, form",
"url": null
} |
go
Compare arrays ([16]byte)
As a variation of the previous solution, we will use arrays to do the comparison as arrays are comparable.
Since makeHash() already returns an array [16]byte, we only need to get the raw bytes of the text checksum into an array. The simplest and fastest is to create an array [16]byte, and pass such a slice to hex.Decode() that shares its backing array with our new array. We can obtain such a slice by simply slicing the array:
checkSum = bytes.TrimSpace(checkSum)
dst := [16]byte{}
if _, err := hex.Decode(dst[:], checkSum); err != nil {
// Invalid input, not hex string or not 16 bytes!
} else {
if makeHash(flag.Arg(0)) == dst) {
// They match
} else {
// They don't match
}
} | {
"domain": "codereview.stackexchange",
"id": 16648,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "go",
"url": null
} |
thermodynamics, entropy, information
$$
So we have
$$
1\,\mathrm{bit} = \ln 2\,\,\mathrm{nat},
$$
and therefore
$$
1\,\mathrm{bit} = k_B\ln 2\,JK^{-1} \approx 9.57\times 10^{-24} JK^{-1}.
$$
You will see this conversion factor, for example in Landauer's principle, in which erasing one bit requires $k_B T \ln 2$ joules of energy. This is really just saying that that deleting a bit (and therefore lowering the entropy by one bit) requires raising the entropy of the heat bath by one bit, or $k_B \ln 2$. For a heat bath of temperature $T$ this can be done by raising its energy by $k_B T \ln 2\,\, J$. | {
"domain": "physics.stackexchange",
"id": 45415,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, entropy, information",
"url": null
} |
do we need each in analyzing data? Statistics deals with the analysis of data; statistical methods are developed to analyze large volumes of data and their properties. Outliers may represent erroneous data or may suggest unforeseen circumstances and should be carefully considered when interpreting data. 0 H�ĔOk1���stK=ь�Ҫ��1�P�B��qJ MATLAB image processing codes with examples, explanations and flow charts. The Mean, Median and Mode are the three measures of central tendency. MEAN,MEDIAN,MODE Statistical methods are used by various organizations and governments to calculate a collaborative property about employees or people; such properties then influence the decisions taken by the organizations and governments. In order to read or download mean median mode standard deviation chapter 3 ebook, you need to create a FREE account. Variation or Spread of Distributions Measures that indicate the spread of scores: Range Standard Deviation . e. Interval Scale Data. The measure of central | {
"domain": "ajret.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812327313545,
"lm_q1q2_score": 0.8360922418081328,
"lm_q2_score": 0.8633916205190225,
"openwebmath_perplexity": 1227.6743972839017,
"openwebmath_score": 0.6617577075958252,
"tags": null,
"url": "https://ajret.org/patricia-hamilton-hxhzy/475500-mean%2C-median%2C-mode-standard-deviation-pdf"
} |
homework-and-exercises, newtonian-mechanics, forces, statics
$W$, $H$, $x$, $y$ and $D$ are given. To find the forces on each leg, as far as I remember, I have to consider two general equations:
$\sum F=0$ and $\sum M=0$. So I have:
$$
F_1 + F_2 + F_3 + F_4 - D = 0
$$
Also, considering the moments round the point $F_1$:
$$
W(F_2+F_3) - xD = 0
$$
$$
H(F_3+F_4) - yD = 0
$$
But this just give me 3 equations! I missing one more equation and cannot figure it out. This looks like a simple linear blending problem. It is two-dimensional, but each dimension can be considered independently.
The more to the right the weight is, the larger the fraction of it carried by F2 and F3. Basically, the fraction of the weight carried by F2 and F3 is X/W. Put more mathematically:
(F2 + F3) / (F1 + F2 + F3 + F4) = X / W
The same can be done for the Y direction. | {
"domain": "physics.stackexchange",
"id": 7870,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, forces, statics",
"url": null
} |
ros, ros-melodic, ros-kinetic, buildfarm
Thus if you're saying it something that deserves to be versioned separately then it probably deserves to be released separately so it can be relied upon being available and consistent.
There is the escape valve of checking out the content inside your tests but that still is fragile and requires network connectivity and the availability of git and other tools which would need to be added as test depends
Comment by tfoote on 2020-06-02:
To be clear we're well beyond the scope of the original question, but I'm communicating why not adding this "extra" functionality was a design decision, because it's asking the maintainers to do a little extra work (maintain and release your testing resources). However it will then significantly increase the meaningfulness of the test results. Any regressions are traceable to releases into the rosdistro. And testing resources are known not to conflict.
Comment by gvdhoorn on 2020-06-03:
I appreciate the additional explanation. | {
"domain": "robotics.stackexchange",
"id": 35036,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-melodic, ros-kinetic, buildfarm",
"url": null
} |
general-relativity, spacetime, terminology, soft-question, closed-timelike-curve
Title: Confused on the types of solutions to Einstein field equations in General Relativity Context
While reading about the types of solutions to The Einstein Field Equations in General Relativity, I came across the following article.
Where they explain that Karl Schwarzschild provided the first Exact solution to the Einstein field equations in General Relativity.
I have 2 questions. They are both very closely related so I thought it would be appropriate to include both in this 1 post.
2 questions
What is the difference between a non-exact and a exact solution to the Einstein Field Equations in General Relativity?
Are the Schwarzschild metric and Schwarzschild solution the same thing? | {
"domain": "physics.stackexchange",
"id": 91545,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, spacetime, terminology, soft-question, closed-timelike-curve",
"url": null
} |
electrons, superconductivity, kinetic-theory
In a superconductor below the critical temperature, electrons form Cooper pairs that behave like bosons and condensate to the same ground state, just like the (bosonic) atoms of $^4$He during at the superfluid transition. Indeed, Cooper pairing is the mechanism responsible for the superfluidity of $^3$He, whose atoms are fermionic.
However, a classical models based on collisions is absolutely inadequate to explain the property of both a superconductor and a superfluid, and a quantum mechanical treatment is necessary. | {
"domain": "physics.stackexchange",
"id": 41965,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrons, superconductivity, kinetic-theory",
"url": null
} |
c#, object-oriented, game, hangman
Then the name "status" makes sense
public GameStatus Status { get; private set; }
One empty line between type declarations (between the two classes), between field declarations and constructors/methods and between methods/constructors enhances readability.
lines like Console.WriteLine(Game1.attemptchar(char.Parse(Console.ReadLine()))); are compact but often difficult to read. Using a temporary variable gives you the opportunity to use descriptive names for intermediate results:
char attempt = Char.Parse(Console.ReadLine());
string message = game.AttemptCharacter(attempt);
Console.WriteLine(message); | {
"domain": "codereview.stackexchange",
"id": 41341,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, object-oriented, game, hangman",
"url": null
} |
java
private final long timeOffsetInDays;
ProductValuesBuilderFacade(long timeOffsetInDays) {
this.timeOffsetInDays = timeOffsetInDays;
}
abstract ProductValuesDto setValueTo(
ProductValuesDto builder, BigDecimal bigDecimal);
public LocalDate getStartDate(LocalDate endDate) {
return endDate.minusDays(timeOffsetInDays);
}
} | {
"domain": "codereview.stackexchange",
"id": 37679,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
dimensional-analysis, point-particles
Title: How does relativity dimensional contraction affect point like particles such as the electron and neutrino? I might be misunderstanding a basic concept here, so forgive me. I know that the faster an object gets, the more it's dimensions will contract according to the following equation:
$${1\over D} = 1-{V^2\over C^2} $$
For point-like particles, how does this relationship behave? We can surely halt the motion of an electron, and quickly speed it up to near the speed of light, but does it's dimensions or any other of it's attributes change at all? The proper formula for length contraction is: $$l=\frac{l_0}{\sqrt{1-v^2/c^2}}$$
Where $l$ is the measured length in the moving frame and $l_0$ is the rest length of the object. If $l_0=0$ you can see immediately that $l=0$. There is no length contraction for objects with no length. | {
"domain": "physics.stackexchange",
"id": 53308,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dimensional-analysis, point-particles",
"url": null
} |
python, flask, client, raspberry-pi, cryptocurrency
Your multiplexer class and everything to do with it could go into multiplexer.py. oled() into display.py and the price and coin class could go into currency.py -which I am sure could have a better name .... You might even be able to get by with just putting multiplexer.py, display.py, and currency.py in with myscript.py instead of in a separate package. | {
"domain": "codereview.stackexchange",
"id": 27374,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, flask, client, raspberry-pi, cryptocurrency",
"url": null
} |
units, integration, dimensional-analysis, calculus
Title: Check dimensions of the integral of a function I and a colleague are arguing about the dimensions of:
$$\int_0^x f(x) dx $$
in this particular case $[f(x)]=m^2/s^3$ and $[x]=m$.
Does it follow that $[\int_0^x f(x) dx]=m^2/s^3$ or $[\int_0^x f(x) dx]=m^2/s^3m$? It will be the latter case, $m^2/s^3m$ which is just $m^3/s^3$.
Remember that the integral is the sum of all the products $f(x)\;\text{times}\; dx$. $dx$ is a tiny piece of the path from $0$ to $x$, so it is in units of $m$ as well. Each of the products $f(x)dx$ have units $m^3/s^3$, and the sum of all these products keeps those units. | {
"domain": "physics.stackexchange",
"id": 31317,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "units, integration, dimensional-analysis, calculus",
"url": null
} |
sin(theta) = a / c. csc(theta) = 1 / sin(theta) = c / a. cos(theta) = b / c. sec(theta) = 1 / cos(theta) = c / b. tan(theta) = sin(theta) / cos(theta) = a / b.
Is cos 𝑥𝑥+ 𝑦𝑦= cos 𝑥𝑥+ cos 𝑦𝑦and sin 𝑥𝑥+ 𝑦𝑦= sin 𝑦𝑦+ sin 𝑦𝑦? Try with some known values: cos 𝜋𝜋 6 + 𝜋𝜋 3 = cos 𝜋𝜋 6 + cos 𝜋𝜋 3 cos 3𝜋𝜋 6 = cos 𝜋𝜋 6 The sum-to-product trigonometric identities are similar to the product-to-sum trigonometric identities. The basic sum-to-product identities for sine and cosine are as follows: Free trigonometric identities - list trigonometric identities by request step-by-step This website uses cookies to ensure you get the best experience. By using this website, you agree to our Cookie Policy.
## You only need to memorize one of the double-angle identities for cosine. The other two can be derived from the Pythagorean theorem by using the identity s i n 2 (θ) + c o s 2 (θ) = 1 to convert one cosine identity to the others. s i n (2 θ) = 2 s i n (θ) c o s (θ) | {
"domain": "firebaseapp.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211582993982,
"lm_q1q2_score": 0.820629450605706,
"lm_q2_score": 0.8418256452674009,
"openwebmath_perplexity": 1266.653268836124,
"openwebmath_score": 0.8532515168190002,
"tags": null,
"url": "https://podnikanieiefn.firebaseapp.com/1805/65455.html"
} |
supernova, magnetic-field, cosmic-ray
Magnetic flux is conserved, so as the core of a massive star collapses, the flux is not lost, but becomes concentrated in the relatively tiny volume of the neutron star. This can start a magnetohydrodynamic dynamo, in which heat and rotational energy of the neutron star (both of which are intense) cause enormous flows of electrically conducting material in the star and consequently enormous eddies of electricity, generating a magnetic field. The field then acts to maintain the flow of electricity and the system is stable as long as it can be powered by the rotation and heat of the star.
So the key points. A collapsing star keeps its magnetic field and concentrates it. The magnetic field of a neutron star can generate a dynamo that further intensifies the field. Neutron stars are extreme objects with extreme properties. | {
"domain": "astronomy.stackexchange",
"id": 6772,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "supernova, magnetic-field, cosmic-ray",
"url": null
} |
quantum-mechanics, homework-and-exercises, density-operator, trace
Title: Trace of density matrix for mixed state $\DeclareMathOperator{\Tr}{Tr}$On page 5 of this online document, it states a seemingly trivial fact: that if we have a density-matrix for a mixed state defined by
$$\hat{\rho}=\sum_kp_k|\psi_k\rangle\langle\psi_k|$$
where $\{|\psi_k\rangle\}$ are (not-necessarily orthogonal) pure states, then we have the following double-sided implication:
$$\Tr (\hat{\rho})=1~~~\iff~~~\sum_kp_k=1$$
This seems intuitively clear to me, but when I try to go from the left-side to the right-side I get stuck. Here's what I mean:
$$\begin{align}
\Tr(\hat{\rho})&=\sum_m \langle\psi_m| \hat{\rho }| \psi_m \rangle \\
&=\sum_{m} \langle\psi_m|\left(\sum_k p_k|\psi_k\rangle\langle\psi_k|\right)| \psi_m \rangle\\
&=\sum_k p_k \sum_m |\langle \psi_m |\psi_k\rangle |^2
\end{align}$$ | {
"domain": "physics.stackexchange",
"id": 34915,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, density-operator, trace",
"url": null
} |
general-relativity, gravity, mass, equivalence-principle
small clutch of axioms: (1) Spacetime is a metrical manifold, (2) a body feeling no interaction follows geodesics in this manifold and (3) the Einstein field equations and relevant boundary conditions define the metric that arises from matter distributions. Misner, Thorne and Wheeler in their book "Gravitation" do the same (or rather, they replicate Élie Cartan's treatment) for Newtonian Gravity, i.e. show how to describe Newtonian gravity as a local, geometrical theory and it becomes monstrously complicated compared to GTR in this form. | {
"domain": "physics.stackexchange",
"id": 25535,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, mass, equivalence-principle",
"url": null
} |
noise, snr, channelcoding, forward-error-correction, amplitude-modulation
(since I wrote that answer): The answer there and Matt's comment assume your receiver is fixed, your question is about designing the receiver system, so these answers do not concern the same thing :) Context really matters! You're "shopping" statements and definitions from different contexts, and that's really just going to confuse you, if you don't understand their background. | {
"domain": "dsp.stackexchange",
"id": 11175,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "noise, snr, channelcoding, forward-error-correction, amplitude-modulation",
"url": null
} |
• Magoosh Test Prep Expert June 26, 2016 at 4:28 am #
Hi Bhavna 🙂
In that example, the prompt states that “N is not an odd integer.” This is not the same as saying that N is an even integer. N could be an even integer, but N could also be a decimal or fraction, since decimals and fractions are not odd integers. I hope this clears things up 🙂
• Bhavna Sharma June 27, 2016 at 8:25 am #
Thank you so much.. 🙂 I missed this point.
6. Lars July 30, 2012 at 4:55 am #
Hi Chris,
In your explanation to the 1st question, in the 2nd last sentence you wrote
“So no matter what number you plug in Column A will always be negative, Column B positive.” Isn’t this the exact opposite because Column A wiil be positive and column B will be negative?
I got confused the first time I read this.
7. Sammy May 30, 2012 at 3:54 pm # | {
"domain": "magoosh.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986777180191995,
"lm_q1q2_score": 0.8691504631037189,
"lm_q2_score": 0.8807970842359876,
"openwebmath_perplexity": 870.2008954426768,
"openwebmath_score": 0.5819680094718933,
"tags": null,
"url": "https://magoosh.com/gre/quantitative-comparison-the-relationship-cannot-be-determined-from-the-information-given-answer-choice/"
} |
# Finding a function from its tangent lines
The general problem I am interested in is finding a function (preferably analytical) when given the set of all of its tangent lines or, in other words, when given all equations of the tangent lines. I would imagine that this would be difficult with an arbitrary set of tangent lines. I wanted to know if this type of problem has been studied in any detail and references to it if possible.
Edit
I decided to improve my question by giving context and a specific problem from which my question arose.
While my friend and I were drawing on the whiteboard the other day, my friend drew something that looked like this (here is the link to the graph online if you would like to see how I did it) : | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9683812354689081,
"lm_q1q2_score": 0.8230961335160091,
"lm_q2_score": 0.8499711718571774,
"openwebmath_perplexity": 112.30978994815075,
"openwebmath_score": 0.720454752445221,
"tags": null,
"url": "https://math.stackexchange.com/questions/1948138/finding-a-function-from-its-tangent-lines"
} |
python, kivy
for key in self.text_input_dict:
self.text_input_dict[key].text = ''
if os.path.exists(os.path.join(os.getcwd(), TagEditor.constants.default_tag_cover)):
self.image_cover_art.source = TagEditor.constants.default_tag_cover
self.image_cover_art.reload()
else:
self.image_cover_art.clear_widgets()
TagEditor.FILE_OPENED = False
self.to_delete.cleanup()
self.to_delete = tempfile.TemporaryDirectory()
def file_open(self, _: Button) -> None:
"""
Opens a Windows file open dialog.
It will use '.mp3' extension for file types
:param _:
:type _:
:return:
:rtype:
"""
# True, None for fileopen and False, File_Name for filesave dialog
self.reset_widgets(None)
file_dialog = CreateFileDialog(True, ".mp3", None, 0, "MP3 Files (*.mp3)|*.mp3", None)
file_dialog.DoModal() | {
"domain": "codereview.stackexchange",
"id": 35597,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, kivy",
"url": null
} |
quantum-field-theory, particle-physics, mass, renormalization
Title: Are the rest masses of fundamental particles certainly constants? In particular I am curious if the values of the rest masses of the electron, up/down quark, neutrino and the corresponding particles over the next two generations can be defined as constant or if there is an intrinsic uncertainty in the numbers. I suppose that since there is no (as of yet) mathematical theory that produces these masses we must instead rely on experimental results that will always be plagued by margins of error. But I wonder does it go deeper than this? In nature do such constant values exist or can they be "smeared" over a distribution like so many other observables prior to measurement? (Are we sampling a distribution albeit a very narrow one?) Does current theory say anything about this? (i/e they must be constant with no wiggle room vs. no comment) | {
"domain": "physics.stackexchange",
"id": 1328,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, particle-physics, mass, renormalization",
"url": null
} |
javascript, performance, jquery
Note: tabmenu has a closing tag, tab does not and will contain all text until the next tab or until the closing [/tabmenu].
Result:
[h]Tab1[/h]Tab1 Text
[h]Tab2[/h]Tab2 Text
h turn into headlines, just as in HTML and force a linebreak.
As the tabmenu does not only support tabs, but also subtabs, here is the second example:
Original BB-Code:
[tabmenu]
[tab=Tab1]
[subtab=Subtab11]Subtab11 Text
[subtab=Subtab12]Subtab12 Text
[tab=Tab2]
[subtab=Subtab21]Subtab21 Text
[/tabmenu]
Note: If you have subtabs in you tabmenu, you can't write text into tab areas. Apart from that subtabs behave like tabs when getting their content.
Result:
[h]Tab1[/h]
[spoiler=Subtab11]Subtab11 Text
[/spoiler][spoiler=Subtab12]Subtab12 Text
[/spoiler][h]Tab2[/h]
[spoiler=Subtab21]Subtab21 Text
[/spoiler] | {
"domain": "codereview.stackexchange",
"id": 17916,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, performance, jquery",
"url": null
} |
electromagnetic-radiation
Like a machine invented by Nikola Tesla?
What machine? We can bend light with lenses or via diffraction. And light can "bend by itself", see this article. Or we can "tie light in knots" see this article. You might say none of these really count, but the bottom line is that light can and does change direction, and at the root of it there's some kind of fundamental force at work.
and that machine actually bends em waves and makes any thing behind it invisible...
There's various reportage of "cloaking", such as this.
can any force field bend em waves??
Yes. And the Faraday effect rotates them. But perhaps what you're looking for here is pair production. It take only 511keV worth of electromagnetic energy to bend a photon into a closed "spinor" path. After which you can perform electron diffraction to demonstrate the wave nature of matter, or annihilation with the positron to reverse the process. Whereupon the electromagnetic energy resumes its linear path. | {
"domain": "physics.stackexchange",
"id": 27654,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation",
"url": null
} |
to as the heat equation. Polar coordinates. 2 Single Equations with Variable Coefficients The following example arises in a roundabout way from the theory of detonation waves. The 2D Heat Equation Here is a DPGraph of the solution to the heat equation on the square with fixed temperature u=0 on the boundary, and initial condition u(x,y,0) = 1. The maximum heat flux calculated by the 1D method was underestimated by 60% than that calculated by 2D filter solution, indicating that the lateral heat transfer cannot be ignored. Introduction ∆ in a Rotationally Symmetric 2d Geometry Separating Polar Coordinates The Equation ∆u=k ∂u ∂t 1. 5 [Nov 2, 2006] Consider an arbitrary 3D subregion V of R3 (V ⊆ R3), with temperature u(x,t) defined at all points x = (x,y,z) ∈ V. This calculator can be used to convert 2-dimensional (2D) or 3-dimensional rectangular coordinates to its equivalent spherical coordinates. Answers and Replies Related Special and General Relativity News on Phys. The regions of | {
"domain": "clodd.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.990874360724436,
"lm_q1q2_score": 0.8382226737020003,
"lm_q2_score": 0.845942439250491,
"openwebmath_perplexity": 860.6210905666301,
"openwebmath_score": 0.8832836747169495,
"tags": null,
"url": "http://rlle.clodd.it/2d-heat-equation-in-polar-coordinates.html"
} |
So, $$2I=\int_0^\pi (\sin x + \sin x \cos x)dx+\int_0^\pi (\sin x - \sin x \cos x)dx=2 \int_0^\pi\sin xdx$$
So, $$I=\int_0^\pi\sin xdx=(-\cos x)|_0^\pi=-\cos\pi-(-\cos 0)=2$$
Alternatively, $$\int_0^\pi (\sin x + \sin x \cos x)dx=\int_0^\pi \left(\sin x +\frac{\sin2x}2\right)dx=\left(-\cos x -\frac{\cos2x}4\right)_0^\pi$$
$$=\left(\cos x +\frac{\cos2x}4\right)_\pi^0=\cos0+\frac{\cos0}4-\left(\cos\pi+\frac{\cos\pi}4\right)=1+\frac14-\left(-1+\frac14\right)=2$$
In fact, $\int_0^\pi\sin2xdx=\int_0^{2\pi}\sin ydy=(-\cos y)_0^{2\pi}=1-1=0$
You lost the first summand there.
$$2\int_0^\pi \sin x + \sin x \cos x\,dx = 2\int_0^\pi \sin x\,dx + 2\int_0^\pi \sin x \cos x\,dx$$ Now integrate both summands separately; you don't need to substitute in the first.
• Even if you are in a class and there is a current subject, you should be ready to use other techniques, or you should realize that the current subject applies only partially. – Eric Jablow Apr 5 '13 at 1:16 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971129090546975,
"lm_q1q2_score": 0.838464705566129,
"lm_q2_score": 0.8633916064586998,
"openwebmath_perplexity": 384.6368099062866,
"openwebmath_score": 0.8714040517807007,
"tags": null,
"url": "https://math.stackexchange.com/questions/350936/2-int-0-pi-sin-x-sin-x-cos-x-dx-where-am-i-going-wrong"
} |
java, game, javafx, snake-game
Don't System.exit(0)! Display some useful message to your user. The pattern I'll advocate that you use (mentioned above, more detail later) will make this easy.
How you check for collisions is strange. I'm imagining an API that is much clearer and separates concerns better. Give snake two methods intersectSelf and intersect(Apple a). This way only a snake decides what these mean. And if you need to check these multiple times, you don't have to duplicate the "head is touching a part of the body" logic.
I don't like how UserInput has a head and map. Ideally it should have some internal state indicating the last direction pushed and one getter (getDirection) that is used by the game loop (more on that below). It should definitely not have all of the logic of moving the snake! That should be the responsibility of Snake.
Why SNAKE_SPEED in Driver? What units is it in?
.getUser().getHead() is everywhere in your code. That should be a sign that some refactoring is necessary. | {
"domain": "codereview.stackexchange",
"id": 33949,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game, javafx, snake-game",
"url": null
} |
ros2, ros-crystal
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h: In instantiation of ‘bool testing::internal::AnyEq::operator()(const A&, const B&) const [with A = unsigned int; B = int]’:
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h:908:18: required from ‘bool testing::internal::ComparisonBase<D, Rhs, Op>::Impl<Lhs>::MatchAndExplain(Lhs, testing::MatchResultListener*) const [with Lhs = const unsigned int&; D = testing::internal::EqMatcher<int>; Rhs = int; Op = testing::internal::AnyEq]’
/home/eepp/turtlebot3_ws/src/cartographer/cartographer/cartographer/io/serialization_format_migration_test.cc:120:1: required from here
/usr/src/googletest/googlemock/include/gmock/gmock-matchers.h:204:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool operator()(const A& a, const B& b) const { return a == b; }
~~^[[User:Edc|Edc]] ([[User talk:Edc|talk]])
--- | {
"domain": "robotics.stackexchange",
"id": 33433,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-crystal",
"url": null
} |
c++, parsing, c++17, compiler
It's kinda weird to use a generic lambda here:
m_NamesToNodes.emplace(nodeName, [](auto&& block, auto const& body, auto&& tokens, auto parent) {
auto node = std::make_shared<TNode>(std::forward<decltype(block)>(block), body, std::forward<decltype(tokens)>(tokens), parent);
node->parse();
return node;
});
I guess the generic lambda is to get perfect forwarding working, but it's a bit confusing.
As above, the specification of std::string&& and std::vector<std::string>&& unnecessarily require r-value references, which isn't ideal.
std::string_view m_InnerBody; | {
"domain": "codereview.stackexchange",
"id": 35935,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, parsing, c++17, compiler",
"url": null
} |
vba, excel
'Save for Navigation
ActiveWorkbook.SaveAs PathWorkbook & ProjectName & "\NAV\" & ProjectName & "_Step_1.exp", FileFormat:=52
ActiveWorkbook.SaveAs PathWorkbook & ProjectName & "\" & ProjectName & ".exp", FileFormat:=52
ActiveWorkbook.SaveAs PathWorkbook & ThisWorkBookName, FileFormat:=52
Call PageVisibility(2)
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
'Unload Animated
Sheets("LOTEVAL").Activate
wsCon.Activate
End Sub
Sub ErrorProcessing()
Dim WSActual As Worksheet, WSError As Worksheet
Dim k As Integer, tempvar As Variant
Dim wsCon As Worksheet, wsLot As Worksheet, wsReg As Worksheet, wsErr As Worksheet
Set wsCon = Sheets("CONTROL")
Set wsLot = Sheets("LOTS")
Set wsReg = Sheets("REGISTER")
Set WSActual = ActiveSheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual | {
"domain": "codereview.stackexchange",
"id": 38982,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "vba, excel",
"url": null
} |
geophysics, atmosphere, ocean
$$ M_{\mathrm{atm}_\bigoplus} \approx \frac{4\pi R^2_{\scriptscriptstyle \bigoplus} P_{\mathrm{sea\,level}}}{g_{_\bigoplus}} $$ Plugging in actual numbers, $$ M_{\mathrm{atm}_\bigoplus} \approx \frac{(12.6) \,\,(6.4 \times10^6\mathrm{m})^{\textstyle 2} \,(1.01\times10^5 \mathrm{kg}\,\,\mathrm{m}^{-1}\mathrm{s}^{-2})}{(9.8\,\mathrm{ms}^{-2})} \approx \underline{\mathbf{5.3 \times 10^{18}\,kg}} $$ or about 58 quadrillion American tons. | {
"domain": "earthscience.stackexchange",
"id": 602,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "geophysics, atmosphere, ocean",
"url": null
} |
algorithms, time-complexity, search-algorithms, sorting
Sort all the $\{a_i,b_i\}$ together. Call the resulting sequence $(x_1,\ldots,x_{2n})$.
Set $n_a\gets0$, $n_b\gets0$.
Loop for $n_b$: For $t$ going from $1$ to $2n$ do:
If $x_t=b_i$ for some $i$, increment $n_b$
Else if $x_t=a_j$ for some $j$, set $L_j\gets n_b$
Loop for $n_a$: For $t$ going from $2n$ down to $1$ do:
If $x_t=a_i$ for some $i$, increment $n_a$
Else if $x_t=b_j$ for some $j$, set $R_j\gets n_a$
Now for each interval $[a_i,b_i]$, $L_i$ and $R_i$ contain the number of intervals to its left and to its right, respectively
Final loop: For $i$ going from $1$ to $n$
If $L_i=R_i$, return $i$
Found nothing: Return null.
You might need to make some additional checks to take care of cases where $a_i=b_j$ for $i\not=j$.
Note that equality checks of the form $x_t=b_i$ can be done by saving the sorting indices. In other words, if you sort an array $u$ into another array $v$, you can save indices $\pi_t$ such that $u_t=v_{\pi_t}$. | {
"domain": "cs.stackexchange",
"id": 4917,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, time-complexity, search-algorithms, sorting",
"url": null
} |
How does the floating point implementation of the original recurrence get it so wrong? To see this, note that in the case of a small rounding error, the closed form expression for $x_n$ becomes $$x_n \approx \frac{3^{n+1}+5^{n+1}+\gamma_n 100^{n+1}}{3^n + 5^n + \gamma_n 100^n}$$ where $\gamma_n$ is a small number on the order of the machine epsilon. The numerator may be rewritten \begin{align*} 3^{n+1}+5^{n+1}+\gamma_n 100^{n+1} &= (100-97)3^n + (100-95)5^n + 100\gamma_n 100^n\\ &= 100(3^n + 5^n + \gamma_n 100^n) - 97\cdot 3^n - 95\cdot 5^n. \end{align*} This leads to an alternative expression for $x_n$: $$x_n = 100 - \frac{97\cdot 3^n + 95\cdot 5^n}{3^n + 5^n + \gamma_n 100^n} = 100 - \frac{95 + 97\left(\frac{3}{5}\right)^n}{20^n\gamma_n + 1 + \left(\frac{3}{5}\right)^n}.$$ If $\gamma_n=0$, the correct limit $\lim_{n\to \infty}x_n = 5$ is obtained. However, if $\gamma_n \ne 0$ the growing term $20^n\gamma_n$ in the denominator leads to the change in the limit to 100.
References | {
"domain": "scipython.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9919380084717284,
"lm_q1q2_score": 0.8063139861591561,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 2592.152663163523,
"openwebmath_score": 0.944542646408081,
"tags": null,
"url": "https://scipython.com/blog/mullers-recurrence/"
} |
performance, r
# change structure, convert to matrix
ii <- as.character(d[, id])
dm <- d
dm[[id]] <- NULL
dm <- as.matrix(dm)
rownames(dm) <- ii
your.powerset = function(s){
l = vector(mode = "list", length = 2^length(s))
l[[1]] = numeric()
counter = 1L
for (x in 1L:length(s)) {
for (subset in 1L:counter) {
counter = counter + 1L
l[[counter]] = c(l[[subset]], s[x])
}
}
return(l[-1])
}
psr <- your.powerset(ii)
psc <- your.powerset(colnames(dm))
sss <- lapply(psr, function(x) {
i <- ii %in% x
lapply(psc, function(y) dm[i, y, drop = F])
})
cn <- sapply(sss, function(x)
lapply(x, function(y) {
if (ncol(y) == 1) {
if (any(is.na(y))) return(NULL)
return(y)
}
isna2 <- matrixStats::colAnyNAs(y)
if (all(isna2)) return(NULL)
if (sum(isna2) == 0) return(NA)
r <- y[, !isna2, drop = F]
return(r)
})) | {
"domain": "codereview.stackexchange",
"id": 32783,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "performance, r",
"url": null
} |
reference-request, programming-languages, type-theory
Title: Categorisation of type systems (strong/weak, dynamic/static) In short: how are type systems categorised in academic contexts; particularly, where can I find reputable sources that make the distinctions between different sorts of type system clear?
In a sense the difficulty with this question is not that I can't find an answer, but rather that I can find too many, and none stand out as correct. The background is I am attempting to improve an article on the Haskell wiki about typing, which currently claims the following distinctions: | {
"domain": "cs.stackexchange",
"id": 293,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, programming-languages, type-theory",
"url": null
} |
quantum-mechanics, quantum-field-theory, hilbert-space, operators
The spectral theorem, as it is a mathematical fact, holds also in QFT. It does not matter if we do not know how the Hilbert space is made, it is sufficient to know that it is a Hilbert space and that the used operator is selfadjoint. Regarding operator valued distributions $\phi$, the spectral theorem applies to (usually the closures of) the images of these distributions $\phi(f)$ when they are selfadjoint operators.
If the theorem did not hold, then we would conclude that the space of states is not Hilbert or the operator is not selfadjoint (more generally normal). | {
"domain": "physics.stackexchange",
"id": 90273,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-field-theory, hilbert-space, operators",
"url": null
} |
neuroscience, vision, behaviour, neurophysiology, neuroplasticity
Title: How well does it actually work to surgically reroute the optical nerve? Two publications, Roe et al, 1992[1] and Metin & Frost, 1989[2], describe results pertaining to the ability of a region of cortex to process information from a different sensory mode than the one that it normally does.
Specifically, they describe studies in which:
input from the retinas of newborn rodents was rerouted, by
surgical methods, to parts of the cortex other than the visual;
the rodents were allowed to mature;
the responses of cortical cells in the new target region to visual stimuli were assess.
Now it's 20 years later, so I'm sure there have been many others.
Something of which these publications seem to make no mention is the behavior that developed in the test subjects. For example, did they appear to be completely blind from a behavioral standpoint?
Is anyone aware of any publication, relating to these studies or other, similar experiments, which addresses this question? | {
"domain": "biology.stackexchange",
"id": 4534,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "neuroscience, vision, behaviour, neurophysiology, neuroplasticity",
"url": null
} |
lowpass-filter, transfer-function, differential-equation
Title: Difference equation from a transfer function of a low pass filter I need to get the difference equation from this transfer function:
$H(z) = g \frac{1+a_1}{1+a_1z^-1}$
My math skills are too many years old, but I remember I need to get the Y(output) on one side and X (input) on the other:
$\frac{Y(z)}{X(z)} = g \frac{1+a_1}{1+a_1z^-1}$
But I don't remember where to go from here. $$
\begin{align*}
\frac{Y(z)}{X(z)}&=g\frac{1+a_1}{1+a_1z^{-1}} &\text{...given transfer function}\\
Y(z)(1+a_1z^{-1})&=X(z)g(1+a_1) &\text{...via cross multiplication}\\
Y(z)+a_1z^{-1}Y(z)&=g(1+a_1)X(z) &\text{...via distribution}\\
y[n]+a_1y[n-1]&=g(1+a_1)x[n] &\text{...via inverse z-transform}\\
y[n]&=g(1+a_1)x[n]-a_1y[n-1] &\text{...solve for y[n]}
\end{align*}
$$ | {
"domain": "dsp.stackexchange",
"id": 10649,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "lowpass-filter, transfer-function, differential-equation",
"url": null
} |
To make things even more complicated there are equations changing types from point to point, f.e. Tricomi equation
u_{xx}+xu_{yy}=0
\label{Tric}
which is elliptic as $x>0$ and hyperbolic as $x<0$ and at $x=0$ has a "parabolic degeneration". It is a toy-model describing stationary transsonic flow of gas.
My purpose was not to give exact definitions but to explain a situation.
2440
##### Home Assignment 2 / Re: problem 1 typo?
« on: September 29, 2012, 05:10:55 PM »
Consider this:
\begin{align*}
&u|_{t=0}=g(x),\\
&u_t|_{t=0}=h(x),\\
&u|_{x=0}=p(t)
\end{align*}
has a continuous solution if and only if $p(0)=g(0)$ (compatibility condition) but with the Neumann BC solution would be always $C$ (albeit not necessarily $C^1$. | {
"domain": "toronto.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676490318649,
"lm_q1q2_score": 0.8267367253797866,
"lm_q2_score": 0.8438950966654774,
"openwebmath_perplexity": 1595.50997811619,
"openwebmath_score": 0.7192527055740356,
"tags": null,
"url": "http://forum.math.toronto.edu/index.php?action=profile;u=4;area=showposts;start=2430"
} |
structural-analysis, building-design, reinforced-concrete
A beam, or a wall, usually is not a good candidate to carry shear friction, because the bars are essentially in tension, and the required development length may be well beyond the width of the beam/wall. The solutions could be
providing more smaller bars at the interface (with a shear key is preferred),
using higher strength concrete or steel,
utilizing the "excess reinforcement provision", that is providing more bars of the same size so the demand is less than the capacity ($As_{req} \lt As_{act}$)
using hooks (not preferred, as the hooked bars will increase the stiffness of the joint and draw bending)
rearrange the structural elements to reduce the load if member sizes can't be altered. | {
"domain": "engineering.stackexchange",
"id": 4587,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "structural-analysis, building-design, reinforced-concrete",
"url": null
} |
biochemistry, medicine, synthetic-biology, chirality
Nice article: http://wikibin.org/articles/chiral-life-concept.html
The question is if it is technologically possible to synthesize e.g. a chiral version of E. Coli?
Update: Wikipedia https://en.wikipedia.org/wiki/Chiral_life_concept First off, quick clarification: "chiral" simply means distinct from its mirror image. All current life is chiral, in that it is made up of molecules which have a "handedness". What you're asking about is life which is made up of molecules of the opposite handedness (which I'll term "mirror chiral").
Such a lifeform is theoretically possible - chemical and biological reactions and reaction rates are entirely the same between the two handednesses - presuming that all participants (substrates, products, catalysts, etc.) are flipped to the opposite chirality. A mirror chiral Jarek would look and function exactly like the normal chirality Jarek, although he would need to eat mirror chiral food instead of normal chirality food. | {
"domain": "biology.stackexchange",
"id": 6554,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, medicine, synthetic-biology, chirality",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.