text stringlengths 1 1.11k | source dict |
|---|---|
If the wall is one brick thick, what is the total number of bricks in the wall?
I am not getting the correct answer.
Is this an arithmetic sequence? . Yes!
. . . $$\displaystyle S_n\:=\: \tfrac{n}{2}\left(a_1 + a_n\right)$$
So that since there are 46 steps between the bottom and top steps. . No, there are 24 rows.
Counting from top, we have:
. . $$\displaystyle \begin{array}{|c||c|c|c|c|c|c|} \hline \text{Row} & 1 & 2 & 3 & 4 & \hdots & 24 \\ \hline \text{Bricks} & 3 & 5 & 7 & 9 & \hdots & 49 \\ \hline\end{array}$$
$$\displaystyle \text{So we have: }\:S_{24} \;=\;\tfrac{24}{2}(3 + 49) \:=\12)(52) \:=\:624$$
#### TchrWill
##### Full Member
0313phd said:
Problem: The number of bricks in the bottom row of a brick wall is 49. The next row up from the bottom contains 47 bricks, and each subsequent row contains 2 fewer bricks than the row immediately below it. The number of bricks in the top row is 3. If the wall is one brick thick, what is the total number of bricks in the wall? | {
"domain": "freemathhelp.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9820137931962462,
"lm_q1q2_score": 0.8649548688265246,
"lm_q2_score": 0.8807970670261976,
"openwebmath_perplexity": 470.81259756787233,
"openwebmath_score": 0.6251608729362488,
"tags": null,
"url": "https://www.freemathhelp.com/forum/threads/sequence-word-problem.70745/"
} |
cosmology, black-holes, event-horizon, cosmological-constant, anti-de-sitter-spacetime
Title: Negative $\Lambda$ FLRW spacetimes as infinite black holes? Consider the Friedmann equation:
$$H^2+\frac{k}{a(t)^2} = \frac{\Lambda}{3}+\frac{8 \pi}{3}\rho$$
and set the parameters for dust in either flat euclidean or open hyperbolic spatial slices with a negative cosmological constant: $\rho = \frac{\rho_0}{a[t]^3},\Lambda<0, k=0$ or $k=-1$. With that, the Friedman equation takes the forms:
$$H^2 = -\frac{|\Lambda|}{3}+\frac{8 \pi}{3}\frac{\rho_0}{a(t)^3}$$
$$H^2-\frac{1}{a(t)^2} = -\frac{|\Lambda|}{3}+\frac{8 \pi}{3}\frac{\rho_0}{a(t)^3}.$$ | {
"domain": "physics.stackexchange",
"id": 99234,
"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": "cosmology, black-holes, event-horizon, cosmological-constant, anti-de-sitter-spacetime",
"url": null
} |
java, regex, morse-code
But really, only optimize when you know that this is a performance hot spot.
Bug in translate(String).
I believe that translate(String) cannot process "". That's not very convenient. I'd actually call it a bug.
(I didn't test it, though - did I already ask where are the tests?)
This bug actually complicates the constructor MorseString unnecessarily.
Even if the case s.length() == 0 would need special treatment - then that's because of translate() and therefore responsibility of translate(), not the constructor. Checking s.length() in the constructor is misplaced responsibility.
Use meaningful names.
The parameter s in constructor MorseString is assigned to field codeString. Therefore it makes sense to name it codeString as well, not just s. String s is totally meaningless, whereas String codeString carries a lot of information. | {
"domain": "codereview.stackexchange",
"id": 11352,
"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, regex, morse-code",
"url": null
} |
One of the biggest problems in probability is stating the problem clearly. Either answer, your 1/2 or Dr. Anthony's 2/3, could be correct depending on how the problem is set up.
In this problem, a key factor in determining the probability is how the child and family are selected. When we say, "in a two-child family, one child is a boy," how did we select the child? The selection process makes a big difference in the final probability (or, as Dr. Anthony would say, in the "sample space" of the problem.)
We often comment that the exact words (and, too often, unstated assumptions) are essential in any probability problem. We have to be careful both in how we state the problem, and in how we read it. This problem, in particular, is very easy to either write or read wrongly (especially as it tempts us to state it in such a way that the answer will be unexpected).
First, this is how Phil is seeing it: | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676514063882,
"lm_q1q2_score": 0.8563051921217553,
"lm_q2_score": 0.8740772351648677,
"openwebmath_perplexity": 607.5123668502303,
"openwebmath_score": 0.6361656188964844,
"tags": null,
"url": "https://www.themathdoctors.org/frequently-questioned-answers-the-other-child/"
} |
-
@JoyeuseSaintValentin If you are interested why is true case 2, I can explain more (it is not hard to see why this is true) – user52188 Jan 12 '13 at 19:39
Quite generally, $$\left[ \begin{array}{c} x(t) \\ y(t) \end{array} \right] = \mathrm e^{tA}\begin{bmatrix} x(0) \\ y(0) \end{bmatrix},$$ where, by definition, $$\mathrm e^{tA}=\sum_{n=0}^{+\infty}\frac{t^n}{n!}A^n.$$ To compute $\mathrm e^{tA}$ in the case at hand, note that $A^2=4A$, hence $$\mathrm e^{tA}=I+\sum_{n=1}^{+\infty}\frac{t^n}{n!}4^{n-1}A=I+\frac{\mathrm e^{4t}-1}4A.$$ Hence, $$x(t)=\frac{\mathrm e^{4t}+1}2x(0)+(1-\mathrm e^{4t})y(0),$$ and $$y(t)=\frac{1-\mathrm e^{4t}}4x(0)+\frac{\mathrm e^{4t}+1}2y(0).$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668695588648,
"lm_q1q2_score": 0.8559183525495377,
"lm_q2_score": 0.8723473846343394,
"openwebmath_perplexity": 218.95279179963651,
"openwebmath_score": 0.9321116209030151,
"tags": null,
"url": "http://math.stackexchange.com/questions/276264/how-to-solve-simple-systems-of-differential-equations"
} |
python, pandas, data-cleaning
One can change these NaN to previous values by following simple loop:
tempval = 0 # a variable to store value temporarily
newy=[]
for x in newdf['y']:
if not pd.isnull(x): tempval = x
newy.append(tempval)
newdf['y'] = newy
The desired dataframe is obtained:
print(newdf)
id num time y
0 A 10 1 10.0
1 A 11 2 10.0
2 A 12 3 10.0
3 B 20 1 20.0
4 B 21 2 20.0
5 B 22 3 20.0
Actually, this question belongs to https://stackoverflow.com/ | {
"domain": "datascience.stackexchange",
"id": 3789,
"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, pandas, data-cleaning",
"url": null
} |
# Is the metric space of all the functions defined and bounded on a given set complete?
Let $S$ be a given non-empty set, and let $B(S)$ denote the metric space of all the bounded (real- or complex-valued) functions with set $S$ as domain, with the metric defined as follows: $$d(x,y) \colon= \sup_{s \in S} \left\vert x(s) - y(s) \right\vert \ \mbox{ for all } \ x, y \in B(S).$$ Is $B(S)$ a complete metric space?
If not, then can we impose any conditions on $S$ under which $B(S)$ does become complete?
My effort: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969713304754,
"lm_q1q2_score": 0.81750978667281,
"lm_q2_score": 0.8311430499496096,
"openwebmath_perplexity": 41.76424581029282,
"openwebmath_score": 0.9910762906074524,
"tags": null,
"url": "https://math.stackexchange.com/questions/1502225/is-the-metric-space-of-all-the-functions-defined-and-bounded-on-a-given-set-comp"
} |
visible-light, soft-question
(Sorry, I know next to nothing about Physics so please cut me some slack if I said anything naive/silly) If you have a mirror placed 100 lightyears from earth what you do now will be reflected in the mirror 100 years later. Another 100 years later the reflection reaches you. By looking into this mirror you could see 200 years into the past. The farther away the mirror, the farther back in time you can look. (practical limitations on the distance arise from the Hubble expansion, but this is another chapter). | {
"domain": "physics.stackexchange",
"id": 19372,
"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": "visible-light, soft-question",
"url": null
} |
kinematics, velocity, differentiation, speed, calculus
Title: Is there a difference between instantaneous speed and the magnitude of instantaneous velocity? Consider a particle that moves around the coordinate grid. After $t$ seconds, it has the position
$$
S(t)=(\cos t, \sin t) \quad 0 \leq t \leq \pi/2 \, .
$$
The particle traces a quarter arc of length $\pi/2$ around the unit circle. This means that the average speed of the particle is
$$
\frac{\text{distance travelled along the arc of the circle}}{\text{time}}=\frac{\pi/2}{\pi/2} = 1 \, .
$$
However, since the motion of the particle is circular, the distance travelled is not the same as the displacement. The displacement of the particle would be $\sqrt{2}$, and so the average velocity would be
$$
\frac{\text{straight line distance from initial position}}{\text{time}} = \frac{\sqrt{2}}{\pi/2} = \frac{2\sqrt{2}}{\pi} \text{ at angle of $\frac{3}{4}\pi$ with the positive $x$-axis} \, .
$$ | {
"domain": "physics.stackexchange",
"id": 75976,
"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": "kinematics, velocity, differentiation, speed, calculus",
"url": null
} |
Note if you had used your original idea of, I assume, the natural logarithm, it would just involve an extra factor by the change of logarithm base formula, i.e., $$\log_a{x} = \cfrac{\log_b{x}}{\log_b{a}}$$ to give in this case that $$\log_2{n} = \cfrac{\log_e{n}}{\log_e{2}}$$. Also, as I show, you would need to add the constant, not multiply by it. After that correction, this just results in an extra factor being used for $$\log_2{n}$$, plus you also have the $$\log_e{2}$$ factor, so it might change the $$k_2$$ constant you determine to use (but not necessarily the $$k_1$$ constant) and/or the value of $$N_1$$, as these values are not uniquely determined. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.965899570361222,
"lm_q1q2_score": 0.8584517382121116,
"lm_q2_score": 0.8887587949656841,
"openwebmath_perplexity": 150.20313641062296,
"openwebmath_score": 0.9265673160552979,
"tags": null,
"url": "https://math.stackexchange.com/questions/3134268/question-about-asymptotic-notation-with-logs-of-different-bases"
} |
optics, visible-light
Translucency (also called translucence or translucidity) is a super-set of transparency: it allows light to pass through, but does not necessarily (again, on the macroscopic scale) follow Snell's law; the photons can be scattered at either of the two interfaces where there is a change in index of refraction, or internally. In other words, a translucent medium allows the transport of light while a transparent medium not only allows the transport of light but allows for image formation [my emphasis] . The opposite property of translucency is opacity. Transparent materials appear clear, with the overall appearance of one color, or any combination leading up to a brilliant spectrum of every color. | {
"domain": "physics.stackexchange",
"id": 35061,
"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, visible-light",
"url": null
} |
algorithms, sorting
Title: Sort deck of cards with least no of moves We have n cards with each card numbered from 1 to n.
All cards are randomly shuffled but all cards are visible
We are allowed only operation MoveCard(n) which moves the card with value n to the top of the pile.
We need to sort the pile of cards with minimum number of MoveCard operations.
The brute force approach which i can think of is start with MoveCard(n), MoveCard(n-1), MoveCard(n-2).... MoveCard(1).
This approach will solve the problem in n MoveCard operations.
But can we optimize it.
For instance, If the input is like: 3 1 4 2
As per my approach:
4 3 1 2
3 4 1 2
2 3 4 1
1 2 3 4
MoveCard operations is 4.
But we can solve this problem with minimum number of moves:
Optimized solution is:
2 3 1 4
1 2 3 4
MoveCard operations is 2.
The aim is to find the first card which has to be moved. In this case its 2 Given a permutation $\pi:[n]\to[n]$ of cards from $1$ to $n$ you can find the first card to move to the front the following way: | {
"domain": "cs.stackexchange",
"id": 5109,
"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
} |
java, game, parsing, file, libgdx
/*
for (String string : formattedStrings) {
System.out.println(string);
}
*/
GlyphData data = new GlyphData(formattedStrings);
this.glyphs.add(data);
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 15336,
"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, parsing, file, libgdx",
"url": null
} |
At $\frac{1}{2}$ minute to 12:00, we add #11 to #20 and remove one ball.
. . . . Suppose it is #2.
At $\frac{1}{4}$ minute to 12:00, we add #21 to #30 and remove one ball.
. . . . Suppose it is #3.
At $\frac{1}{8}$ minute to 12:00, we add #31 to #40 and remove one ball.
. . . . Suppose it is #4.
We continue this process until 12:00.
We can generalize the procedure:
At $\frac{1}{2^{n-1}}$ minute to 12:00, we add 10 balls and remove one ball.
. . . . Suppose it is number $n.$
At every fraction of a minute, we are adding 9 balls to the box.
Yet by 12:00, the box will be empty!
It was removed $\frac{1}{2^{34}}$ minute before 12:00.
It was removed $\frac{1}{2^{12,500}}$ minute before 12:00.
Get it?
There are different variation to the problem. In one case, with each addition of 10 balls, you always pick the largest labelled ball in the box. This means there are no balls for { 10*n, n>0}. At 12:00, there are thus, infinity many balls. This is obvious. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104943498959,
"lm_q1q2_score": 0.823336128512974,
"lm_q2_score": 0.8519528019683106,
"openwebmath_perplexity": 625.1600223856777,
"openwebmath_score": 0.9275745749473572,
"tags": null,
"url": "http://mathhelpforum.com/statistics/166749-how-many-balls-box.html"
} |
electrostatics, electrons, charge, conductors
Now a conductor might not have $\vec J=\sigma\vec E,$ but the end that material becomes is what a perfect conductor is also aiming for. Basically a small field makes a huge current so huge amounts of charge can distribute away from inside to the outside and from one part of the outside surface to another part of the surface so the charge gets to that final configuration (or really close to it) really fast. | {
"domain": "physics.stackexchange",
"id": 24369,
"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": "electrostatics, electrons, charge, conductors",
"url": null
} |
comparative-review, clojure, simulation
(ns irrelevant.hundred-doors-set)
(defrecord Doors [open n-doors])
(defn- new-doors [n-doors]
(->Doors #{} n-doors))
(defn- multiple-of? [n multiple]
(zero? (rem n multiple)))
(defn- oneth-range
"Returns a range without 0. Max is inclusive."
([] (rest (range)))
([max] (rest (range (inc max)))))
(defn- toggle-doors
"Toggles the state of every nth door."
[doors every-n]
(update doors :open
(fn [open]
(reduce (fn [acc-set n]
(cond
(not (multiple-of? n every-n)) acc-set
(open n) (disj acc-set n)
:else (conj acc-set n)))
open
(oneth-range (:n-doors doors))))))
(defn- toggle-doors-for [doors max-n]
(reduce toggle-doors doors (oneth-range max-n)))
(defn find-open-doors-for
"Simulates the opening and closing of n-doors many doors, up to a maximum skip distance of n."
[n-doors n]
(let [doors (new-doors n-doors)
toggled (toggle-doors-for doors n)] | {
"domain": "codereview.stackexchange",
"id": 31989,
"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": "comparative-review, clojure, simulation",
"url": null
} |
genetics
The department is fantastic and I'm enjoying learning the experimentation, but I haven't had the opportunity yet to use my actual skills.
The more talks I attend, the more I realize that much of the "computational" side of molecular genetics seems to be split between machine learning, bioinformatics and statistics or some combination of the three. In my undergrad I studied topics such as differential equations (partial and ordinary, extensively), dynamical systems, vector calculus (though I never took any fluids courses, I was more of a systems guy), computational mathematics, control theory and some computer science (about 5 courses).
I've talked to a few of the faculty so far and when I mention the possibility of differential equation modeling, they don't seem comfortable giving me guidance. In addition, I read a review paper today that seems to suggest this kind of modeling is fairly uncommon. | {
"domain": "biology.stackexchange",
"id": 6027,
"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": "genetics",
"url": null
} |
energy, electricity, electric-circuits, work, potential-energy
To take your example of a light bulb (we'll assume a DC source for convenience) the electrons leaving the -ve terminal on the battery and entering the wire/bulb have a higher potential energy than the electrons leaving the wire/bulb and reentering the battery at the +ve terminal. As the electrons flow through the filament of the bulb their potential energy is converted to kinetic energy, i.e. the electrons accelerate. The electrons scatter off the atoms in the filament and transfer their kinetic energy to lattice vibrations of the filament, i.e. heat, so the filament heats up. The filament then emits photons by black body radiation. So potential energy $\rightarrow$ electron kinetic energy $\rightarrow$ lattice kinetic energy $\rightarrow$ photons.
But I would be cautious about trying to categorise energy. The word energy is used in a large number of different circumstances to mean different things, and I'm not sure that trying to pin a precise definition to it is very useful. | {
"domain": "physics.stackexchange",
"id": 13535,
"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": "energy, electricity, electric-circuits, work, potential-energy",
"url": null
} |
evolution, life-history
Killing its own offsprings is certainly not less common in k-selected species. You might think it is such a big cost to kill one of its own offspring when one has few offspring but what is important is to think in percentage. Killing 50% of the progeny has the same cost of an r-selected species than for a k-selected species.
If one has a probability of 10% to be able to raise its offspring to adult age. But this probability raised to more than 20% if it accepts to kill an offspring to save energy for the next offspring, then it wins by doing so. THen we might ask: "so would one make an offspring if it intends to kill it?"
Well it does not necessarily intend to kill it. It might need to decide late in the season whether or not it has better to kill its own offspring.
Then, maybe offspring might be used as a reserve of energy and matter for its siblings or for its parents. | {
"domain": "biology.stackexchange",
"id": 1564,
"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": "evolution, life-history",
"url": null
} |
organic-chemistry, reaction-mechanism, reaction-control, regioselectivity
Both the trans isomer 4 as well as the cis isomer 5 can be formed via attack of the nucleophile at the terminal carbon, and both are disubstituted alkenes. However, the trans isomer 4 is more stable than the cis isomer 5, because there is less steric repulsion between the two substituents on the double bond. As such, 4 is the thermodynamic product.
The kinetic product: 3-bromobut-1-ene
There are quite a few explanations on the Internet,3–6 and not all of them are correct.
The worst possible argument, which I have thankfully not seen yet, goes something along the lines of: resonance form 2a, being an allylic secondary carbocation, is more stable than resonance form 2b, which is an allylic primary carbocation. Therefore, resonance form 2a exists in greater proportion, and the nucleophile preferentially reacts with it, leading to the formation of 3. | {
"domain": "chemistry.stackexchange",
"id": 6470,
"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, reaction-mechanism, reaction-control, regioselectivity",
"url": null
} |
inorganic-chemistry, acid-base, periodic-trends, electronegativity
Title: Basicity of Group 15 hydrides Why does the basicity of Group 15 hydrides ($\ce{NH_3,~ PH_3,~ etc}$) decreases down the group ?
I know that's because of its Lewis Base nature due to the lone pair but wouldn't the more EN element be less reluctant to give the lone pair ?
And nitrogen is most EN in that group . It can be explained by the very helpful Bent's rule. As nitrogen is more electronegative than phosphorus, there is a bigger s character of the sp3 hybrid orbitals that are used to form the bond to hydrogen than the ones of phosphorus. As a result, the sp3 hybrid orbital that holds the electron pair, has a bigger p character for nitrogen than for phosphorus, meaning that the pair is more distant from the nucleus and more susceptible to donation. | {
"domain": "chemistry.stackexchange",
"id": 2851,
"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": "inorganic-chemistry, acid-base, periodic-trends, electronegativity",
"url": null
} |
string-theory, quantum-spin, fermions, spin-statistics
Ground state
$|R_\alpha\rangle$
$|R_{\bar\alpha}\rangle$
Spacetime properties
Spacetime fermion
Spacetime fermion
$\mathrm{Spin}(8)$ representation in spacetime
Spinor $\mathbf 8_s$
Conjugate Spinor $\mathbf 8_c$
Worldsheet properties
Worldsheet fermion
Worldsheet boson
$G$-parity
$-1$
$1$
For the open string, you can take either projection since they both result in physically indistinguishable theories.
The closed string RR ground state is produced by tensoring together two such spinorial representations and so it is bosonic on the worldsheet. However, we can choose the $G$-parity (or equivalently, chirality: see the $\Gamma_{11}$ up front) of the Ramond ground state of the left-moving sector and right-moving sector independently, and the resulting theory is clearly different in each case. If both sectors have the same chirality, we obtain type IIB string theory, while choosing opposite chiralities constructs type IIA string theory. | {
"domain": "physics.stackexchange",
"id": 79609,
"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": "string-theory, quantum-spin, fermions, spin-statistics",
"url": null
} |
javascript, object-oriented, ecmascript-6, event-handling
Pass the code the elements required
Use Element's Element.dataset to mark objects
Example marks the copy button with the query needed to locate the text source.
const copyBtn = document.querySelector("[data-copy-src]");
const copySrcEl = document.querySelector(copyBtn.dataset.copyButton);
<div class="code" id="activationCodeEl">B12A7</div>
<button id="copyButton" data-copy-src="#copySrcEl">Copy code</button>
Rewrite
Example moves element queries out of the function. To use you must pass all the elements required for the function to work.
The rewrite performs the following
Marks the function to ensure that the code runs only once.
Checks all elements to make sure that they are instanceof Element. | {
"domain": "codereview.stackexchange",
"id": 41089,
"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, object-oriented, ecmascript-6, event-handling",
"url": null
} |
ros-kinetic
Title: XBox button debouncing
Hey,
I want to implement button debouncing for my xbox controller and I couldn't find anything much helpful till now. All the info that is available on google is related to microcontrollers.
Is there an option or a way button debouncing can be implemented in a ros python code?
Thanks in advance
Edit:
@PeteBlackerThe3rd In the pic you can see that the joint changed once, when I gave the input through the controller, but instead of stopping at the first 'Plan complete', the loop ran for 7 more times, which causes a bit of delay in processing the second instruction given through the controller. Could you maybe point out my mistake or maybe guide me through the right process so that I can detect my mistake?
Edit-2 Code screenshot: I know it's not suggested to take a screen shot of the code and post it here, but I just wanted to make sure that the indentations I am having in my code are clear, since indentations are a not always correct here | {
"domain": "robotics.stackexchange",
"id": 30911,
"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-kinetic",
"url": null
} |
electrons, collision, x-rays
The incident photon collides with the atom and ejects the electron from the K-shell.if the incident electron loses all of its energy in the collision what happens to it after the collision?
Here you are talking about two different things - the first is photoemission of an electron by an X-ray (The incident photon collides with the atom and ejects the electron from the K-shell) where a core electron is knocked out by the absorption of a high energy photon. The second thing (if the incident electron loses all of its energy in the collision what happens to it after the collision?) is the process I describe above where an electron hits a target and loses its energy by generating an X-ray.
and why wouldn't this incident electron fill the vacancy created in the K-shell.?
As noted you are talking about two different things - when the slowed down electron is present no K-shell hole is present.
Rather it is filled by another electron i.e. from L-shell. | {
"domain": "physics.stackexchange",
"id": 47562,
"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, collision, x-rays",
"url": null
} |
turing-machines, undecidability, rice-theorem
Claim: There exists $c,c'>0$ such that problem $P$ reduces to problem $Q_{L,c,c'}$.
Proof: Let $\mathcal{N_L}$ be the Turing machine which decides $L$ in at most $n^2$ steps. The reduction maps $\mathcal{M}$ to the machine $\mathcal{M}'$ which, on input $x$:
first, it simulates $\mathcal{M}$ on input $x$ for $|x|$ steps;
if the machine didn't stop, it loops forever;
otherwise, it simulates $\mathcal{N}_L$ on $x$ for $|x|^2$ steps, and returns its output. | {
"domain": "cs.stackexchange",
"id": 21633,
"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": "turing-machines, undecidability, rice-theorem",
"url": null
} |
machine-learning, python, neural-network, deep-learning, classification
An example could be like:
pred = model.predict_classes(new_image)
labels=np.array(["cats","dogs","cars","humans"])
print(labels[pred[0]]) | {
"domain": "datascience.stackexchange",
"id": 7214,
"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, python, neural-network, deep-learning, classification",
"url": null
} |
1. The area under the curve is 1 (this gives you the first equation by integration)
2. The value of the pdf is 0 at x=30 (this is just a simple subst of x into the main equation)
3. This is the one I couldn't get. But I recalled that when you differentiate a continuous probability function you get the cumulative distribution function which always reaches 1 when the at maximum x value (30). Therefore we differentiate
F(x) (capital F denotes cdf, small f denotes pdf) = b + 2cx
F(30) = 1 = b+60x
Then I found a 3-unknown, 3 equation calculator on the web and got a = 15.1 b= -2.01 and c=0.050
Thoughts? | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534344029238,
"lm_q1q2_score": 0.8302531084976622,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 479.187610951673,
"openwebmath_score": 0.8268288373947144,
"tags": null,
"url": "https://www.physicsforums.com/threads/finding-unknown-coefficients-of-a-quadratic-equation-describing-a-pdf.290814/"
} |
c++, homework, tic-tac-toe
Omit return 0
When a C or C++ program reaches the end of main the compiler will automatically generate code to return 0, so there is no need to put return 0; explicitly at the end of main.
Note: when I make this suggestion, it's almost invariably followed by one of two kinds of comments: "I didn't know that." or "That's bad advice!" My rationale is that it's safe and useful to rely on compiler behavior explicitly supported by the standard. For C, since C99; see ISO/IEC 9899:1999 section 5.1.2.2.3:
[...] a return from the initial call to the main function is equivalent to calling the exit function with the value returned by the main function as its argument; reaching the } that terminates the main function returns a value of 0.
For C++, since the first standard in 1998; see ISO/IEC 14882:1998 section 3.6.1:
If control reaches the end of main without encountering a return statement, the effect is that of executing return 0; | {
"domain": "codereview.stackexchange",
"id": 33947,
"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++, homework, tic-tac-toe",
"url": null
} |
python
def valid_tuple(number_pair: tuple) -> bool:
a, b = number_pair
return abs(b) <= abs(a)
def get_values_product(n: int) -> list:
out = product(range(-n, n + 1), repeat=2)
out = filter(valid_tuple, out)
return sorted(out, key=lambda t: abs(t[0]))
It's usually faster to use functions that are built-in or included in standard library modules. itertools.product returns the cartesian product of input iterables, which is exactly what we want here. On my machine, this takes about half the time of your original implementation.
As you need sorted output I don't think there's a way to significantly reduce the space complexity. If you didn't need the output to be sorted, you could turn it into a generator, which is really memory-efficient.
Edit:
Here's how you can get the same desired sorted output while optimising space complexity:
from itertools import product, chain
from typing import Generator
def get_values_generator(n: int) -> Generator:
if n < 0:
return | {
"domain": "codereview.stackexchange",
"id": 41320,
"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",
"url": null
} |
For any $$L^2$$ function $$\varphi$$, one can define the distribution derivatives as a functional $$C^\infty_c(\mathbb R^d)\to \mathbb R$$ by
$$\partial_{x_i} \varphi (f) : = -\int_{\mathbb R^d} \varphi f_{x_i}.$$
Then $$\Delta \varphi$$ is just the functional
\begin{align} (\Delta \varphi) (f) &= \left( \varphi_{x_1x_1} + \cdots + \varphi_{x_dx_d}\right) (f) \\ &= \int_{\mathbb R^d} \varphi \left( f_{x_1x_1} + \cdots + f_{x_dx_d}\right) \\ &= \int_{\mathbb R^d} \varphi \Delta f. \end{align}
So $$\Delta\varphi$$ as defined is just a functional. We say that $$\Delta \varphi \in L^2(\mathbb R^d)$$ in the sense of distribution, if this functional is given by integration of a $$L^2$$ function: there is $$g\in L^2(\mathbb R^d)$$ so that
$$(\Delta \varphi) (f) = \int _{\mathbb R^d} \varphi \Delta f = \int_{\mathbb R^d } g f, \ \ \ \forall f\in C^\infty_c(\mathbb R^d).$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357561234475,
"lm_q1q2_score": 0.800434641135749,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 187.08744605169363,
"openwebmath_score": 0.9989726543426514,
"tags": null,
"url": "https://math.stackexchange.com/questions/4199388/what-does-delta-varphi-in-l2-mathbbrd-in-the-sense-of-distributio/4199394"
} |
python, performance, python-2.x, csv
This while not comparing lists uses the logic, as the difference between them all has to be step, and step has to be in the allowed range.
Now that we have gotten rid of one of the two internal for loops, we need to get rid of the other, for this to be what I would deem is the 'correct' answer.
This loop is a list comprehension, and if you have only 3 columns in all the rows, it would be a relatively fast and a really easy conversion. However, I am guessing that is not the case.
And so if we just remove it, we will have to manually convert the columns into numbers. We can just do this in add_i again.
def add_i(row, range):
r1 = int(row[1])
step = r1 - int(row[0])
if range[0] <= step < range[1]:
return step == (int(row[2]) - r1)
return False
Edit, I thought I should make a benchmark for sets, and found it was very fast.
row_dup = set()
# ... in the for loop
row_ = ''.join(row)
if not add_i(row, (1, 11)) and row_ not in row_dup:
row_dup.add(row_) | {
"domain": "codereview.stackexchange",
"id": 14439,
"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, performance, python-2.x, csv",
"url": null
} |
formal-languages, regular-languages, automata, regular-expressions
But attempting to combine these operations produces wrong results, for example:
$$
a^*b^* \to \\
(a^*(b+c))^+(b^*(a+c))^+ \to \\
(\epsilon+((a^*(b+c))^+(a^*(b+c))^++b+c)(a+b+c)^*)(\epsilon+((b^*(a+c))^++a+c)(a+b+c)^*))
$$
doesn't seem to do what I expect it to because, for example, it will match the empty string on both sides.
Should I perhaps consider transforming the regexp into DFA and "inverting" the DFA instead? The problem with your attempt is that you've only looked at what happens when the regexp to transform is a simple one. For example, you've looked at what the complement of $a^*$ looks at. But in order to write a compositional complementation algorithm, you need to figure out how to compute a regular expression that recognizes the complement of the language of $r^*$, for an arbitrary regular expression $r$. | {
"domain": "cs.stackexchange",
"id": 5176,
"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": "formal-languages, regular-languages, automata, regular-expressions",
"url": null
} |
quantum-mechanics, fourier-transform, conventions
EDIT: To elaborate the connection to the delta function a little bit more. You might interpret $\delta$ as a functional acting on your Hilbert space. In other words you define that
$$\left< \mathbf{q} |\psi\right> = \int_{\mathbb{R}^n} \delta^{(n)}(\mathbf{x}-\mathbf{q})\psi(x) \text{d}x^n$$
where $\psi$ could be element of $\mathcal{L}(\mathbb{R}^n)$, for example. Then, for $\psi,\phi\in \mathcal{L}(\mathbb{R}^n)$ you use the standard definition of a scalar product on this space
$$\left< \phi |\psi\right> = \int_{\mathbb{R}^n} \phi^\ast(\mathbf{x}) \psi(\mathbf{x}) \text{d}x^n = \int_{\mathbb{R}^n} \left< \phi|\mathbf{x}\right>\left< \mathbf{x} |\psi\right> $$ and you see that we get the completeness relation
$$\int_{\mathbb{R}^n} \left|\mathbf{x} \right> \left< \mathbf{x}\right| \text{d}x^n = 1 $$
And to close the circle now, you can expand (in the position basis) | {
"domain": "physics.stackexchange",
"id": 21454,
"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, fourier-transform, conventions",
"url": null
} |
computational-physics, quantum-computer, quantum-hall-effect, anyons, tensor-network
http://www.phys.virginia.edu/Announcements/Seminars/Slides/S2678.pdf
If, as Slaviks states below, that the ground state doesn't change, how can we learn about braiding statistics from DMRG? In these modern DMRG algorithms for topological phases, braiding statistics is rarely computed directly. The reason is that it is not clear how to trap a particular anyon in the bulk, and to get braiding statistics requires a careful calculation of adiabatic non-Abelian Berry phase which is often very computationally demanding. Instead, one calculates modular transformations on cylinders (to be more precise, the Dehn twist) by measuring the so-called momentum polarization of the Schmit states. It contains a lot of useful information about the topological order. The latter part of the slides explained these ideas. | {
"domain": "physics.stackexchange",
"id": 22177,
"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": "computational-physics, quantum-computer, quantum-hall-effect, anyons, tensor-network",
"url": null
} |
visible-light, radiation, thermal-radiation
For a black-body to look white, it will have to emit wavelengths corresponding to the visible region with nearly equal intensities because white light is composed of visible colors but with EQUAL intensities of all the colors.
Our sun has its max intense wavelength lying in the visible region and human eyes are evolved to see the most intense wavelength which is visible light.
In our situation of black-body absorbing radiation from the sun, it is radiating some energy on its own because of its finite temperature. So it is receiving some power from the sun and emitting some power on its own. When the temperature of black-body becomes constant then it means that power incoming will be equal to power outgoing.
If your black paint absorbs all wavelengths completely then only it is a black-body. | {
"domain": "physics.stackexchange",
"id": 41143,
"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": "visible-light, radiation, thermal-radiation",
"url": null
} |
# Moderate Probability Solved QuestionAptitude Discussion
Q. A man can hit a target once in 4 shots. If he fires 4 shots in succession, what is the probability that he will hit his target?
✖ A. 1 ✖ B. 1/256 ✖ C. 81/256 ✔ D. 175/256
Solution:
Option(D) is correct
The man will hit the target even if he hits it once or twice or thrice or all four times in the four shots that he takes.
So, the only case where the man will not hit the target is when he fails to hit the target even in one of the four shots that he takes.
The probability that he will not hit the target in one shot =1 - Probability that he will hit target in exact one shot
$=1-\dfrac{1}{4}$
$=\dfrac{3}{4}$
Therefore, the probability that he will not hit the target in all the four shots
$=\left(\dfrac{3}{4}\right)\times\left(\dfrac{3}{4}\right)\times \left(\dfrac{3}{4}\right)\times\left(\dfrac{3}{4}\right)$
$=\dfrac{81}{256}$
Hence, the probability that he will hit the target at least in one of the four shots: | {
"domain": "lofoya.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9830850857421198,
"lm_q1q2_score": 0.8432590256793905,
"lm_q2_score": 0.8577680995361899,
"openwebmath_perplexity": 510.1303907346087,
"openwebmath_score": 0.5834237933158875,
"tags": null,
"url": "http://www.lofoya.com/Solved/1713/a-man-can-hit-a-target-once-in-4-shots-if-he-fires-4-shots-in"
} |
Case 2: when $n^2$ has three digits.
In this case, suppose $n=10a+b$, then $n^2=100a^2+20ab+b^2$ and $r(n)^2=(10b+a)^2=100b^2+20ab+b^2$. Since $n^2$ and hence $r(n)^2$ have three digits each, we must have $a,b\in\{1,2,3\}$. Further, $n^2$ and $r(n)^2$ have to be inverses of each other. Since last digit of $n^2$ is already $b^2$, the first digit of $r(n)^2$ must be $b^2$, which means there is no carry from the term $20ab$, so $20ab<100\implies ab<5$. This leaves us with the cases $(a,b)\in\{(1,1),(1,2),(2,1),(1,3),(3,1),(2,2)\}$, and all of them work. So the solutions are precisely as indicated above.
I think I have a general answer. First, the results:
All two-digit numbers that satisfy $r(n^2) = r(n)^2$, as found by Ankoganit, are:
11, 12, 13, 22, and their inverses.
All three-digit numbers are:
101, 102, 103, 111, 112, 113, 121, 122, 202, 212, and their inverses.
All four-digit numbers are: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877044076956,
"lm_q1q2_score": 0.8030933510363973,
"lm_q2_score": 0.817574471748733,
"openwebmath_perplexity": 315.10336770196403,
"openwebmath_score": 0.8895820379257202,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/38154/for-which-numbers-does-the-order-of-reversing-their-digits-and-squaring-not-matt"
} |
c#, sql, .net, transactions
parameters.Add("@aid", SqlDbType.Int);
parameters.Add("@pid", SqlDbType.Char);
parameters.Add("@eid", SqlDbType.Int);
parameters.Add("@inT", SqlDbType.DateTime);
parameters.Add("@outT", SqlDbType.DateTime);
parameters.Add("@shift", SqlDbType.Char);
foreach (var attendanceItem in attendanceList)
{
parameters["@aid"].Value = attendanceItem.AttendanceID;
parameters["@pid"].Value = attendanceItem.PointID;
parameters["@eid"].Value = attendanceItem.EmployeeID;
parameters["@inT"].Value = attendanceItem.InTime;
parameters["@outT"].Value = attendanceItem.OutTime;
parameters["@shift"].Value = attendanceItem.ShiftType;
command.ExecuteNonQuery();
}
trans.Commit();
}
}
} | {
"domain": "codereview.stackexchange",
"id": 8662,
"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#, sql, .net, transactions",
"url": null
} |
algorithms, graphs
Here is an alternative approach, that might work even on larger graphs. It won't find the optimal solution, but it might find a solution that is not too much worse than the optimal solution.
The problem reminds me of a set cover problem: in each iteration you select one set, and you want the union of the sets to cover the universe. One natural approach to set-cover-like problems is to try to apply the greedy algorithm for set cover: in each iteration, choose an independent set that gives you as much progress as possible.
Let me start by assuming $r_v=1$ for all vertices $v$, for simplicity. Then you could use the following algorithm: | {
"domain": "cs.stackexchange",
"id": 3095,
"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, graphs",
"url": null
} |
python, turtlebot, ros-kinetic
pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
rospy.init_node('node_name')
r = rospy.Rate(30) # 30hz
total_time = 10 #seconds
start_time = time.time()
while not rospy.is_shutdown() or (time.time() - start_time < total_time):
msg = Twist()
# here you should fill the msg fields
# http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html
# you can fill it randomly or with a direction in mind
pub.publish(msg)
r.sleep()
Originally posted by alsora with karma: 1322 on 2019-07-15
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 33428,
"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, turtlebot, ros-kinetic",
"url": null
} |
human-genetics
Title: Subtracting shared DNA with half-sibling I want to note that I am not a biologist. I've been on a nearly 20-year search for the identity of the parents of my 4th great grandfather (not an easy task.)
I'm using ancestry.com DNA, GEDmatch, and family trees of my matches in hopes of using DNA triangulation to find my ancestors. In addition, I have a half-sibling who also had his DNA tested which allows me to find common ancestors on this side of the family.
I read the article "Relatedness" on the topic of inherited parental dna with two half-siblings and I'm not sure I understand what the writer means when she says:
In other words, you and your half-brother should be able to figure
out what part of your DNA came from your mom. And if you subtract out
that shared DNA, what is left must have come from your dad! | {
"domain": "biology.stackexchange",
"id": 8213,
"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": "human-genetics",
"url": null
} |
of the above statement may not be immediately obvious until we look at it graphically Annuities, where the payment is made in the beginning of period is called annuity-due. Annuities are used in retirement accounts, where the goal is to make a starting balance pay a fixed annual amount over a given number of years. There are a lot of different flavors of annuity contracts and they can be complex. Time Value of Money Calculator: Introduction. Using calculator data, consumers choose among various options, which includes selling an annuity for a one-time lump sum. When the payments occur at the beginning of the compounding period (as opposed to a regular annuity, where the payments occur at the end of the compounding period). The Excel present value of annuity due calculator, available for download below, is used to compute the present value by entering details relating to the regular payment, discount rate and the number of periods. o Annuities due—because an annuity due is an annuity | {
"domain": "com.ar",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808684361289,
"lm_q1q2_score": 0.8292611851880839,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 1389.7887079328416,
"openwebmath_score": 0.45728445053100586,
"tags": null,
"url": "http://verdevoto.com.ar/kyni/ifjw.php?kmsj=5&pgjkpzj=176&wp816=annuity-due-payment-calculator"
} |
V = π 2 * (R + r) * (R - r) 2. 62mm thickness required use of another calculator before use of torus calculator. A torus is a geometric figure created by revolving a two dimensional circle around an axis that is coplanar with it. This paper offers full calculation of the torus's shape operator, Riemann tensor, and. A torus is just a cylinder with its ends joined, and the volume of a cylinder of radius $r$ and length $d$ is just $\pi r^2 d$, so all we need is the length of the cylinder. This is the main purpose of the present paper. the cylinder. Minor Radius (r) = m Major Radius (R) = m Tube Shape Donut Surface Area = m 2 Volume. Volume of a Torus (a) Show that the volume of the torus shown in the figure is given by the integral $8 \pi R \int_{0}^{r} \sqrt{r^{2}-y^{2}} d y,$ where $\quad R>r>0$ (b) Find the volume of the torus. 700 Corporate Circle, Suite M Golden, Colorado, 80401, USA Tel: 1-303-384-0279 Fax:1-303-279-7551 Email: usa. Experimental observations indicated that the | {
"domain": "angelaleone.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9895109071934598,
"lm_q1q2_score": 0.8043410793442721,
"lm_q2_score": 0.8128673201042492,
"openwebmath_perplexity": 823.0098102989588,
"openwebmath_score": 0.754847526550293,
"tags": null,
"url": "http://angelaleone.it/dhbc/volume-of-a-torus.html"
} |
electromagnetism, optics, visible-light, electromagnetic-radiation, classical-electrodynamics
The field after the glass slab is produced by the interference of the initial beam and the radiation produced by the oscillating charges inside the glass.
However, here is the important thing: the glass can do this induced-oscillations-then-emission game without absorbing any energy at all. In the steady state, the charge oscillations inside the glass are exactly 90° out of phase with the electric field that drives them, which means that the net power that they emit is being put in, in equal amounts, by the driver. | {
"domain": "physics.stackexchange",
"id": 46662,
"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, optics, visible-light, electromagnetic-radiation, classical-electrodynamics",
"url": null
} |
acoustics, frequency, design
I think the shape of the panels matching the shape of spectrograms shown in the question is interesting but just a coincidence. (It's reasonable to think these could be related, like some type of Fraunhofer diffraction grating, etc, but I don't think it works out that they are.)
(I have also heard of specialized acoustic panels creating interference such that reflections are cancelled, similar to anti-reflective coatings on lenses, which seems feasible, but I can't find a reference to these now. I even remember the shape of the panels as being an unusual stepped structure, and the inventor, a prominent academic, saying they "made walls disappear", but I haven't found the reference yet, so maybe that was an invention that didn't work out. References to the diffusion benefits of panels are all over the place though.) | {
"domain": "physics.stackexchange",
"id": 78382,
"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": "acoustics, frequency, design",
"url": null
} |
computational-chemistry, software, notation, cheminformatics
Last but not least, I'd like to cover the matter of complicated organometallic molecules. As such I'd like to introduce the Grubbs' catalysts. Grubbs obtained the Nobel Prize in Chemistry 2005 for his research in conjunction with Yves Chauvin and Richard R. Schrock. One of the key publications was "Ring-opening metathesis polymerization (ROMP) of norbornene by a Group VIII carbene complex in protic media". The crystal structure can also be obtained at CCDC. Another example stems from "Synthesis and Applications of $\ce{RuCl2(=CHR')(PR3)2}$: The Influence of the Alkylidene Moiety on Metathesis Activity" and is also available via CCDC. This structure can also be found in the appendix. It is generally known as a 1st generation Grubbs catalyst (Hydrogens omitted for clarity). | {
"domain": "chemistry.stackexchange",
"id": 1485,
"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": "computational-chemistry, software, notation, cheminformatics",
"url": null
} |
astrophysics, astronomy, universe
Title: How is it possible for astronomers to see something 13B light years away? In a NPR News story from a few years back:
"A gamma-ray burst from about 13
billion light years away has become
the most distant object in the known
universe." | {
"domain": "physics.stackexchange",
"id": 9972,
"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": "astrophysics, astronomy, universe",
"url": null
} |
c++, multithreading, c++20, locking
const auto next_in_line = my_label + 1;
auto stored_label = my_label;
if (!shared_state->current_label.compare_exchange_strong(stored_label, next_in_line, std::memory_order_acq_rel, std::memory_order_consume)) {
throw std::logic_error("somebody acquired the lock before this lock unlocked?");
}
is_locked = false;
}
~normal_priority_thread_lock() {
if (is_locked) {
unlock();
}
}
private:
friend priority_mutex;
normal_priority_thread_lock(priority_mutex* shared_state, bool start_locked):
shared_state(shared_state)
{
if (start_locked) {
lock();
}
}
}; | {
"domain": "codereview.stackexchange",
"id": 42770,
"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++, multithreading, c++20, locking",
"url": null
} |
How strong the relationship between the two variables and then the data of the correlation coefficient ’ ( PMCC.... But not that other components do not exist move a correlation coefficient of zero describes the same as causation * alexis1344 alexis1344 seconds. Correlation while controlling for W. [ 31 ] [ citation needed ] the population reflective is. Distributions is given by Cox & Hinkley. [ 40 ] learners may find it helpful!, the contributions of slow components are retained: zero-clustered data, Pearson correlation coefficient of nondetermination 0.30!, however indicate a negative correlation occurs if a dramatic increase in price... An answer to your question which of the association between two variables reading the of. When the outlier is removed [ citation needed ] the population reflective correlation is indicated the. * alexis1344 alexis1344 26 seconds ago Mathematics High school which of the other goes down, weighted rank describes... Meaning that as one variable goes up, | {
"domain": "equipement-hardware.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407168145569,
"lm_q1q2_score": 0.831062652543348,
"lm_q2_score": 0.8539127455162773,
"openwebmath_perplexity": 658.7259965617884,
"openwebmath_score": 0.706878125667572,
"tags": null,
"url": "http://equipement-hardware.com/toronto-trivia-jmvkz/a-correlation-coefficient-of-zero-describes-485f80"
} |
navigation, ros-kinetic, robot-localization
0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9] | {
"domain": "robotics.stackexchange",
"id": 37323,
"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": "navigation, ros-kinetic, robot-localization",
"url": null
} |
beginner, algorithm, tree, lisp, common-lisp
Title: Implementing a tree parsing function I've solved an assignment a week ago, which is my first assignment using Lisp.
Tasks:
Task 1:
a. Given a tree as recursive lists, print the tree in breadth first order.
b. Given a tree like in task 1a, print it in child-successor order.
Input for Tasks 1a and 1b:
(A (B (C (D))(E (F) (G (H)))) (J (K (L (M) (N (P))))))
Output for Task 1a:
A
B J
C E K
D F G L
H M N
P
Output for Task 1b:
A, B J
B, C E
J, K
C, D
E, F G
K, L
D,
F,
G, H
L, M N
H,
M,
N, P
P,
Task 2:
Tasks 2a and 2b are the same as in task 1, but now the nodes of the tree have costs. The cost represents the cost from the node parent to this node. When printing, cost should be accumulated starting from the root (2a, 2b are using styles defined by 1a, 1b accordingly).
Input for Task 2:
((A 0) ((B 5) ((C 3) ((D 4))) ((E 2) ((F 1)) ((G 7) ((H 9))))) ((J 1) ((K 3) ((L 1) ((M 7)) ((N 1) ((P 2)))))))
Output for Task 2a:
B,5 J,1
C,8 E,7 K,4
D,12 F,8 G,14 L,5
H,23 M,12 N,6
P,8 | {
"domain": "codereview.stackexchange",
"id": 31769,
"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": "beginner, algorithm, tree, lisp, common-lisp",
"url": null
} |
earth-history, planetary-science, earth-observation
Is Earth an organism? Since there is no unequivocal definition of life, the current understanding is descriptive. To define Earth as an organism, your answer most show either via observed phenomena or theoretically observable phenomena that Earth exhibits all or most of the following traits: Homeostasis, Organization, Metabolism, Growth, Adaptation, Response to stimuli, and Reproduction. Answer is no, Earth not an organism. Key reason being that life without reproduction is not life, and there is no logical proof that Earth reproduces using a type of reproduction never observed, or is proof that life does not require reproduction. | {
"domain": "earthscience.stackexchange",
"id": 2206,
"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": "earth-history, planetary-science, earth-observation",
"url": null
} |
(b) Show that 80 is an upper bound for this travelling salesman problem.
## Markscheme
(a) (i) the edges are joined in the order
AC
BE
AB
ED A2
A1
Note: Final A1 independent of the previous A2.
(ii)
A1
the weight of this spanning tree is 33 A1
to find a lower bound for the travelling salesman problem, we add to that the two smallest weights of edges to D, i.e. 15 +16, giving 64 M1A1
[7 marks]
(b) an upper bound is the weight of any Hamiltonian cycle, e.g. ABCDEA has weight 75 so 80 is certainly an upper bound M1A1
[2 marks]
Total [9 marks]
## Examiners report | {
"domain": "iitianacademy.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180681726683,
"lm_q1q2_score": 0.8012579932823377,
"lm_q2_score": 0.8128673087708699,
"openwebmath_perplexity": 2782.6996971591825,
"openwebmath_score": 0.7030114531517029,
"tags": null,
"url": "https://www.iitianacademy.com/ib-dp-maths-topic-10-10-deleted-vertex-algorithm-for-determining-a-lower-bound-hl-paper-3/"
} |
slam, navigation, realsense, multiple, rtabmap-ros
<remap from="rgbd_image0" to="/camera1/rgbd_image"/>
<remap from="rgbd_image1" to="/camera2/rgbd_image"/>
</node>
</group>
<!-- Visualization RVIZ -->
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find rtabmap_ros)/launch/config/rgbd.rviz"/> | {
"domain": "robotics.stackexchange",
"id": 28900,
"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": "slam, navigation, realsense, multiple, rtabmap-ros",
"url": null
} |
textbook-and-exercises, quantum-operation, nielsen-and-chuang, kraus-representation
Title: What is the meaning of $\langle e_k|U|e_0\rangle$ when $U$ acts on a larger Hilbert space than that in which $|e_0\rangle$ and $|e_k\rangle$ live? In Nielsen and Chuang, 10th Anniversary Edition, there is a definition of the operator sum representation of a quantum operation: $\mathcal{E}(\rho)=\sum_{k}\langle e_k|U[\rho\otimes|e_0\rangle\langle e_0|]U^\dagger|e_k\rangle$ and then the operation element is defined as $E_k\equiv \langle e_k|U|e_0 \rangle$. In both cases the dimensions of $U$ on the one hand, and $\langle e_k|$, and $|e_0\rangle$ are different ($U$ is an operator acting on composite system, whereas $|e\rangle$ is a state of the component system).
How can the inner product be calculated in this case? Is this some sort of notational convention or is there a different explanation? It's a trivial question, but I can't find an explicit answer anywhere. | {
"domain": "quantumcomputing.stackexchange",
"id": 4596,
"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": "textbook-and-exercises, quantum-operation, nielsen-and-chuang, kraus-representation",
"url": null
} |
2nd midterm will be on Friday, May 24. If you complete the whole of this tutorial, you will be able to use MATLAB to integrate equations of motion. A nonlinear Spring Pendulum is simulated. system consists of a passive spring and a damper. Solution using ode45. 9-1, where the spring and damper forces is and id have the nonlinear models shown in Figures 9. Linear systems: multiple spring-mass problems. ; Verify your solutions by plotting them on in the same figure window as the function. First, rewrite the equations as a system of first order derivatives. The contribution of this paper is in the. 3 %I modified the code in order to produce the Poincare section shown in Fig 3. In dimension two, the problem is said to be critical as the conservation law (the mass of the solution), is left invariant by the scaling symmetry of the equation. Course Objective: In this course, the student will develop the knowledge in the basic theory and. Gavin Fall, 2018 This document describes free and | {
"domain": "go.th",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517469248845,
"lm_q1q2_score": 0.815034572151864,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 1474.8000211455706,
"openwebmath_score": 0.5105333924293518,
"tags": null,
"url": "http://area6.pacc.go.th/akrxfvo/buo83.php?sy=nonlinear-spring-matlab"
} |
quantum-mechanics, quantum-information, quantum-optics, density-operator
EDIT: Let's have a look at coherency matrices and the Jones vector. The Jones vector (as in here) is a vector $e\in \mathbb{C}^2$ (more precisely, in the projective version thereof, since the global phase doesn't really matter). It is a pure state of polarization. By, definition, the coherency matrix is given by $ee^{\dagger}$, hence it is an operator in $\mathcal{B}(\mathbb{C}^2)=\mathbb{C}^{2\times 2}$. This is exactly the definition of the density matrix of a pure state. This gives you the argument: Since the general coherency matrix is a $2\times 2$ complex matrix (as a qubit-matrix) and behaves exactly like a mixture of pure polarization states, which are states in $P\mathbb{C}^2$ (as are quantum states), from a purely mathematical perspective, where the density matrix is a normalized mixture of pure quantum states, the polarization matrix is also a density matrix. | {
"domain": "physics.stackexchange",
"id": 18041,
"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-information, quantum-optics, density-operator",
"url": null
} |
# Math Help - Find the Indicated Integrals
1. ## Find the Indicated Integrals
I'm supposed to find several indefinite integrals, but I am not sure exactly how to do each, especially as they involve natural logs and trigonmetric functions.
The three are:
$\int ln(x^4)/x$ dx
$\int$((e^t^x) cos (e^t))/(3+5 sin (e^t))
and lastly
$\int (superscript 4/5, subscript 0) (sin^-1 ((5/4)x))/(sqrt(16-25x^2))$
2. Hi
Originally Posted by Pikeman85
$\int ln(x^4)/x$ dx
$\frac{\ln(x^4)}{x}=\frac{4\ln x}{x}=4\times \frac{1}{x}\times \ln x$ and as the derivative of $x\mapsto \ln x$ is $x\mapsto\frac{1}{x}$...
$\int$((e^t^x) cos (e^t))/(3+5 sin (e^t))
Is it $\int \frac{\mathrm{e}^{tx} \cos (\mathrm{e}^t)}{3+5 \sin (\mathrm{e}^t)}\,\mathrm{d}{\color{red}x}$ or $\int \frac{\mathrm{e}^{tx} \cos (\mathrm{e}^t)}{3+5 \sin (\mathrm{e}^t)}\,\mathrm{d}{\color{red}t}$ ? | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799451753697,
"lm_q1q2_score": 0.8052222756104829,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 1749.1477419547125,
"openwebmath_score": 0.9773095846176147,
"tags": null,
"url": "http://mathhelpforum.com/calculus/41982-find-indicated-integrals.html"
} |
electric-circuits, electric-current, electrical-resistance, voltage, electrical-engineering
Sure. First note that the equation is for the loop clockwise (the signs would be reversed if counter-clockwise) that includes the voltage across $R_2$ ($v_1$) the voltage across the dependent voltage source, and the voltage across independent current source ($v_2$).
Now, before going 'round the loop, I would add a "plus" sign at the top of $R_2$ and at the top of current source. Why? This sign denotes the reference polarity, i.e., $v_1$ is positive when the top of $R_2$ is more positive than the bottom and similarly for the current source.
The rule for KVL is this: as you go around the loop, if you enter the "plus" marked end of the component, the voltage variable has a positive sign else it has a negative sign. | {
"domain": "physics.stackexchange",
"id": 90639,
"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": "electric-circuits, electric-current, electrical-resistance, voltage, electrical-engineering",
"url": null
} |
ros, rocon, multimaster, namespace
Originally posted by joq with karma: 25443 on 2017-01-27
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by anonymous4756 on 2017-02-01:
Thanks for pointing to this link
Comment by Will Chamberlain on 2018-01-04:
The answer is correct: namespacing each system is almost always a good idea, and I'd prefer to see the ROS tutorials using namespacing throughout.
master_sync.py in dpirozzo's Bitbucket multimaster is easily changed to advertise topics with prefixes. Uses foreign_relay and the ROS Master API. | {
"domain": "robotics.stackexchange",
"id": 26848,
"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, rocon, multimaster, namespace",
"url": null
} |
c#, parsing
The result for the test expression is:
Type Position Value
Value 0 14
ListItemSeparator 2 ,
Value 3 18
ListItemSeparator 5 ,
Value 6 3
RangeSeparator 7 -
Value 8 39
StepSeparator 10 /
Value 11 3
ListItemSeparator 12 ,
Value 13 52
FieldSeparator 15
Value 16 0
StepSeparator 17 /
Value 18 5
FieldSeparator 19
Value 20 14
ListItemSeparator 22 ,
Value 23 18
ListItemSeparator 25 ,
Value 26 3
RangeSeparator 27 -
Value 28 39
ListItemSeparator 30 ,
Value 31 52
Extension 33 W
FieldSeparator 34 | {
"domain": "codereview.stackexchange",
"id": 23629,
"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",
"url": null
} |
ros, navigation, ros-kinetic, navsat-transform-node, robot-localization
Now configuration files:
ekf_template.yaml:
frequency: 30
sensor_timeout: 0.1
two_d_mode: true #false zona plana
transform_time_offset: 0.0
transform_timeout: 0.0
print_diagnostics: true
debug: false
debug_out_file: /path/to/debug/file.txt
publish_tf: true
publish_acceleration: false
map_frame: map # Defaults to "map" if unspecified
odom_frame: odom # Defaults to "odom" if unspecified
base_link_frame: base_link # Defaults to "base_link" if unspecified
world_frame: odom # Defaults to the value of odom_frame if unspecified
odom0: /get_orientation/odometry #position + orientation
odom0_config: [true, true, true,
true, true, true,
false, false, false,
false, false, false,
false, false, false]
odom0_differential: false
odom0_relative: true
odom0_nodelay: false
odom0_queue_size: 5 | {
"domain": "robotics.stackexchange",
"id": 34200,
"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, navsat-transform-node, robot-localization",
"url": null
} |
comparative-review, time-limit-exceeded, matrix, r
I <- 60
N <- 1000
dat <- MASS::mvrnorm(N, mu = rep(0, I), diag(I))
rownames(dat) <- paste0("G", 1:N)
# Comparison
res1 <- microbenchmark(
f1(dat),
f2(dat),
f3(dat),
times = 10
)
print(res1, unit = "s")
# Unit: seconds
# expr min lq mean median uq max neval cld
# f1(dat) 0.4333447 0.4609346 0.4880110 0.4863479 0.5050751 0.5782526 20 c
# f2(dat) 0.3585121 0.3729532 0.4021378 0.3979831 0.4269367 0.4899676 20 b
# f3(dat) 0.1483598 0.1610634 0.1782496 0.1787396 0.1934256 0.2273650 20 a
autoplot(res1)
Update
If we calculate correlation with base function and p.value - ourselves, we can get rid of for loop and do all of this much faster. Only problems my arise if your data contains missing values:
pcor <- function(r, n){
t <- r * sqrt(n - 2) / sqrt(1 - r^2)
p <- 2 * (1 - pt(abs(t), (n - 2)))
p[p > 1] <- 1
p
} | {
"domain": "codereview.stackexchange",
"id": 27126,
"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": "comparative-review, time-limit-exceeded, matrix, r",
"url": null
} |
algorithms, combinatorics, sets
A simple iterative procedure constructs such a query. Let the properties be $P_1,\ldots,P_k$. | {
"domain": "cs.stackexchange",
"id": 8466,
"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, combinatorics, sets",
"url": null
} |
Hope that helps.
Cheers,
Lauren. =)
oh okay
so i have
<0> = {0}
<1> = {0,1,2,3,4,5} = Z6
<2> = {0,2,4}
<3> = {0,3}
so there are 4 subgroups?
thanks for your replies!
jbunniii
Homework Helper
Gold Member
oh okay
so i have
<0> = {0}
<1> = {0,1,2,3,4,5} = Z6
<2> = {0,2,4}
<3> = {0,3}
so there are 4 subgroups?
thanks for your replies!
Correct!
didn't you forget
$$<|4|>={[0],[4],[2]}$$
and
$$<|5|>=<[1]>$$??
Last edited:
jbunniii
Homework Helper
Gold Member
didn't you forget
$$<|4|>={[0],[4],[2]}$$
and
$$<|5|>=<[1]>$$??
But <4> = <2> and <5> = <1>, so they were not omitted.
Deveno
But <4> = <2> and <5> = <1>, so they were not omitted.
true enough, but this is worth verifying (at least once), to illustrate that generators of cyclic subgroups need not be unique (if a cyclic subgroup is of prime order, there are LOTS of choices for a generator). | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822876976669629,
"lm_q1q2_score": 0.8329483027337954,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 634.5712068246139,
"openwebmath_score": 0.6752517819404602,
"tags": null,
"url": "https://www.physicsforums.com/threads/subgroups-of-z6.386552/"
} |
ros2
ld.add_action(trajectory_controller_node)
ld.add_action(avoidance_node)
return ld
Currently, I use number_of_uavs = int(input("how many uavs do you want to simulate? ")) To get the number of vehicles and then change the namespace of the node in each iteration.
Is there a better way to pass this parameter instead of prompting the user to enter it?
Originally posted by mamado on ROS Answers with karma: 61 on 2021-04-23
Post score: 5
Original comments
Comment by 130s on 2023-04-28:
IIUC, you're asking for a better option than (statically) passing arg upon execution (e.g. via cmdline). But in the subject you said "how to pass command args", which contradicts to what you're asking in the question body. I modified the subject to try to describe what you really want.
I am not sure if it's better, but you could use sys.argv:
import sys
for arg in sys.argv:
if arg.startswith("number_of_uavs:=")
number_of_uavs = int(arg.split(":=")[1]) | {
"domain": "robotics.stackexchange",
"id": 36355,
"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",
"url": null
} |
ros2, moveit, ubuntu, colcon
That said, I'm running through the MoveIt getting started documentation (in a Windows WSL2 instance) and can't get past the compile step:
colcon build --mixin release
There's the following error:
...
[Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization]
[Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization]
[Processing: moveit_setup_app_plugins, moveit_setup_controllers, moveit_setup_core_plugins, moveit_setup_srdf_plugins, moveit_task_constructor_visualization]
--- stderr: moveit_task_constructor_visualization
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated. | {
"domain": "robotics.stackexchange",
"id": 38630,
"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, moveit, ubuntu, colcon",
"url": null
} |
hydrology, gis
Title: What divides Hydrological Unit Code areas of the same level? I'm trying to better understand the Hydrological Unit Code (HUC) system of the United States. I understand the basic hierarchy of it (HUC4, 6, 8, 12) and watersheds/drainage areas. Here's what I want to clarify:
A group of HUC8s can be within a single HUC6, because each HUC8 ultimately drains to the pour point of their parent HUC6. What separates one HUC8 from another HUC8 downstream of it, both within the same parent Hydrologic Unit? I suspect the answer isn't the natural drainage area, because the downstream HUC8 would contain the upstream HUC8 in its natural drainage area - that's based on me thinking that as you shift the discharge point you're examining further downstream, the drainage area you're examining increases.
The most concise, relevant explanation I've come across is from the USEPA's EnviroAtlas Data Fact Sheet on the subject: | {
"domain": "earthscience.stackexchange",
"id": 810,
"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": "hydrology, gis",
"url": null
} |
pressure, space, ice
Title: Does ice melt slower in space? If you have an ice block in the International Space Station would it melt more slowly than on Earth at the same temperature and pressure. The reason I ask is that ice can melt due to pressure. The ice block on Earth has a certain weight which presses down on the lower layers of ice within itself sort of like how my body puts pressure on my feet when I stand. If this causes the ice block to melt more quickly on Earth then would the same ice block take longer to melt in zero gravity? Well, the temperature profile of an object on the macroscopic scale is governed by,
$${{dT} \over {dt}}=\kappa \cdot \nabla^2 T $$
Where T is the temperature, t is time, and $\kappa$ is the thermal diffusivity. It's the constant that matters here. The larger the constant, the faster the temperature changes. The equation itself is called the Heat Equation.
$$\kappa={{\lambda} \over {\rho \cdot c_p}}$$ | {
"domain": "physics.stackexchange",
"id": 24244,
"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": "pressure, space, ice",
"url": null
} |
ros, catkin-make, catkin, camera1394, rosconsole
make[3]: Leaving directory `/root/rosbuild_ws/camera1394/build'
[ 7%] Built target rosbuild_precompile
make[3]: Entering directory `/root/rosbuild_ws/camera1394/build'
Scanning dependencies of target camera1394_node
make[3]: Leaving directory `/root/rosbuild_ws/camera1394/build'
make[3]: Entering directory `/root/rosbuild_ws/camera1394/build'
[ 15%] Building CXX object src/nodes/CMakeFiles/camera1394_node.dir/camera1394_node.cpp.o
In file included from /root/rosbuild_ws/camera1394/src/nodes/driver1394.h:44:0,
from /root/rosbuild_ws/camera1394/src/nodes/camera1394_node.cpp:38:
/root/catkin_ws/install/include/driver_base/driver.h: In static member function ‘static const string& driver_base::Driver::getStateName(driver_base::Driver::state_t)’:
/root/catkin_ws/install/include/driver_base/driver.h:238:14: warning: comparison is always true due to limited range of data type [-Wtype-limits] | {
"domain": "robotics.stackexchange",
"id": 13291,
"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, catkin-make, catkin, camera1394, rosconsole",
"url": null
} |
nmr-spectroscopy
Phys. Chem. Chem. Phys., 2007, 9, 2791–2816. Calculation and analysis of NMR spin–spin coupling constants
Annu. Rep. NMR Spectrosc. 2000, 41, 55–184. Advances in theoretical and physical aspects of spin-spin coupling constants | {
"domain": "chemistry.stackexchange",
"id": 8323,
"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": "nmr-spectroscopy",
"url": null
} |
time, frequency, measurements, electronics, electrical-engineering
Title: What oscilloscope spec to use? I want to measure a pulse signal using an oscilloscope. The expected rising edge of the signal is in the 1 to 5 ns scale.
I have a 20 MHz oscilliscope. Is it correct that the rising edge of the oscilloscope would be limited to 17.5 ns? In other words, do I need to use a faster oscilloscope?
How does a 20MHz oscilloscope measure in the ns scale and what is the limit? The standard rule of thumb is the the rise time limit of an oscilloscope is about equal to (0.35)/(bandwidth). This means you can't resolve a 5 nanosecond rise event with a 20MHz scope. | {
"domain": "physics.stackexchange",
"id": 83241,
"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": "time, frequency, measurements, electronics, electrical-engineering",
"url": null
} |
beginner, ruby, game
Generally, if you've encapsulated stuff well, the various parts of the code know as little as possible about the rest of the system. For instance, a Player object doesn't know about prompting the user; it's just told its skill level. A Game object may not know anything about skill levels or frames, it just knows it's got, say, 3 player objects. And perhaps you have a Frame class, which doesn't know much about anything - it just stores (and perhaps generates) 2 numbers and a total. That's decoupling in a nutshell. "Compartmentalization" would be another word to describe it and encapsulation. | {
"domain": "codereview.stackexchange",
"id": 9859,
"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": "beginner, ruby, game",
"url": null
} |
astronomy, telescopes, luminosity
If my calculations are correct, do the scientific instruments on say, Hubble work with such a small amount of light?
How many Watts of light does the Camera on these telescopes need to work properly? Hubble Space Telescope was fitted with Wide-Field Camera (WFC3) instrument in 2009.
The camera sports two channels Ultraviolet/visual (UVIS) and Near-infrared (NIR).
UVIS sensor is a coupled-charge device, capable of receiving single photons.
However, a single photon is unlikely to provide you much useful information, considering that there is read noise (3.1 electrons per pixel) and dark current of 7 electrons per pixels per hour. The number of photons to get above the noise level depends on time of exposure and wavelength. Source: http://www.stsci.edu/hst/proposing/documents/primer/Ch_48.html
Source: WFC3 User's Handbook | {
"domain": "physics.stackexchange",
"id": 8972,
"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": "astronomy, telescopes, luminosity",
"url": null
} |
kinematics, momentum, energy-conservation, collision
Px(before) = Px(after)
Py(before) = Py(after)
KE(before) = KE(after)
The problem
So the pickle is that I have 3 equations, but 4 unknown variables (the new velocities).
If it makes it easier, suppose mass is uniformly distributed over the area of a given circle.
question-1a:
Do I need to make additional assumptions in order to find a unique solution to this problem? If not, then
question-1b:
Have I misunderstood the application of the conservation of momentum for the case when the objects colliding are not point particles?
I can't help but think torque has something to do with it. When the circles strike, it feels like there would be a tendency for them to spin. Is that relevant? I see that you are trying to count the degrees of freedom (DoF) and the number of equations. The answer to this is quite fun and subtle.
So the pickle is that I have 3 equations, but 4 unknown variables (the new velocities). | {
"domain": "physics.stackexchange",
"id": 96765,
"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": "kinematics, momentum, energy-conservation, collision",
"url": null
} |
our google custom search here. Discrete Mathematics and Its Applications, Seventh Edition answers to Chapter 2 - Section 2.5 - Cardinality of Sets - Exercises - Page 176 12 including work step by step written by community members like you. is also countable. $\mathbb{Z}=\{0,1,-1,2,-2,3,-3,\cdots\}$. To provide We say that two sets A and B have the same cardinality, written |A|=|B|, if there exists a bijective function from A to B. This is because we can write $$A = \{a_1, a_2, a_3, \cdots \},$$ Is it possible? $$|W|=10$$ A nice resource book would be 'stories about sets' which the authors explianed were things every student at Moscow University learned around the common room but not in any classes! 1. First Published 2019. We can, however, try to match up the elements of two infinite sets A and B one by one. Cardinality of infinite sets The cardinality |A| of a finite set A is simply the number of elements in it. Proving that two sets have the same cardinality via exhibiting a bijection | {
"domain": "atozmobileapps.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759638081522,
"lm_q1q2_score": 0.8297646111405583,
"lm_q2_score": 0.84594244507642,
"openwebmath_perplexity": 676.457605556357,
"openwebmath_score": 0.8642045259475708,
"tags": null,
"url": "https://www.atozmobileapps.com/bkx3c20/b7b0d5-how-to-prove-cardinality-of-sets"
} |
quantum-field-theory, quantum-electrodynamics, effective-field-theory
Yes, but that doesn't necessarily mean we know how to express it in terms of the basic fields in QED. In fact, this is a very difficult problem.
Why it's so difficult
To get some appreciation for just how difficult it is, spend a few minutes thinking about how you would answer this seemingly-easier question: Which state in QED has the lowest energy?$^\dagger$ As far as I know, the answer is known only when the coupling constant $e$ is zero. For $e\neq 0$, we can use perturbation theory to calculate correlation functions, but we cannot use perturbation theory to calculate states. When we try, we discover that the large (formally infinite) number of degrees of freedom in quantum field theory overwhelms the smallness of the coupling constant: the slightest change in the coupling constant makes all of the perturbed states orthogonal to all of the original states. | {
"domain": "physics.stackexchange",
"id": 70597,
"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, quantum-electrodynamics, effective-field-theory",
"url": null
} |
Hi Loren,
I just learned about these tools from this blog, so thanks for the updates. Sometimes we miss the new features in each release, so these are a great way to learn. A few thoughts…
I’d like to see more output information, for example, how many function evals were taken? A nice idea is to return an exit flag, much as the optimization tools do. That flag might indicate whether the result meets the stopping tolerances, or if some problem was identified. So if an exitflag output is returned, then no warning messages need be generated, allowing the user to gather that information via an output argument.
John
Loren Shure replied on : 2 of 4
Thanks for the suggestions, John. Will enter them for the team.
–Loren
Mike Hosea replied on : 3 of 4 | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854120593483,
"lm_q1q2_score": 0.8081460320295449,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 1423.3285053321285,
"openwebmath_score": 0.6823225021362305,
"tags": null,
"url": "http://blogs.mathworks.com/loren/2013/12/26/double-integration-in-matlab-understanding-tolerances/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+mathworks%2Floren+%28Loren+on+the+Art+of+MATLAB%29"
} |
electromagnetism
Title: Interpretation of surface forces from the Maxwell Stress tensor I am studying classical electromagnetics, and reading about the Maxwell Stress tensor. But I’m unsure about what it means for a field to exert forces on a volume element. As I understand it, $T^{ij}dS_j$ (no summation) is the $i$ component of the force acting on a surface element oriented in the $j$ direction. What I’m trying to understand is what this means, for example, for a volume that contains no charge.
For brevity, I’ll assume no currents, so we can deal only with the electrostatic part of the tensor. Say we have a parallel plate capacitor supporting a uniform electric field $E_0\mathbf{\hat{z}}$. Then for a small cube inside the field, if we blindly follow the math, I believe we get
$$T = \frac{1}{2}\varepsilon_0\begin{bmatrix}E_0^2&0&0\\0&E_0^2&0\\0&0&-E_0^2\end{bmatrix},$$
(using the inward-is-positive sign convention). | {
"domain": "physics.stackexchange",
"id": 90229,
"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",
"url": null
} |
electromagnetism, electric-circuits
First of all, the term "non-constant dc" is intuitively clear, but not standard.
Still, there's a good question here about what you'd call a rectified sinusoid.
It all depends on the context.
Power supply
Suppose I build a power supply by rectifying the power line.
The result of the rectification might have the mathematical form
$$V_0 (1 + \cos(\omega t)) \, .$$
This has, as noted in the OP, a dc component and an ac component, and the language "dc component" and "ac component" is completely standard and universally understood.
Now, in a power supply, I probably filter this signal, which reduces the amplitude of the cosine part, giving e.g.
$$V_0 + V_\text{ripple} \cos(\omega t)$$
where $V_\text{ripple}$ represents the amplitude of any remaining ac component.$^{[a]}$ | {
"domain": "physics.stackexchange",
"id": 47600,
"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, electric-circuits",
"url": null
} |
rviz, turtlebot
The program 'rviz' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 21 error_code 9 request_code 55 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.) | {
"domain": "robotics.stackexchange",
"id": 7379,
"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": "rviz, turtlebot",
"url": null
} |
l, g = 5, 9.8
T = 2pi * sqrt(l/g)
x0, xn, y0, yp0 = 0, 4T, pi/4, 0
plot(euler2(x0, xn, y0, yp0, 20), 0, 4T)
ERROR: InterruptException:
Something looks terribly amiss. The issue is the step size, $h$, is too large to capture the oscillations. There are basically only $5$ steps to capture a full up and down motion. Instead, we try to get $20$ steps per period so $n$ must be not $20$, but $4 \cdot 20 \cdot T \approx 360$. To this graph, we add the approximate one:
plot(euler2(x0, xn, y0, yp0, 360), 0, 4T)
plot!(x -> pi/4*cos(sqrt(g/l)*x), 0, 4T) | {
"domain": "juliahub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126457229185,
"lm_q1q2_score": 0.8299167739301163,
"lm_q2_score": 0.847967764140929,
"openwebmath_perplexity": 858.0240248496365,
"openwebmath_score": 0.8281819224357605,
"tags": null,
"url": "https://juliahub.com/docs/CalculusWithJulia/AZHbv/0.0.5/ODEs/euler.html"
} |
gravity, cosmology, newtonian-gravity, astrophysics, conventions
Moving on to equation $(3.3)$, let's suppose the sign of the gravitational force in $(3.1)$ really is neglected. Does this mean that the negative sign in $(3.3)$ is due to $P(r+\delta r) \lt P(r)$ and hence $$\frac{GM(r)\rho(r)}{r^2}=-\left(\frac{dP}{dr}\right)\,?$$ I know this is the same equation as in $(3.3)$ but I have written it with the negative sign next to the pressure differential as I would like to know where this minus sign originates from. Does anyone know?
My final concern is the sign in $(3.4)$ as last time I checked $$g=-\frac{GM}{r^2}$$ and not $$g=\frac{GM}{r^2}$$
Hence, equation $(3.4)$ should read
$$\left(\frac{dP}{dr}\right)=\rho(r)\,g\,?$$ | {
"domain": "physics.stackexchange",
"id": 51169,
"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": "gravity, cosmology, newtonian-gravity, astrophysics, conventions",
"url": null
} |
formal-languages, context-free, formal-grammars
Identify the largest possible substring and call it $v_1$. Note that $v_1 \in K$. Then $w = u_1v_1x$, where $u_1$ consists solely of $a$'s. Note that $x$ must have at least as many $a$'s as $b$'s. If not, then one can write $u_1 = y_1y_2$ and construct a substring $y_2v_1x \in K$. But because $v_1$ was the largest possible substring, this is a contradiction.
Repeat this procedure for the first occurrence of $b$ within $x$ to get $x = u_2v_2y$. Then repeat this procedure for the first occurrence of $b$ within $y$. Doing this until no more $b$'s remain, we can write $w$ as $u_1v_1u_2v_2\dots u_nv_nu_{n+1}$, where each $u_i$ contains only $a$'s and each $x_i \in K$. Because $K \subseteq \mathcal{L}(G)$ and $G$ can clearly generate any string consisting solely of $a$'s, $w$ can be generated by $G$ via
$$
S \Rightarrow^* \underbrace{S\dots S}_{2n + 1} \Rightarrow^* u_1v_1u_2v_2\dots u_nv_nu_{n+1} = w.
$$ | {
"domain": "cs.stackexchange",
"id": 18810,
"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": "formal-languages, context-free, formal-grammars",
"url": null
} |
Last edited: Oct 25, 2009
4. Oct 25, 2009
### willem2
Re: Resistor
Your 2 loops are: +side of voltage source -> R3 -> R1 -> - side of voltage source
and
+side voltage source -> R3 -> R2 -> - side of voltage source ?
both loops contain R3. The voltage across R3 depends on the currents of both loops.
The voltage across R3 is not equal to R3*(current in one of the loops)
If 2 loops share a voltage source, it isn't a problem, because the voltage across it is
always the same.
5. Oct 25, 2009
### ehild
Re: Resistor
According to Kirchhoff''s Current Law, I3=I1+I2.
According to the loop Law,
UBC+UCA=UBA, that is
E-I3R3-I1R1=0
and E-I3R3-I2R2=0.
The total current is I3, the total voltage is E, and the resultant resistance between A and B is
RAB=E/I3, and it is the same as the first formula.
ehild
Last edited: Jun 29, 2010
6. Oct 25, 2009
### Oerg
Re: Resistor
Ahhh, you even have a diagram, I am so touched. Thanks for your effort on the forums. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575121992375,
"lm_q1q2_score": 0.8187893473249938,
"lm_q2_score": 0.8333246015211009,
"openwebmath_perplexity": 793.6450877710814,
"openwebmath_score": 0.7192986011505127,
"tags": null,
"url": "https://www.physicsforums.com/threads/consider-a-circuit-where-2-resistors-are-connected-in-parallel.348684/"
} |
Now isolate b in terms of c: $\displaystyle b^2-4n=(c-b\pm\sqrt{c^2+4n})^2$
Solution: $\displaystyle b=\frac{c^2\pm c\sqrt{c^2+4n}+4n}{c\pm\sqrt{c^2+4n}}$
Simplify by multiplying by the conjugate: $\displaystyle b=\pm\sqrt{c^2+4n}$, or equivalently, $\displaystyle c=\pm\sqrt{b^2-4n}$
Substituting, $\displaystyle 2a=b+c$
A better way of expressing the solution is by finding b,c such that $\displaystyle b^2-c^2=4n$, and let $\displaystyle a=\frac12(b+c)$
For a to be an integer, $\displaystyle b+c$ must be even, so b,c must have the same parity (both even or both odd), so $\displaystyle b-c$ is even also.
An all-integer answer can thus be gotten: Given n, factor n, and find b,c satisfying $\displaystyle b^2-c^2=4n$, or $\displaystyle \frac{b+c}{2}\frac{b-c}{2}=n$. Define a as above. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.977022625406662,
"lm_q1q2_score": 0.807716127497581,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 11153.810838227964,
"openwebmath_score": 0.9514194130897522,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/116633-system-two-equations-three-integer-unknowns.html"
} |
angular-momentum, momentum, rigid-body-dynamics
$R_f = \left| \begin{array}{ccc} 1 & 0 & 0\\ 0 & 1 & 0\\0 &0&1\end{array}\right|$
I can then combine the inertial tensors into the new local frame of reference:
$t_1 = x_f - x_1$ (translation of $I_1$)
$J_1 = \left| \begin{array}{ccc}
-(t_{1y}^2+t_{1z}^2)&t_{1x}t_{1y} &t_{1x}t_{1z} \\
t_{1x}t_{1y} &-(t_{1x}^2+t_{1z}^2)&t_{1y}t_{1z} \\
t_{1x}t_{1z} &t_{1y}t_{1z} &-(t_{1x}^2+t_{1y}^2)
\end{array} \right|$ (unscaled change)
And likewise for $J_2$
$I_f = (R_1I_1R_1^\intercal+ m_1J_1)+ (R_2I_2R_2^\intercal+m_2J_2)$
I think it's mostly right up to there. How do I find $\omega_f$ and $v_f$ so that all of the energy is accounted for? | {
"domain": "physics.stackexchange",
"id": 1937,
"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": "angular-momentum, momentum, rigid-body-dynamics",
"url": null
} |
navigation, robot-localization, ros-noetic, diff-drive-controller
[ INFO] [1703920315.169929579, 144.916000000]: Loading gazebo_ros_control plugin
[ INFO] [1703920315.170051816, 144.916000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1703920315.171993289, 144.916000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ERROR] [1703920315.285361885, 144.916000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/front_left_wheel_joint
[ERROR] [1703920315.285814208, 144.916000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/rear_left_wheel_joint
[ERROR] [1703920315.286150395, 144.916000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/front_right_wheel_joint
[ERROR] [1703920315.286822565, 144.916000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/rear_right_wheel_joint
[ INFO] [1703920315.291574976, 144.916000000]: Loaded gazebo_ros_control. | {
"domain": "robotics.stackexchange",
"id": 38884,
"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": "navigation, robot-localization, ros-noetic, diff-drive-controller",
"url": null
} |
vba, excel
record.Year = tableData(i, headerIndices("Year"))
record.Time = tableData(i, headerIndices("Time"))
record.InOut = tableData(i, headerIndices("In/out"))
' Split the addresses. If there are multiple addresses we dont need to rewrite the record, we just need to adjust the To field.
Dim splitAddresses As Variant
If InStr(tableData(i, headerIndices("To")), ";") > 0 Then
splitAddresses = Split(tableData(i, headerIndices("To")), ";")
Dim j As Long
For j = LBound(splitAddresses) To UBound(splitAddresses)
If Len(splitAddresses(i)) > 1 Then
record.To = splitAddresses(i)
records.Add record
End If
Next
Else
record.To = tableData(i, headerIndices("To"))
records.Add record
End If
Next | {
"domain": "codereview.stackexchange",
"id": 27141,
"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
} |
# Fibonacci sequence: Given $n$ and $\mathrm{Fib}(n)$, is it possible to calculate $\mathrm{Fib}(n-1)$?
Given $n$ and $\newcommand{\Fib}{\mathrm{Fib}} \Fib(n)$, is it possible to calculate the previous number in the Fibonacci sequence - $\Fib(n-1)$ using integer math in constant time? In other words, I believe I'm looking for a closed form formula.
For example: Given $n=10$ and $\Fib(10)=55$, I'd like to determine that $\Fib(9)=34$ without using $\Fib(7) + \Fib(8)$.
• Even output of $F_{n-1}$ cannot be done in constant time. (The length of binary representation of $F_{n-1}$ is linear in $n$.) But based on the wording in original post I would guess that you mean using constantly many operations with integers. Aug 20 '14 at 8:14
• @Martin Sleziak - you are correct that I meant "constantly many operations with integers" Aug 20 '14 at 13:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464453565514,
"lm_q1q2_score": 0.8643288872957339,
"lm_q2_score": 0.8856314723088732,
"openwebmath_perplexity": 180.5184766596439,
"openwebmath_score": 0.9017306566238403,
"tags": null,
"url": "https://math.stackexchange.com/questions/903613/fibonacci-sequence-given-n-and-mathrmfibn-is-it-possible-to-calculate"
} |
FAST FORWARD: Through lots of trial-and-error, students eventually propose $y=-a\cdot x^2+c$. That’s nice, but writing an equation isn’t a proof. One of the most elegant proofs I’ve seen solves the system of equations defined by the original generic quadratic family and the proposed path of the vertex. A CAS is obviously an appropriate tool in this situation.
There are two solutions: $(\frac{-b}{2\cdot a},\frac{4\cdot a\cdot c-b^2}{4\cdot a})$ and $(0,c)$ implying two graphical intersections, a fact verified by the vertex trace image above. The proof lies in the first ordered pair–the generic form of the coordinates of the vertex of $y=a\cdot x^2+b\cdot x+c$–clearly establishing that the generic vertex always travels on the proposed path. Nice. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180690117798,
"lm_q1q2_score": 0.8104466778058709,
"lm_q2_score": 0.8221891261650248,
"openwebmath_perplexity": 1057.2464937205034,
"openwebmath_score": 0.5173761248588562,
"tags": null,
"url": "https://casmusings.wordpress.com/2012/06/"
} |
parity
Title: Is a magnet and bouncy balls a case of parity violation? This may well be a very odd question; however, I'm currently studying parity violation and it came to mind that, if a Cobalt-60 atom decaying by the weak force and emitting more electrons opposite the magnetic field direction is a parity violation (since in its mirror image, more electrons are emitted in the direction of the magnetic field), why could I not simply take a macroscopic magnet which I have designed to emit particles (e.g. bouncy balls) in one direction and not the other. Then, in a mirror, the magnetic field direction, since it is an axial vector, would not change, but the direction of particle emission would and so the mirror image would not be symmetrical and there would be a parity violation. Could someone tell me if and where I'm wrong? Here is another take. It does not matter if you can do it macroscopically. Sure you can build a bar magnet that only ejects particles from one side and not the other. But | {
"domain": "physics.stackexchange",
"id": 82086,
"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": "parity",
"url": null
} |
syms
Create symbolic variables and functions
Syntax
``syms var1 ... varN``
``syms var1 ... varN [n1 ... nM]``
``syms var1 ... varN n``
``syms ___ set``
``syms f(var1,...,varN)``
``syms f(var1,...,varN) [n1 ... nM]``
``syms f(var1,...,varN) n``
``syms(symArray)``
``syms``
``S = syms``
Description
example
````syms var1 ... varN` creates symbolic variables `var1 ... varN`. Separate different variables by spaces. `syms` clears all assumptions from the variables.```
example
````syms var1 ... varN [n1 ... nM]` creates symbolic arrays `var1 ... varN`, where each array has the size `n1`-by-`...`-by-`nM` and contains automatically generated symbolic variables as its elements. For example, ```syms a [1 3]``` creates the symbolic array `a = [a1 a2 a3]` and the symbolic variables `a1`, `a2`, and `a3` in the MATLAB® workspace. For multidimensional arrays, these elements have the prefix `a` followed by the element’s index using `_` as a delimiter, such as `a1_3_2`.```
example | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.971129089711396,
"lm_q1q2_score": 0.8195310827556981,
"lm_q2_score": 0.8438951025545426,
"openwebmath_perplexity": 2025.6147522753631,
"openwebmath_score": 0.5800818204879761,
"tags": null,
"url": "https://nl.mathworks.com/help/symbolic/syms.html"
} |
ros2
<!-- <collision>-->
<!-- <origin xyz="0 0 0" rpy="0 0 0"/>-->
<!-- <geometry>-->
<!-- <cylinder radius="0.0508" length="0.055"/>-->
<!-- </geometry>-->
<!-- </collision>-->
<!-- <visual>-->
<!-- <origin xyz="0 0 0" rpy="0 0 0"/>-->
<!-- <geometry>-->
<!-- <cylinder radius="0.0508" length="0.055"/>-->
<!-- </geometry>-->
<!-- </visual>-->
<!-- </link>--> | {
"domain": "robotics.stackexchange",
"id": 36808,
"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",
"url": null
} |
image, swift, ios, extension-methods
guard maxLength > limit else {
return self
}
let downscaleDivisor = maxLength / limit
let downscaledDimensions = CGSize(width: width / downscaleDivisor,
height: height / downscaleDivisor)
return UIGraphicsImageRenderer(size: downscaledDimensions).image { (_) in
draw(in: CGRect(origin: .zero, size: downscaledDimensions))
}
}
} | {
"domain": "codereview.stackexchange",
"id": 43697,
"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, swift, ios, extension-methods",
"url": null
} |
electromagnetism, electrostatics, stress-energy-momentum-tensor
When you have $\vec \nabla \cdot \vec J =-\partial \rho / \partial t$ you know that all three components of $\vec J$ are needed to get $\rho$ similarly $T_{xx}, T_{yx} $ and $T_{zx}$ are all needed to get $f_x.$ There is no reason to focus on the $T_{xx}$ in isolation because if $\mathscr P_x$ is the density of x momentum then $\partial_x T_{xx}+\partial_y T_{yx}+\partial_z T_{zx}=\partial_t\mathscr P_x.$
Just as $\vec J$ measures the flow of charge, so does $T_{xx}\hat x+T_{yx}\hat y+T_{zx}\hat z$ measure the flow of $\mathscr P_x.$ | {
"domain": "physics.stackexchange",
"id": 23488,
"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, electrostatics, stress-energy-momentum-tensor",
"url": null
} |
BSchool Forum Moderator
Joined: 26 Feb 2016
Posts: 3042
Location: India
GPA: 3.12
Four hours from now, the population of a colony of bacteria will reach [#permalink]
### Show Tags
06 May 2018, 08:13
1
dave13 wrote:
carcass wrote:
Four hours from now, the population of a colony of bacteria will reach 1.28 * $$10 ^ 6$$. If the population of the colony doubles every 4 hours, what was the population 12 hours ago?
A. 6.4 * $$10 ^ 2$$
B. 8.0 * $$10 ^ 4$$
C. 1.6 * $$10 ^ 5$$
D. 3.2 * $$10 ^ 5$$
E. 8.0 * $$10 ^ 6$$
pushpitkc, is my approach / reasoning correct ?
1.28 * $$10 ^ 6$$ means we need to move decimal point 6 points to the right so it is 1,280,000, so i just leave out zeros and work with 128
if in 4 hours the population will be 128, then now it is 64
4 hours ago it was 32
8 hours ago 16
12 hrs ago 8
so all i need is to add 4 zeros and express it like this $$8*10^4$$ | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924745261419,
"lm_q1q2_score": 0.8078647796421216,
"lm_q2_score": 0.8311430394931457,
"openwebmath_perplexity": 3511.696114538048,
"openwebmath_score": 0.668043851852417,
"tags": null,
"url": "https://gmatclub.com/forum/four-hours-from-now-the-population-of-a-colony-of-bacteria-will-reach-243844.html"
} |
echo "${FNAME}:dll 2:(\$FNAME;${#CMDARGS[*]})" done echo "\\l rmath_aux.q" This generates a set of link commands such as the following: dll::rmath rn:dll 2:(rn;2) rnn:dll 2:(rnn;3) dn:dll 2:(dn;3) pn:dll 2:(pn;3) qn:dll 2:(qn;3) sseed:dll 2:(sseed;2) gseed:dll 2:(gseed;1) nchoosek:dll 2:(nchoosek;2) It also generates a call to load a second q script, rmath_aux.q, which contains a bunch of q wrappers and helper functions (I will write a separate post about that later). A makefile is included which generates the shared lib (once the appropriate paths to the R source files is set) and q scripts. A sample q session looks like the following: q) \l rmath.q q) x:rnorm 1000 / generate 1000 normal variates q) dnorm[0;0;1] / normal density at 0 for a mean 0 sd 1 distribution The project is available on github: https://github.com/rwinston/kdb-rmathlib. Note that loading rmath.q loads the rmath dll, which in turn loads the rmathlib dll, so the rmathlib dll should be available on the dynamic | {
"domain": "theresearchkitchen.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9881308786041316,
"lm_q1q2_score": 0.8124304614636026,
"lm_q2_score": 0.8221891239865619,
"openwebmath_perplexity": 2287.870760814901,
"openwebmath_score": 0.6073945760726929,
"tags": null,
"url": "http://www.theresearchkitchen.com/blog"
} |
solubility, water-treatment
I tried to figure out if silver chloride formation takes precedence (so to speak) over forming silver phosphates using enthalpies of formation, but I got lost with that a bit. The key concept here is solubility products which are a form of chemical equilibria. Once you have understood that, you will realise that it depends on the ions’ concentrations and relative solubilities which one will precipitate first.
In general, you have to consider the following principal equilibria:
$$\ce{Ag3PO4 v + 3 Cl- (aq) <=>[$k_1$] 3 Ag+ (aq) + 3 Cl- (aq) + PO4^3- <=>[$k_2$] 3 AgCl v + PO4^3-}\tag{1}$$
and futher ones that derive from the acidity equilibrium of the phosphate anions as well as the formation of silver hydroxide at higher $\mathrm{pH}$ values. I will choose to ignore these.
Equilibrium $k_1$ is actually only the precipitation of silver phosphate; we might instead write it as:
$$\ce{3 Ag+ (aq) + PO4^3- (aq) <=>[$k_1$] Ag3PO4 v}\tag{2}$$
The equilibrium constant is thus: | {
"domain": "chemistry.stackexchange",
"id": 8797,
"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": "solubility, water-treatment",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.