text stringlengths 1 1.11k | source dict |
|---|---|
ros, ros2, armhf
However, if your using a raspberry pi 3, there are arm64v8 images you could use so you could install ROS2 from the release arm64 debains:
https://discourse.ros.org/t/installing-ubuntu-18-04-arm64v8-on-raspberry-pi-3/6094/8 | {
"domain": "robotics.stackexchange",
"id": 32779,
"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, ros2, armhf",
"url": null
} |
• Unless I am mistaken, the intermediate equations make sense only for integral $x$. – Martin R Oct 22 '15 at 14:32
• Actually $(6)$ is general, and satisfies $(1)$ for any real $x$. The intermediate equations are just tools to get to $(6)$. – Zach466920 Oct 22 '15 at 14:34
• Filling a detail omitted in the above: let $y \in [0,1)$, then consider $x=y+n$ for nonnegative integers $n$. Following the argument above you get $f(x)=f(y)+\frac{e^n-1}{e-1}$. Note that the values of $f(y)$ can be chosen completely arbitrarily. – Ian Oct 22 '15 at 14:40
• And instead of $f(0)$ you could put an arbitrary function of the floor of $x$. – GEdgar Oct 22 '15 at 14:41
• @user1942348 I edited the answer. The solution is more general, and will work with any periodic function $g(x)$, with period 1, and $g(0)=f(0)$. Just pick an appropriate $g(x)$, or constant, to satisfy your initial condition. – Zach466920 Oct 22 '15 at 15:05 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668684574637,
"lm_q1q2_score": 0.867390055162947,
"lm_q2_score": 0.8840392832736084,
"openwebmath_perplexity": 261.8830612384207,
"openwebmath_score": 0.9218086004257202,
"tags": null,
"url": "https://math.stackexchange.com/questions/1492350/find-fx-if-delta-fx-ex"
} |
electrons, wavefunction
Title: What is the difference between product wave function and true wave function for many electron system I know expression for product wave function, and I know true wave function for many electron system can't be expressed.
But can someone tell me what is missing in the product wave function?
What is the approximation? The electronic Hamiltonian for a multi-electron atom (or molecule) generally contains three components. (When I write "electronic Hamiltonian", the Born-Oppenheimer approximation - which allows for separation of electronic and nuclear motion - is already implicitly invoked.)
$$\hat{H} = \sum_i{\hat{T}_i} + \sum_i\sum_a{\hat{V}^\mathrm{en}_{ia}} + \sum_i\sum_{j>i}{\hat{V}^\mathrm{ee}_{ij}}$$ | {
"domain": "physics.stackexchange",
"id": 36010,
"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, wavefunction",
"url": null
} |
coordination-compounds
Title: Werner's theory and complex salts According to Werner's theory, metal ions have two types of valency-primary and secondary, where the primary valency is said to be satisfied by negative ions only, and the secondary valency can be satisfied by positive ligand, negative or neutral molecule.
My question here is:
While formation of complex compounds, which of these valencies is satisfied?
What I'm not able to interpret from this is whether there is a 'possibility' for both the valencies being satisfied or is it necessary that both are satisfied?
Also if the later is true how is it possible? Can it be explained taking some example as reference.
I think I'm not able to interpret it and understand its details. A certain number of ions, atoms or molecules closely associate around a central atom leading to the formation of distinct entity called coordination complex. | {
"domain": "chemistry.stackexchange",
"id": 4708,
"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": "coordination-compounds",
"url": null
} |
general-relativity, metric-tensor, parity
Title: Parity violating metrics Is there are an example of a parity-violating metric? If so, how do they look like? Are Einstien equations parity invariant? What does it mean for a manifold or a metric to be parity invariant? To prove parity invariance of a set of equations:
First decide how each term in each equation would change under parity inversion. E.g. vectors change sign, pseudo-vectors do not, etc.
Replace each term by what it would be under parity-inversion.
Find out if the resulting equations are precisely the same as the ones you started with.
Tensor notation makes this pretty quick in the case of GR. You mainly need to think about the stress-energy tensor. | {
"domain": "physics.stackexchange",
"id": 76501,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, metric-tensor, parity",
"url": null
} |
• does the answer remain the same if you expand the original expression with (e^x) I was wondering about that because I just recognized that the original f(x) = sigmoid function and it is sometimes given in the form of f(x) = e^x/ (1+e^x) Feb 12 '19 at 2:16
Recall that $$\left(\dfrac{u}v\right)'=\dfrac{vu'-uv'}{v^2}.$$
So applying quotient rule will give you $$D\left(\frac1{1+e^{-x}}\right)=\frac{ (1+e^{-x})\cdot D(1)-1\cdot D(1+e^{-x}) }{ (1+e^{-x})^2 }=\frac{0-1\cdot (-e^{-x}) }{ (1+e^{-x})^2 }=\frac{e^{-x}}{ (1+e^{-x})^2 }.$$
How about using the power rule and the chain rule?
$${(1+e^{-x})^{-1}}'=-1(1+e^{-x})^{-2}\cdot (-e^{-x})=\frac{e^{-x}}{(1+e^{-x})^2}$$.
Yes, so as they said you have two different formulas. You have: $$\left(\dfrac{u}v\right)'=\dfrac{vu'-uv'}{v^2}.$$
and: $$D\left(\frac {f(x)}{g(x)}\right)=\frac {f'(x)g(x)-g'(x)f(x)}{(g(x))^2}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9763105335255604,
"lm_q1q2_score": 0.8218832448665152,
"lm_q2_score": 0.8418256452674008,
"openwebmath_perplexity": 364.1368181100069,
"openwebmath_score": 0.8937541246414185,
"tags": null,
"url": "https://math.stackexchange.com/questions/3109537/calculating-the-derivative-of-frac11e-x-using-quotient-rule"
} |
rust, union-find
/// Performs a union for the two sets containing the given elements.
/// Returns Some(true) if the operation was performed, Some(false) if not,
/// and None if either element doesn't exist.
///
/// # Example
/// ```
/// let mut ds = DisjointSet::new();
///
/// // Ommitted: adding 5 seperate elements to the set a..e
/// # let a = ds.make_set(1).unwrap();
/// # let b = ds.make_set(2).unwrap();
/// # let c = ds.make_set(3).unwrap();
/// # let d = ds.make_set(4).unwrap();
/// # let e = ds.make_set(5).unwrap();
///
/// assert_eq!(ds.union(a, b), Some(true));
///
/// assert_eq!(ds.same_set(a, b), Some(true));
/// assert_eq!(ds.num_sets(), 4);
///
/// assert_eq!(ds.union(a, b), Some(false));
/// assert_eq!(ds.union(c, d), Some(true));
/// assert_eq!(ds.union(e, c), Some(true));
///
/// // Now we have {a, b} and {c, d, e}
///
/// assert_eq!(ds.num_sets(), 2); | {
"domain": "codereview.stackexchange",
"id": 40739,
"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": "rust, union-find",
"url": null
} |
c++, reinventing-the-wheel
// It would be nice to prevent this kind of accidental call
}
Also you don't allow for construction with nullptr. Sure it is rare, but it would be nice if you could explicitly use nullptr without having to do anything special.
MySharedPtr<int> value(nullptr); // fails to compile.
I would consider this old school.
MySharedPtr& operator=(MySharedPtr&& other) noexcept {
return moveAssignment(move(other));
}
MySharedPtr& operator=(const MySharedPtr& other) {
return copyAssignment(other);
}
template<typename U>
MySharedPtr& copyAssignment(const MySharedPtr<U>& other) {
if (cb != other.cb) {
MySharedPtr tmp(other);
swap(tmp);
}
return *this;
}
template<typename U>
MySharedPtr& moveAssignment(MySharedPtr<U>&& other) {
MySharedPtr tmp(move(other));
swap(tmp);
return *this;
} | {
"domain": "codereview.stackexchange",
"id": 45120,
"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++, reinventing-the-wheel",
"url": null
} |
Answer to question 1: $\left\lceil \log_2 \binom{M-1}{r-1} \right\rceil$ bits suffice to encode the variables.
Proof: Count how many ways there are to choose $y_1,\ldots,y_r$ such that $y_i \ge 0$ and $\sum y_i = M-r$. There are exactly $\binom{M-1}{r-1}$ such ways (see e.g. here). Now, if there are only $k$ possible values for a variable, then $\lceil \log k \rceil$ bits suffice to encode that variable. Therefore, $opt=\left\lceil \log_2 \binom{M-1}{r-1} \right\rceil$ bits suffice to encode our input. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211597623863,
"lm_q1q2_score": 0.808067082260847,
"lm_q2_score": 0.8289387998695209,
"openwebmath_perplexity": 208.5336159414389,
"openwebmath_score": 0.7463853359222412,
"tags": null,
"url": "https://cstheory.stackexchange.com/questions/24885/number-of-bits-required-for-encoding-variables-with-fixed-sum"
} |
javascript, react.js
const resizeSidebar = (mouseMoveEvent) => {
if (prevX && prevX.current) {
let delta = mouseMoveEvent.clientX - prevX.current;
setSidebarWidth(sidebarRef.current.getBoundingClientRect().width + delta);
prevX.current = mouseMoveEvent.clientX;
}
};
const stopResize = (event) => {
window.removeEventListener("mousemove", resizeSidebar);
window.removeEventListener("mouseup", stopResize);
setIsTracking(false);
};
const startResizing = (mouseDownEvent) => {
prevX.current = mouseDownEvent.clientX;
window.addEventListener("mousemove", resizeSidebar);
window.addEventListener("mouseup", stopResize);
};
useEffect(() => {
if (!isTracking) prevX.current = null;
}, [isTracking]);
/*useEffect(() => {
}, [sidebarWidth])*/
useEffect(() => {
const resizer = resizerRef.current;
resizer.addEventListener("mousedown", startResizing);
setIsTracking(true);
}, []); | {
"domain": "codereview.stackexchange",
"id": 41737,
"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, react.js",
"url": null
} |
acoustics, molecules
Title: Sound as a use to separate molecular structures Sound can be a destructive force. However, could it be used to separate say the Hydrogen atom from the Oxygen atoms? Molecules are broken apart when they collide with one another with enough force to break the bonds that hold them together. These collisions happen all the time and depend on the density of the gas. This is what defines the mean free path.
The frequency of collisions increases with density. The force involved in the collisions increases with temperature (because the temperature of a gas is related to the average kinetic energy of an ensemble of particles -- hotter gas == faster molecules == more energy transferred in collisions). | {
"domain": "physics.stackexchange",
"id": 27882,
"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, molecules",
"url": null
} |
Determine Whether The Given Relation Is Reflexive, Symmetric, Transitive, Or None Of These. endobj R is symmetric if for all x,y A, if xRy, then yRx. Hence, R is reflexive. a. R is not reflexive, is symmetric, and is transitive. So total number of symmetric relation will be 2 n(n+1)/2. The following diagram gives the properties of equality: reflexive, symmetric, transitive, addition, subtraction, multiplication, division, and substitution. R is an equivalence relation if A is nonempty and R is reflexive, symmetric and transitive. S is not reflexive: There is no loop at 1, for example. (b) symmetric nor antisymmetric. d. R is not reflexive, is symmetric, and is transitive. 6. For example, loves is a non-reflexive relation: there is no logical reason to infer that somebody loves herself or does not love herself. Formally, it is defined like this in the Relations … A relation R is defined as . (v) Symmetric and transitive but not reflexive. 1.3. For every equivalence relation there is a | {
"domain": "wasteclub.org",
"id": null,
"lm_label": "1. Yes\n2. Yes\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9284088005554475,
"lm_q1q2_score": 0.8222280473353932,
"lm_q2_score": 0.8856314662716159,
"openwebmath_perplexity": 387.0013629805693,
"openwebmath_score": 0.7882970571517944,
"tags": null,
"url": "https://wasteclub.org/glee-don-hxb/etusx.php?ab814e=reflexive%2C-symmetric-and-transitive-relations-pdf"
} |
tic-tac-toe, react.js, jsx
// Builds a tic-tac-toe board of 9 squares. Each square is represented by an
// object containing: {
// isWinner - does the square participate in the win
// owner: who owns the square (X or O)
// index: the id of the square
// }
export const selectSquares = (state) => {
const xoSquares = selectSquareOwners(state); // => ["X", "X", "X", "", "O", "O" , ...]
const winningRow = getWinningRow(xoSquares); // => [0, 1, 2]
return xoSquares.map((owner, index) => {
const isWinner = !!~winningRow.indexOf(index);
return { isWinner, owner, index };
});
};
Here is the code without time travel.
You may be concerned about the efficiency of this code.
There is definitely room for improvement, but with such a small data set, the end user will not notice them so I choose simple code over efficient code here. If efficiency becomes a priority, consider using reselect.
I understand that changing all nodes when user make an input is not a good practice. | {
"domain": "codereview.stackexchange",
"id": 40033,
"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": "tic-tac-toe, react.js, jsx",
"url": null
} |
ds.algorithms, gt.game-theory
Therefore, $A$'s strategy is identical to the symmetric case: hire the first candidate that yields winning odds of $> .5$.
$B$'s strategy, then, is formed with $A$'s strategy in mind. Obviously, if $A$ hires (at or) before $B$, then $B$'s strategy is to hire the next candidate that is better than $A$'s, if any. Also, if a candidate comes by with winning odds $> .5$, $B$ should try to hire, even though $A$ will also try to hire (and force $B$ to keep looking).
The only question left is: is it ever beneficial for $B$ to hire when the odds of winning is $<= .5$. The answer is: yes.
Intuitively, say there is a round where the odds of winning with the candidate is $.5 - \epsilon$. Also, there is "likely to be" (explained later) a future candidate with winning odds $> .5 + \epsilon$. Then it would benefit $B$ to choose the earlier candidate.
Let $d_r$ be the candidate interviewing in round $r$ for all $1 <= r <= N$. | {
"domain": "cstheory.stackexchange",
"id": 2825,
"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": "ds.algorithms, gt.game-theory",
"url": null
} |
the deflection for a simply supported beam with UDL acting on the whole length. Sign conventions for load, S. Any help would be much appreciated! Thanks. INTRODUCTION (Fig. In this study, Navier's solution for the analysis of simply supported rectangular plates is extended to consider rigid internal supports. 0GPa Tributary width for loading, tw 6. 4 Analysis of Singly Reinforced Beam Bending Consider a simply supported singly reinforced rectangular beam Load causes - deflection (downwards) - bottom of the beam will be in tension while top in compression. From the geometry of the figure, (6. The beam is now cantilevered from this support. 6 and an allowable stress of 175 N/mm. The Navier solution for the rectangular plate simply supported o n all sides and under a uniformly distributed load, , as shown in Figure 1, is presented in Chapter 5 of Timoshenk o’s text. deflection (YId Cantilever with concentrated load Wat end WL2 2EI W 6E1 - ~2~3 - 3 ~2~ + x3~ WL3 3EI. Shear Force diagram | {
"domain": "autismart.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575116884779,
"lm_q1q2_score": 0.8501324267518535,
"lm_q2_score": 0.8652240877899775,
"openwebmath_perplexity": 1316.018877203321,
"openwebmath_score": 0.556337833404541,
"tags": null,
"url": "http://urgd.autismart.it/deflection-of-simply-supported-beam-with-udl.html"
} |
If 2,3,5 are the only prime factors of a positive integer p,what is the value of p?
A)p>100
B)p has exactly 12 factors including 1 and 12.
[Reveal] Spoiler: OA
C
.
[Reveal] Spoiler: Explanation
Since 2,3,5 are the only prime factors of p=> The general expression for p will be 2a∗3b∗5c2a∗3b∗5c where a,b,c are positive integers.
Statement 1->p>100.
There exist infinite such cases.
In-fact there are only a few cases where p will be less than 100.
Hence not sufficient.
Statement 2->
Factors =12
Hence (a+1)*(b+1)*(c+1)=12=2*2*3
NOTE-> We can't arrange 12 as 1*1*12 or 2*6*1 or 4*3*1 as a,b,c are positive integers.
Hence a,b,c => (1,1,2) or (1,2,1) or (2,1,1)
Posible values of p=> 150,90,60
Hence not sufficient.
Combining the two statements => p must be 150.
Hence C.
B | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9449947086083138,
"lm_q1q2_score": 0.8259983497465878,
"lm_q2_score": 0.8740772220439509,
"openwebmath_perplexity": 4768.193114812097,
"openwebmath_score": 0.49131280183792114,
"tags": null,
"url": "https://gmatclub.com/forum/stonecold-s-mock-test-217160-40.html"
} |
javascript, unit-testing, ecmascript-6
r.stop = 8;
expect(r.length).to.equal(4);
r.step = 1;
expect(r.length).to.equal(8);
});
});
describe('length property', () => {
it('has the correct value', () => {
expect(range(10)).to.have.property('length', 10);
expect(range(1, 6)).to.have.property('length', 5);
expect(range(1, 11, 2)).to.have.property('length', 5);
expect(range(1, 12, 2)).to.have.property('length', 6);
expect(range(1, 1)).to.have.property('length', 0);
expect(range(-10)).to.have.property('length', 0);
expect(range(-10, -15, -6)).to.have.property('length', 1);
expect(range(0, -10, -1)).to.have.property('length', 10);
});
it('is non-configurable and non-enumerable', () => {
const descriptor = Reflect.getOwnPropertyDescriptor(range(10), 'length');
expect(descriptor.configurable).to.be.false;
expect(descriptor.enumerable).to.be.false;
});
it('cannot be modified', () => {
const r = range(10); | {
"domain": "codereview.stackexchange",
"id": 23574,
"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, unit-testing, ecmascript-6",
"url": null
} |
beginner, rust
Title: A simple implementation of the Unix find command written in Rust I'm a C++ developer trying to learn Rust for fun and XP.
I decided to implement some of the Unix tools for practice.
Below is a simplified implementation of the find command. The program takes 0 to 2 arguments: The first being the file to find, the second being the directory to start searching (I'm aware that the args aren't very robust).
I get the feeling there is a more succinct way to do what I'm trying to accomplish.
use std::env;
use std::io; | {
"domain": "codereview.stackexchange",
"id": 31487,
"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, rust",
"url": null
} |
opencv, linux, ubuntu, ros-fuerte, ubuntu-oneiric
-ltf -lboost_thread-mt -lBulletDynamics -lBulletCollision -lLinearMath -lsensor_msgs -lmessage_filters -lroscpp -lrostime -lrosconsole -lroscpp_serialization -lxmlrpcpp -ltf_conversions -lorocos-kdl -limage_geometry -Wl,-rpath,/opt/ros/fuerte/lib:/opt/ros/fuerte/stacks/geometry/tf/lib:/opt/ros/fuerte/stacks/bullet/lib:/opt/ros/fuerte/stacks/geometry/tf_conversions/lib:/opt/ros/fuerte/stacks/orocos_kinematics_dynamics/orocos_kdl/install_dir/lib:/opt/ros/fuerte/stacks/vision_opencv/image_geometry/lib | {
"domain": "robotics.stackexchange",
"id": 9048,
"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": "opencv, linux, ubuntu, ros-fuerte, ubuntu-oneiric",
"url": null
} |
thermodynamics, temperature, entropy, work, heat-engine
Title: Final equilibrium temperature of two reservoirs connected together via a heat engine (thermal efficiency of 50%) I am considering a thermally isolated system of constant pressure. Where 10kg of air at 1000K (assume $Cp_{air}=0.98$ kJ/kgK, denote this as the hot reservoir by H) is connected to 10kg of water at 300K (assume $Cp_{water}=$4.2 KJ/kgK and denote this as the cold reservoir by C). The heat engine has a maximum thermal efficiency of 50%.
I know I should consider equilibrium in terms of entropy change. i.e. when
$\Delta S_{system} = 0$
I understand how to do this problem when the heat engine is reversible. Since then
$\frac{\delta Q_H}{T_H} = \frac{\delta Q_H}{T_H} $
leading to
$\Delta S_{system} = (mC_P)_{air}\ln(\frac{T_f}{T_H}) + (mC_P)_{water}\ln(\frac{T_f}{T_C}) = 0$
$\Rightarrow T_f =$ equilibrium temperature of system = 376.7K. | {
"domain": "physics.stackexchange",
"id": 45801,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, temperature, entropy, work, heat-engine",
"url": null
} |
# Eigenvector and eigenvalue for differential operator
#### kalish
##### Member
My friends and I have been struggling with the following problem, and don't understand how to do it. We have gotten several different answers, but none of them make sense. Can you help us?
**Problem statement:** Let $V$ be the vector space of real-coefficient polynomials of degree at most $3$. Let $D:V \rightarrow V$ be the differential operator; $D(p(x))=\frac{d}{dx}p(x)$. Give an example of an eigenvector for $D$. What is the corresponding eigenvalue?
We ended up getting that $\frac {d}{dx}p(x)=\lambda p(x)$, so that $p(x)=\frac{x^2}{2}$. Is this correct?
Thanks.
#### Klaas van Aarsen
##### MHB Seeker
Staff member
My friends and I have been struggling with the following problem, and don't understand how to do it. We have gotten several different answers, but none of them make sense. Can you help us? | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924802053234,
"lm_q1q2_score": 0.8222496877504394,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 190.63322901480797,
"openwebmath_score": 0.9135092496871948,
"tags": null,
"url": "https://mathhelpboards.com/threads/eigenvector-and-eigenvalue-for-differential-operator.7640/"
} |
javascript, beginner, jquery, html, form
// We use it multiple times, save the reference
var $checkAllTrigger = $('#checkall');
// We only need to calc this once, not needed every click, so save it in a var
var allCheckBoxesLength = $allCheckBoxes; // this gets set once, and that's exactly enough
$checkAllTrigger.on('click', function () {
// Use this.checked, "this" is the clicked element, ".checked" is true/false if it's checked or not
$allCheckBoxes.prop('checked', this.checked);
})
// as per Paul's comment, blur the element to remove.
// We chain the blur() to the on(), on() returns the object, you can think $(this)
// gets returned, which you then blur.
.blur(); | {
"domain": "codereview.stackexchange",
"id": 14501,
"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, beginner, jquery, html, form",
"url": null
} |
ros2
<Wait wait_duration="1"/>
<RecoveryNode number_of_retries="6" name="NavigateRecovery">
<PipelineSequence name="NavigateWithReplanning">
<RateController hz="10.0">
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
<GoalUpdater input_goal="{goal}" output_goal="{updated_goal}">
<ComputePathToPose goal="{updated_goal}" path="{path}" planner_id="GridBased"/>
</GoalUpdater>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="DynamicFollowPath">
<FollowPath path="{path}" controller_id="DynamicFollowPath"/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
</RecoveryNode>
</PipelineSequence>
<ReactiveFallback name="RecoveryFallback">
<GoalUpdated/> | {
"domain": "robotics.stackexchange",
"id": 37789,
"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
} |
c#, lambda
I would like to simplify
var someProperties= new List<string>();
someProperties.Add(GetMemberName((AuthModel m) => m.Id));
someProperties.Add(GetMemberName((AuthModel m) => m.UserName));
someProperties.Add(GetMemberName((AuthModel m) => m.Links));
into a one-liner.
For example, by creating and using a certain function called GetPropertiesList that accepts a class type and the properties that the caller wants as its parameter.
var someProperties = GetPropertiesList(typeof(AuthModel), (AuthModel m) => new {m.Id, m.UserName, m.Links });
//someProperties will return List<string>(){ "Id", "UserName", "Links"} | {
"domain": "codereview.stackexchange",
"id": 42152,
"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#, lambda",
"url": null
} |
ros, buiding-errors
*/
double y1, p1, r1;
btMatrix3x3(ardrone.getRotation()).getRPY(r1, p1, y1);
btQuaternion ardrone_yawed(y1, 0.0, 0.0);
ardrone.setRotation(ardrone_yawed);
//set up twist publisher
pub_twist = n.advertise<geometry_msgs::Twist>("/cmd_vel", 1); /* Message queue length is just 1 */
// Register the ardrone without roll and pitch with the transform system
br.sendTransform( tf::StampedTransform(ardrone, ros::Time::now(), "/optitrak", "ardrone_wo_rp") );
// Get the vector between quad without roll and pitch and the desired point
tf_listener.waitForTransform("/ardrone_wo_rp", "/desired", ros::Time(0), ros::Duration(inv_rate));
tf_listener.lookupTransform("/qardrone_wo_rp", "/desired", ros::Time(0), desired_in_ardrone_coords);
// Extract the x, y, & z components | {
"domain": "robotics.stackexchange",
"id": 11718,
"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, buiding-errors",
"url": null
} |
thermodynamics, statistical-mechanics, entropy, ideal-gas
Basically, $\Phi$ should give some information of where the ideal gas model breaks down for the gases in question. At $P=1\operatorname{atm}$ these values of $\Phi$ imply that entropy hits zero at $T = 29,\ 29,\ 7.4,\ \mathrm{and}\ 0.25 \operatorname{K}$ for each of these gases, which doesn't seem too far off from their boiling points of $77$, $90$, $20$, and $4.2$ Kelvin. Even so, this is about as well as you'd expect to do from unit analysis. What are the actual factors that go in to determining $\Phi$? For the entropy of monatomic ideal gas there is Sackur-Tetrode equation. $\Phi$ can be explicitly found from this equation for inert gases, for example. As one can see in this case $\Phi$ is determined by atomic mass, Boltzmann's constant, Planck's constant and mathematical constants. | {
"domain": "physics.stackexchange",
"id": 45258,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, statistical-mechanics, entropy, ideal-gas",
"url": null
} |
c#, linq
Usage:
new OrderByDeletegates<T>
{
OrderById = i => i.Id,
OrderByEnabled = i => i.IsEnabled,
OrderByAuthor = i => i.Creator.UserName,
// …
};
The advantage of this is that it's type-safe. You can't for example accidentally do something like OrderByEnabled = i => i.Id. | {
"domain": "codereview.stackexchange",
"id": 4340,
"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#, linq",
"url": null
} |
python, algorithm, time-limit-exceeded
Title: Target Sum leetcode I am trying to solve this problem
You are given a list of non-negative integers, a1, a2, ..., an, and a
target, S. Now you have 2 symbols + and -. For each integer, you
should choose one from + and - as its new symbol.
Find out how many ways to assign symbols to make sum of integers equal
to target S.
My working solution that times out:
class Solution:
def findTargetSumWays(self, nums: List[int], S: int) -> int:
ways = 0
def dfs(index, s):
nonlocal ways
if index == len(nums):
if s == 0:
ways +=1
else:
dfs(index+1, s-nums[index])
dfs(index+1, s+nums[index])
dfs(0, S)
return ways | {
"domain": "codereview.stackexchange",
"id": 36213,
"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, algorithm, time-limit-exceeded",
"url": null
} |
ros, svn, camera-info-manager
Title: cannot svn camera_info_manager package from source
Does anyone can svn camera_info_manager package from source? I need electric version for Gumstix Overo. I tried this link https://code.ros.org/svn/ros-pkg/stacks/image_common/tags/image_common-1.6.1 , but it seems not exist.
Anyone can help me? Thanks in advance!
Originally posted by AdrianPeng on ROS Answers with karma: 441 on 2013-02-07
Post score: 0
The entire image_common stack has moved to github, including old release branches.
There are currently problems with the wiki Releases page, which make it hard to find the correct previous source versions.
Assuming that 1.6.1 is the release you want, you should be able to check out this version.
Originally posted by joq with karma: 25443 on 2013-02-09
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by AdrianPeng on 2013-02-10:
Thanks a lot !!! | {
"domain": "robotics.stackexchange",
"id": 12792,
"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, svn, camera-info-manager",
"url": null
} |
Background
A binary tree is a rooted tree whose every node has at most two children.
A labelled binary tree is a binary tree whose every node is labelled with a positive integer; moreover, all labels are distinct.
A BST (binary search tree) is a labelled binary tree in which the label of each node is greater than the labels of all the nodes in its left subtree, and smaller than the labels of all the nodes in its right subtree. For instance, the following is a BST:
The pre-order traversal of a labelled binary tree is defined by the following pseudo-code.
function preorder(node)
if node is null then
return
else
print(node.label)
preorder(node.left)
preorder(node.right)
See the following image to get a better intuition:
The vertices of this binary tree are printed in the following order:
F, B, A, D, C, E, G, I, H
Challenge
Given a list of integers $$\a\$$, your task is to determine whether there is a BST whose pre-order traversal prints exactly $$\a\$$.
Input | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759674419192,
"lm_q1q2_score": 0.8064655545473448,
"lm_q2_score": 0.8221891261650247,
"openwebmath_perplexity": 3474.962121090979,
"openwebmath_score": 0.30547282099723816,
"tags": null,
"url": "https://codegolf.stackexchange.com/questions/174293/is-this-a-bst-pre-order-traversal"
} |
react.js, to-do-list, jsx, redux
const store = createStore(todo);
const renderTodo = () => {
const st = store.getState();
ReactDOM.render(
<TodoApp todos={st.todos}
inputText={st.inputText}
onInputChange={event =>
store.dispatch({type: UPDATE_INPUT_TEXT, newInputText: event.target.value})
}
onAdd={() => store.dispatch({type: ADD})}
onDelete={(index) => store.dispatch({type: DELETE, index: index})}
/>,
document.getElementById('root')
)
};
store.subscribe(renderTodo);
renderTodo(); I'm not exactly sure of your environment (I'm going to assume you're using Node), and with this assumption, I want to address a few things starting with specific things, then more general:
Specific | {
"domain": "codereview.stackexchange",
"id": 28699,
"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": "react.js, to-do-list, jsx, redux",
"url": null
} |
fl.formal-languages, context-free
However, this grammar for $L$ has a production of the form $X \rightarrow BBXB | 0$ and $Y \rightarrow BYBB | 1$ with $B \rightarrow 0|1$ (used to extend the substring while maintaining the invariant). Thus, the longest minimal pumping length of this grammar is at least 3.
Is there a grammar for $L$ that has a largest minimal pumping length of 2?
What about $L' := \{w^5 | ... \}^C$ - is there a grammar with largest minimal pumping length of 4 or less? | {
"domain": "cstheory.stackexchange",
"id": 5251,
"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": "fl.formal-languages, context-free",
"url": null
} |
• Are you certain that this is the right site for your problem? Have you tried physics.SE? It might be off-topic there, though, on account of their stance on homework (and homework-like) problems. I don't know. – Arthur Jan 2 at 9:13
• @Arthur I thought that maths was an appropiate site as my question is about if my use of mathematics was right given the conditions of the problem. I am not very experienced in the field so, verification of my reasoning is needed. – Chris Steinbeck Bell Jan 2 at 9:22
• Where did you get $v_a = 3$ m/s from? – caverac Jan 2 at 9:25
• @caverac Sorry it was a typo. It was a given data from the problem, now I've corrected that mistake. – Chris Steinbeck Bell Jan 2 at 9:29
• When you calculate $h_b$ you use $R = 10$ m, is that also a typo? – caverac Jan 2 at 9:32
The downward force felt by a passenger of mass $$m$$ at point $$B$$ has two components:
• The weight of the passenger, $$mg\downarrow$$
• The radial force, $$\frac{mv_b^2}R\downarrow$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517482043892,
"lm_q1q2_score": 0.8370667140900736,
"lm_q2_score": 0.8558511506439707,
"openwebmath_perplexity": 429.62336149292446,
"openwebmath_score": 0.706851601600647,
"tags": null,
"url": "https://math.stackexchange.com/questions/3059254/how-to-determine-the-minimum-height-of-a-roller-coaster-provided-an-acceleration"
} |
• I don't know how this is in the context of sympletic manifolds, but as far as I know the wedge product satisfies $\omega \wedge \omega = 0$. – user1620696 Jun 11 '13 at 12:08
• The nondegeneracy condition on $\omega$ is equivalent to the condition that $M$ has an even dimension $2n$ and the top wedge product $\omega^n$ is nowhere vanishing on $M$, i.e., $\omega^n$ is a volume form. In particular, $M$ must be orientable and is canonically oriented by $\omega^n$. – PtF Jun 11 '13 at 12:13
• @user1620696: That equations holds only for odd degree forms. In general, we have $\alpha \wedge \beta = (-1)^{|\alpha||\beta|}\beta \wedge \alpha$ where $|\alpha|$ denotes the degree of $\alpha$. – Jason DeVito Jun 11 '13 at 14:38
This is really a linear algebra problem - one can work one tangent space at a time. (In particular, all this works even if $\omega$ isn't closed.) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406006529085,
"lm_q1q2_score": 0.8027312103190059,
"lm_q2_score": 0.8104789018037399,
"openwebmath_perplexity": 179.2649773187324,
"openwebmath_score": 0.9345629811286926,
"tags": null,
"url": "https://math.stackexchange.com/questions/417365/how-to-show-omegan-is-a-volume-form-in-a-symplectic-manifold-m-omega"
} |
Ok, what are the results? Well, here they are for the usual setup (20 samples of 10 000 simulated players each), and a table maximum of 1000 $. We are looking at the same probabilities as above, now plotted out to 400 rounds of playing, without a house edge: Here is the same simulation, but with the usual house edge (European Roulette): What do we notice? • As already suspected, the house edge makes a difference in the long term. The crossing point of winning and losing probabilities occurs earlier by a clearly visible amount, if there is a house edge. • The short term appears largely unaffected, in particular the bump of good chance in the first hour of playing. • The characteristics of the curves are very similar, so the house edge has nothing to do, e.g., with the fact that a loss encountered when playing Roulette with the Martingale strategy is most likely a total loss. I think this brings us to a point where we can begin to summarize the results of this in-depth analysis of the | {
"domain": "computingskillset.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969684454966,
"lm_q1q2_score": 0.8018602117280685,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 556.5057910268125,
"openwebmath_score": 0.7240111827850342,
"tags": null,
"url": "https://computingskillset.com/monte-carlo-methods/gambling-analysis/martingale-roulette-strategy-full-outcome-analysis-with-charts/"
} |
# Correlation and dependence between $X$ and $Y:=X^2$
If we say $X$ has a uniform distribution on $\{-1,0,1\}$ and let $Y=X^2$, are $X$ and $Y$ uncorrelated and are they independent? I would say that they are not independent since $Y$ clearly depends on $X$, but a friend told me that that's not correct. How would I show that they are dependent? (Or maybe he is correct?)
Also I said that they were correlated because $Y$ changes as $X$ changes, meaning correlation right? I'm just feeling doubtful now. Some help please?
-
Can you edit your question title to something more specific/informative? – JohnD Dec 13 '12 at 17:04
Consider for example $\mathbb{P}[X=-1,Y=1]$:
$$\mathbb{P}[X=-1,Y=1] = \mathbb{P}[X=-1] = \frac{1}{3}$$
using that $Y=X^2$, but on the other hand
$$\mathbb{P}[X=-1] \cdot \mathbb{P}[Y=1] = \frac{1}{3} \cdot \frac{2}{3} = \frac{2}{9} \not= \frac{1}{3}$$
This means that $X$, $Y$ cannot be independent.
Concerning correlation: Obviously $\mathbb{E}X = 0$ and | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140216112959,
"lm_q1q2_score": 0.8036438709831555,
"lm_q2_score": 0.8311430520409023,
"openwebmath_perplexity": 2253.2651578888594,
"openwebmath_score": 0.9925640225410461,
"tags": null,
"url": "http://math.stackexchange.com/questions/258008/correlation-and-dependence-between-x-and-y-x2"
} |
c++, c++11, linked-list, stl
template <typename T, typename Allocator>
void clist<T, Allocator>::splice(const_iterator pos, clist<T, Allocator> &l, const_iterator i)
{
if (this->_alc() == l._alc())
{
if ((i != pos) && (std::next(i) != pos))
{
node *pCur(const_cast<node*>(pos.m_pT)), *pNew(const_cast<node*>(i.m_pT));
node::link(pNew->m_pPrev, pNew->m_pNext);
node::link(pCur->m_pPrev, pNew);
node::link(pNew, pCur);
}
}
} | {
"domain": "codereview.stackexchange",
"id": 6454,
"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++, c++11, linked-list, stl",
"url": null
} |
at all principal minors, for example: a symmetric matrix $M$ is indefinite (has positive and negative eigenvalues) if and only if: Knowing that $M$ is not strictly positive- or negative-definite does not really help. Since the kernel is always a subspace, (11.9) implies that E (A) is a subspace. MathWorks Support Team on 9 Sep 2013. For some new kernel functions, I have checked the eigen values of corresponding Gram matrix(UCI bench mark data set). In addition, a matrix is indefinite if and only if it is neither positive semidefinite nor negative semidefinite. 2 Some examples { An n nidentity matrix is positive semide nite. Matrix norm the maximum gain max x6=0 kAxk kxk is called the matrix norm or spectral norm of A and is denoted kAk max x6=0 kAxk2 kxk2 = max x6=0 xTATAx kxk2 = λmax(ATA) so we have kAk = p λmax(ATA) similarly the minimum gain is given by min x6=0 kAxk/kxk = q λmin(ATA) Symmetric matrices, quadratic forms, matrix norm, and SVD 15–20 In linear algebra, the Cholesky | {
"domain": "jabeplastic.ir",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668728630677,
"lm_q1q2_score": 0.8239191491302249,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 591.2567837159927,
"openwebmath_score": 0.6519129872322083,
"tags": null,
"url": "https://jabeplastic.ir/dan-futterman-ipwl/how-to-prove-a-matrix-is-indefinite-f8acf6"
} |
complexity
Takes $O(n^{2+\epsilon})$ time
Produces every possible reachable configuration with positive probability, and only produces such configurations
Is not extremely skewed Well, the easy answer is that you don't traverse the graph of moves, you just generate a random group element directly. A non-face-center cubie in an NxNxN cube will have an orbit of size 8, 12, 24 or 48, with 8 being possible only for corner cuties and 12 only being possible for edge-center cubies with N odd. Divide the cubies into orbits, then generate a random permutation for each orbit with the restriction that the total permutation across all orbits must be even. Then generate orientations for all edge and corner cubies, with a mod-2 parity restriction on each edge orbit and a mod-3 parity restriction on the corners.
I believe that covers all of the parity issues with the order-N Rubik's cube group, which means this method would generate random cubes uniformly distributed across the group. | {
"domain": "cstheory.stackexchange",
"id": 5089,
"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": "complexity",
"url": null
} |
electronegativity, lewis-structure
Title: Why does ammonium chloride form an ionic bond? Why does $\ce{NH4Cl}$ form an ionic bond if the difference in electronegativity between nitrogen and chlorine is $0$?
Shouldn't it be at least 1.7 in order for an ionic bond to form? If not what is the reason behind this? Quick Answer
Explicit valence of $\ce{N}$ is four, $\ce{N}$ of $\ce{NH4+}$ cannot form another (covalent) bond with $\ce{Cl-}$.
The chemistry of $\ce{NH4+}$, owing to similar size, charge, and polarizing power, is similar to that of alkali metal ions, especially $\ce{K+}$; $\ce{NH4+Cl-}$ is ionic just like $\ce{K+Cl-}$ is, with about $\pu{80\%}$ ionic character.
The gap between HOMO of $\ce{Cl-}$ and LUMO of $\ce{NH4+}$ is about $\pu{5 eV}$ making any covalent interaction rather weak; $\ce{NH4+}$ doesn't have available empty orbitals to make a covalent bond with $\ce{Cl-}$. | {
"domain": "chemistry.stackexchange",
"id": 17400,
"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": "electronegativity, lewis-structure",
"url": null
} |
python, game, numpy
def __str__(self):
return str(self.grid_matrix)
def replace(self, position, value):
"""Replace a value in a grid"""
x,y = position
rows, coloumns = len(self.grid_matrix), len(self.grid_matrix[0])
if x < rows and y < coloumns:
self.grid_matrix[x,y] = value | {
"domain": "codereview.stackexchange",
"id": 34979,
"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, game, numpy",
"url": null
} |
together (0 + 1 = 1). The Fibonacci Sequence is one of the cornerstones of the math world. Fibonacci spiral is also considered as one of the approximates of the golden spiral. The answer key is below. Python Fibonacci Sequence: Iterative Approach. The Fibonacci sequence exhibits a certain numerical pattern which originated as the answer to an exercise in the first ever high school algebra text. If we make the replacement. Problems to be Submitted: Problem 10. Keywords and phrases: Generalized Fibonacci sequence, Binet’s formula. I know that the relationship is that the "sum of the squares of the first n terms is the nth term multiplied by the (nth+1) term", but I don't think that is worded right? Each number in the sequence is the sum of the two previous numbers. The first two numbers of the Fibonacci series are 0 and 1. Leonardo Fibonacci was one of the most influential mathematician of the middle ages because Hindu Arabic Numeral System which we still used today was popularized in | {
"domain": "manoisparduotuve.lt",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9952448002312091,
"lm_q1q2_score": 0.9055802067274537,
"lm_q2_score": 0.9099069962657176,
"openwebmath_perplexity": 410.9703290688314,
"openwebmath_score": 0.7616588473320007,
"tags": null,
"url": "http://manoisparduotuve.lt/i-hate-oxjqr/article.php?tag=f1577f-fibonacci-sequence-equation"
} |
more than one independent variable is called a multiple regression model. This procedure has been implemented in numerous comput-r programs and over-comes the acute problem that often exists with the classical computational methods of multiple linear regression. Note: The complete derivation for obtaining least square estimates in multiple linear regression can be found here . It is simply for your own information. In the previous chapter, we took for example the prediction of housing prices considering we had the size of each house. Multiple Features (Variables) X1, X2, X3, X4 and more New hypothesis Multivariate linear regression Can reduce hypothesis to single number with a transposed theta matrix multiplied by x matrix 1b. To know the best combination of parameters in DBH Estimation, all possible combinations of parameters were generated and Linear regression is a technique used to model the relationships between observed variables. Here X is hours spent studying per week, the | {
"domain": "mcsms.ru",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713865827591,
"lm_q1q2_score": 0.8032252518056001,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 808.0274149980227,
"openwebmath_score": 0.6238495707511902,
"tags": null,
"url": "http://mcsms.ru/carrier-ahu-wgdoq/rmxw---multiple-linear-regression-derivation---3du.html"
} |
standard-model
Such particles would enable the existence of stable elements
with higher atomic numbers, like stable versions of low half-life elements?
No, because nuclear physics is mostly governed by
the strong interaction and to a lesser extent by the electromagnetic
and weak interaction. The smmall rest masses of the quarks
(which build the protons and neutrons) don't have much effect.
So protons, neutrons and hence the nuclei would still have the same
mass, size and binding energies as in our universe. | {
"domain": "physics.stackexchange",
"id": 92112,
"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": "standard-model",
"url": null
} |
4. finding procedures. A directed graph is one in which the nodes are connedted by edges that can be traversed in one direction. Click on the object to remove. Shortest Paths Presentation for use with the textbook, Algorithm Design and Applications, by M. The graph is not weighted. Give individual students time to work on finding the shortest paths for the small examples in the worksheet. Path does not exist. A number of existing algorithms [6, 10, 22] in fact, to compute a t-spanner, are based on this approach of ensuring Pt for each missing edge. Thus, the shortest path between any two nodes is the path between the two nodes with the lowest total length. An undirected, connected graph of N nodes (labeled 0, 1, 2, , N-1) is given as graph. The problem is to find a path through a graph in which non-negative weights are associated with the arcs. 1 Given a weighted, directed graph G, a start node s and a destination node t, the s-t shortest path problem is to output the shortest path | {
"domain": "cmsilsole.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9886682441314384,
"lm_q1q2_score": 0.8217247315453498,
"lm_q2_score": 0.8311430415844384,
"openwebmath_perplexity": 366.37112232336875,
"openwebmath_score": 0.5638009905815125,
"tags": null,
"url": "http://jsly.cmsilsole.it/number-of-shortest-paths-in-a-weighted-graph.html"
} |
tensor-calculus, group-theory, representation-theory, quarks
So, for a general $k$ and a Young diagram consisting of three cells in a single row, this becomes
$$
N = \underbrace{\left( \frac{k - 1 + 1}{3} \right)}_{(i,j) = (1,1)} \underbrace{\left( \frac{k - 1 + 2}{2} \right)}_{(i,j) = (1,2)} \underbrace{\left( \frac{k - 1 + 3}{1} \right)}_{(i,j) = (1,3)} = \frac{k(k+1)(k+2)}{6}
$$
which gives $N = 20$ when $k = 4$, as you found.
As another example, for the mixed-symmetry Young diagram with three cells, we have
$$
N = \underbrace{\left( \frac{k - 1 + 1}{3} \right)}_{(i,j) = (1,1)} \underbrace{\left( \frac{k - 1 + 2}{1} \right)}_{(i,j) = (1,2)} \underbrace{\left( \frac{k - 2 + 1}{1} \right)}_{(i,j) = (2,1)} = \frac{k(k+1)(k-1)}{3}.
$$
(This also happens to yield $N = 20$ when $k = 4$, but this is just a coincidence; for general $k$, the dimensionality of this representation is different.) | {
"domain": "physics.stackexchange",
"id": 98462,
"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": "tensor-calculus, group-theory, representation-theory, quarks",
"url": null
} |
logic, circuits, boolean-algebra
Title: Representing binary functions with a finite gate set without exponential blow-up? It is pretty well taught that any binary function can be represented using CNF. But conversion to CNF can take an exponential number of gates. The truth table is exponentially sized relative to the number of input variables.
Is there any form of representing truth tables that requires only a polynomial or quasipolynomial number of gates? I know there are ones that preserve satisfiability, not equality---but is there anything that preserves equality? No. No matter what representation of functions as circuits/formulas you use, there will exist some functions that require exponential size to represent. This was proven by Shannon in 1949. See Shannon's result that some Boolean functions require exponential circuits.
Intuitively, you can count the number of circuits/formulas of polynomial size, and it is much less than the number of functions. | {
"domain": "cs.stackexchange",
"id": 21526,
"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": "logic, circuits, boolean-algebra",
"url": null
} |
ds.algorithms
Here's a reduction. Consider an undirected graph $G$. Associate to each node/vertex $v$ a list of pairs $(e,v)$, one for each edge $e$ incident on $v$. Now we can treat this as an instance of your problem (ignore the graph structure; we obtain a list of pairs for each node). Any solution to your problem corresponds to a valid coloring of this graph: all nodes that are merged together receive the same color. Similarly, any valid coloring corresponds to a valid solution of your problem. The number of colors used is the size of the solution to your problem. Therefore, the optimal solution (of smallest size) to your problem corresponds to the optimal coloring (with the fewest colors).
Of course, graph coloring is NP-hard, so it follows that your problem is as well. | {
"domain": "cstheory.stackexchange",
"id": 5655,
"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": "ds.algorithms",
"url": null
} |
thermodynamics, differential-geometry, ideal-gas, chemical-potential
A. S. Wightman: Convexity and the notion of equilibrium state in thermodynamics and statistical mechanics, pp. ix–lxxxv in R. B. Israel: Convexity in the Theory of Lattice Gases (Princeton 1979).
M. Pekař, I. Samohýl: The Thermodynamics of Linear Fluids and Fluid Mixtures (Springer 2014), especially ch. 2.
C. A. Truesdell (editor): Rational Thermodynamics (Springer 1984), especially the Historical Introit and ch. 1.
G. Astarita: Thermodynamics: An Advanced Textbook for Chemical Engineers (Springer 1990), especially chs 1, 2.
Also may interest you:
D. R. Owen: A First Course in the Mathematical Foundations of Thermodynamics (Springer 1984).
Gibbs's text is also very insightful (although convoluted at times) and always worth reading:
J. W. Gibbs: On the equilibrium of heterogeneous substances, Trans. Connecticut Acad. III (1875–1878), pp. 108–248, 343–524, 530 https://archive.org/details/transactionsconn03conn. | {
"domain": "physics.stackexchange",
"id": 48363,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, differential-geometry, ideal-gas, chemical-potential",
"url": null
} |
fluid-dynamics, pressure, water
Title: Water Level and Pipe Widths I ran into a bit of physics yesterday, and couldn't understand the physics at work. I've been scouring the Internet, but haven't found the answer yet. I'm guessing there's a basic principle I'm misinterpreting or ignorant of.
Basically, the sewer backed up into my house. Among other points of entry, water flowed up the shower drain, and up the toilet bowl.
The shower filled to a bit under the lip of its basin. The toilet filled to a bit under the lip of the bowl, but neither overflowed.
So basically I had a reservoir (the sewer), with one pipe (shower) extending to floor height + 4 inches, and another pipe (toilet) extending to floor height + 24 inches. | {
"domain": "physics.stackexchange",
"id": 12592,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, pressure, water",
"url": null
} |
forces
This is what we want, because it virtually has the same power output at any frequency, "auto adjusting" to what the situation is. If we are at low speeds it has high torque and at sacrifices torque as the speed grows. This is perfect! Say you are climbing an incline, you're okay with lower speeds, as long as you actually make the climb. So the electric engine does this "naturally".
We want this on internal combustion engines aswell, so we've added the transmission. It allowes us to adjusts the frequency and torque to what we need, so it somewhat mimics the electric engine characteristic:
The separate black curves depict different settings of the transmission, in other words - your active gear.
In conclusion - no, the relation between speed and force that comprise the power output are not indifferent to machines. But electric engines come really close to it. On the other hand - internal combustion engines are very sensitive about it. | {
"domain": "physics.stackexchange",
"id": 54929,
"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": "forces",
"url": null
} |
quantum-mechanics, homework-and-exercises, electric-fields, wavefunction, schroedinger-equation
First, use a temporary normalization where $a = 1$. We'll fix the overall normalization later.
The boundary conditions on your function are
\begin{align*}
x &= 0: && \text{Ai}(-E_n) + b \,\text{Bi}(-E_n) = 0 \\
x &= L: && \text{Ai}(L-E_n) + b \,\text{Bi}(L-E_n) = 0
\end{align*}
This is a set of two equations and two unknowns in $b$ & $E_n$, and so should have a discrete solution set. It may be numerically hard to find, but it should exist. For example, here's what it looks like for $L = 4$; the blue contours represent the solutions to the first condition, while the yellow contours represent the solutions to the second condition. | {
"domain": "physics.stackexchange",
"id": 99769,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, homework-and-exercises, electric-fields, wavefunction, schroedinger-equation",
"url": null
} |
• I'm currently reading up on using partial fractions to get my sum. Are you able to edit it into your answer so I can check my result against yours when I get done with reading about it and trying it? – ConfusingCalc Dec 2 '13 at 0:23
• @ConfusingCalc math.stackexchange.com/a/588808/66223 it's there. With partial fractions you'll get $\frac{1}{n(n+3)}$ the tripple-equal meaning "always equal to, an identity" $\frac{A}{n}+\frac{B}{n+3}$ - find A and B, it turns out N is negative, so you get a "telescoping series" where terms cancel out, almost every term cancels with another. – Alec Teal Dec 2 '13 at 0:25
• I think I incorrectly solved my partial sum. $\frac{1}{n(n+3)} = A(n+3) + B(n)$ How does n turn negative? I wish Hagen would have gone slightly more in depth on how he got what he did. – ConfusingCalc Dec 2 '13 at 1:08 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429107723175,
"lm_q1q2_score": 0.8449383909071067,
"lm_q2_score": 0.8577681049901037,
"openwebmath_perplexity": 438.5763705497658,
"openwebmath_score": 0.8085034489631653,
"tags": null,
"url": "https://math.stackexchange.com/questions/588802/what-steps-should-i-be-doing-to-determine-if-this-series-is-convergent-or-diverg?noredirect=1"
} |
homework-and-exercises, string-theory, lagrangian-formalism, metric-tensor, action
$$ h_{\alpha\beta} = A(x) \gamma_{\alpha\beta} $$
Where the proportionality constant A(x) won't make any difference (any two A choices will give solutions, and they lead to the same action).
Substitute in the extremal value for h in the action, and remember how to take an inverse matrix: $h^{\alpha\beta} = {1\over A} \gamma^{\alpha\beta}$, and you get that the action contribution for each external source $\gamma_{\alpha\beta}$ is proportional to $\sqrt{\gamma}$ no matter what $A(x)$ happens to be, which gives the Nambu-Goto action. Then you integrate the Nambu-Goto action over the remaining path-integral variables, which are the embedding coordiantes $X^\mu$. | {
"domain": "physics.stackexchange",
"id": 1938,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, string-theory, lagrangian-formalism, metric-tensor, action",
"url": null
} |
I calculated this with a computer and got $3618384$. So the wanted probability is
$$\frac{3618384}{4^{11}} = \frac{226149}{262144} \approx 0.86269.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138196557983,
"lm_q1q2_score": 0.8386517267538788,
"lm_q2_score": 0.8577681013541611,
"openwebmath_perplexity": 279.6251232759068,
"openwebmath_score": 0.9408015012741089,
"tags": null,
"url": "https://math.stackexchange.com/questions/2433438/probability-equally-likely-or-not"
} |
python, validation, gui, tkinter
if __name__ == '__main__':
def execute_func():
print('executing with')
print( ml.get(), basic.get())
def cryptic_conv(x):
# no docstring for this conversion function
return int(x)
root = tki.Tk()
basic = GUI_inputs(root, 'basic')
basic.pack()
basic.add('key 1')
basic.add('key 2')
ml = GUI_inputs(root, 'more flexible', execute=execute_func)
ml.pack()
ml.add('we')
ml.add('we1', conv=int)
ml.add('we2', 'disp4we2', data=999)
ml.add('pair', 'f_pair','',float_pair)
ml.add('cryp', 'no doc string', 6, cryptic_conv) | {
"domain": "codereview.stackexchange",
"id": 11122,
"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, validation, gui, tkinter",
"url": null
} |
Geometry QUESTION TWO A drain runs along a straight line equidistant between the points (1, -2) and (3, -4). Length of AB 34 5. , Find the normal to the these two vectors. 4 CHAPTER 2. 1 Quadratic Function – give examples in standard form and demonstrate how to find the vertex and axis of symmetry. Find the equation of this fence line. Equation of a line that passes halfway between two points in 2942 equidistant equation of a plane between two points find an equation of the plane consisting all points that are solved find the equation of plane each point which Equation Of A Line That Passes Halfway Between Two Points In 2942 Equidistant Equation Of A Plane Between…. Fractions should be entered with a forward slash such as '3/4. I think I have the general idea of this one. This theorem is a royal mouthful, so the best way to. Explain why the x-coordinates of the points where the graphs of the equations y = f(x) and y = g(x) intersect are the solutions of the equation f(x) = g(x); find | {
"domain": "shantideva.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9910145696551569,
"lm_q1q2_score": 0.8423338188635793,
"lm_q2_score": 0.8499711756575749,
"openwebmath_perplexity": 236.3292171589137,
"openwebmath_score": 0.6133164763450623,
"tags": null,
"url": "http://gpuf.shantideva.it/find-an-equation-of-the-set-of-all-points-equidistant-from-the-points-calculator.html"
} |
data
For example: if you have a malicious library on your app/code than that malware will reside only on that container for the time of container being live, containers does run as endpoint all the time and didn’t saw a case that will spread the malware into network.
monitoring a container node is robust and you can put add-on or service to monitor behaviors of application or node, and will only replicate new node/container only and only based on config file. | {
"domain": "datascience.stackexchange",
"id": 10104,
"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": "data",
"url": null
} |
beginner, game, ruby, number-guessing-game
In this case, we are going to use Integer#upto for the loop.
The method now looks like this:
def start
random_num = rand(100) | {
"domain": "codereview.stackexchange",
"id": 42030,
"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, game, ruby, number-guessing-game",
"url": null
} |
sql, sql-server, null
Note, you seem to have an extra , at the end of your selection list.
Using the above system there is no need for the if-conditions.
An alternate syntax which reduces the process to arithmetic, would be:
SELECT @ct1 = 1 * isNull(TypeDaily,0),
@ct2 = 2 * isNull(TypeTerm, 0),
@ct3 = 3 * isNull(TypePerformance,0),
@ct4 = 4 * isNull(TypeWeather,0),
.....
FROM ReportTable
WHERE ReportSelectionId = @ReportSelectionId;
In the past (before the case statement was available) I used to do calculations like the above, but depending on the circumstances, it can be less readable than the case. In this instance, I think the case is still better. | {
"domain": "codereview.stackexchange",
"id": 10098,
"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": "sql, sql-server, null",
"url": null
} |
python, python-3.x, strings, converting
Title: Converting a set into a string The input is a set of alphabets.
The output is a string of 32 in length.
For any letter in the set if it is preceded by a '¬' we replace the n-th character in our output string with '0', such that n is the position of the letter in the alphabets. If it is not preceded by a '¬' and was there in the set then we replace it with '1', And finally if it wasn't there in the set then we replace it with 'b'.
So for an input like: {'¬g10','d13','ae6','f3','¬aa5','¬bg28','a2','¬af3'}
The output is: "1bb1b10bbbbbbbbbbbbbbbbbbb0bbb10"
Note that 'd' is the fourth letter and do not have a '¬' before it so we wrote '1' in the fourth character.
Note also that we count 'aa' as the 27th letter and 'ae' as the 31th letter.
For the numbers do not mind them. Treat them like they're not exist!
I came up with this solution to this problem:
set = {'¬g10','d13','ae6','f3','¬aa5','¬bg28','a2','¬af3'}
delemiter = 'false'
result = 'b'*32
result = list(result)
set = str(set) | {
"domain": "codereview.stackexchange",
"id": 35696,
"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, python-3.x, strings, converting",
"url": null
} |
image-processing, lowpass-filter, opencv, bandpass, highpass-filter
Title: How can I construct a Band-pass filter from a low and a high-pass filter? Suppose, I need to construct a Band-pass filter in OpenCV. But, I know, there are no functions in OpenCV for Band-pass filters.
Now, what I need to do is to have a low-pass filter and a high-pass filter and combine them as a series. That is, first, the image would be passed through a low-pass filter and then the output of that low-pass filter would be passed to a high-pass filter.
Am I correct?
Now, what kind of low and high pass filters should I use? Would they be,
Gassian low/high pass filters
Mean low/high pass filters
Median low/high pass filters
Sobel filters
or, anything else... Yes you are correct. You apply them if series in they are linear.
One simple band-pass filter you could use is called the difference of Gaussian (DoG)
The procedure is: | {
"domain": "dsp.stackexchange",
"id": 3936,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, lowpass-filter, opencv, bandpass, highpass-filter",
"url": null
} |
c#
S - Single Responsibility Principal: Now rather than a single Board class with all responsibilities, there is are independent engine and the ConnectFour classes each with have their own more narrow responsibility.
O - Open/Closed Principle - Exposing the engine only thru IXInARowGameEngine opens the IXInARowGameEngine behavior for extension, but not modification.
L - Liskov substitution principle - For testing, you can now use a stub IXInARowGameEngine to test your game independent of using the actual XInARowGameEngine class.
I - Interface Segregation Principle - You have reduced the implicit Board class public interface to at least two smaller and abstract interfaces with more focused purposes. | {
"domain": "codereview.stackexchange",
"id": 37099,
"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#",
"url": null
} |
machine-learning, missing-data
# Use 10 nearest rows which have a feature to fill in each row's missing features
X_fill_knn = KNN(k=10).fit_transform(X)
Here are different methods also supported by this package:
•SimpleFill: Replaces missing entries with the mean or median of each
column.
•KNN: Nearest neighbor imputations which weights samples using the
mean squared difference on features for which two rows both have
observed data.
•SoftImpute: Matrix completion by iterative soft thresholding of SVD
decompositions. Inspired by the softImpute package for R, which is
based on Spectral Regularization Algorithms for Learning Large
Incomplete Matrices by Mazumder et. al.
•IterativeSVD: Matrix completion by iterative low-rank SVD
decomposition. Should be similar to SVDimpute from Missing value
estimation methods for DNA microarrays by Troyanskaya et. al.
•MICE: Reimplementation of Multiple Imputation by Chained Equations.
•MatrixFactorization: Direct factorization of the incomplete matrix | {
"domain": "datascience.stackexchange",
"id": 8575,
"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, missing-data",
"url": null
} |
java, algorithm, complexity, cyclomatic-complexity
}
}
Here are my relevant questions to this
I am sure the time complexity is not O(n) and O(n^2)
In this case, how do I calculate time complexity and what is it in this case?
And coming to space complexity, creating RepeatedEntry objects in a loop, is it a performance issue?
I have assumed the input array to be Integer wrapper, if it was strictly int primitive, the conversions and complexity's would increase I guess. I thought of storing the result in HashMap but avoided as it needs further processing to fetch the output, any answer using HashMap improving complexity would help me learn too and best possible solutions as well. (Useful: What is the difference between O, Ω, and Θ?)
How do I calculate time complexity and what is it in this case? | {
"domain": "codereview.stackexchange",
"id": 27983,
"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, algorithm, complexity, cyclomatic-complexity",
"url": null
} |
motor, microcontroller
Are there even better alternatives for a motor controller? | {
"domain": "robotics.stackexchange",
"id": 1239,
"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": "motor, microcontroller",
"url": null
} |
# Moderate Percentages Solved QuestionAptitude Discussion
Q. When processing flower-nectar into honeybees' extract, a considerable amount of water gets reduced. How much flower-nectar must be processed to yield 1kg of honey, if nectar contains $50%$ water, and the honey obtained from this nectar contains $15%$ water?
✖ A. 1.5 kgs ✔ B. 1.7 kgs ✖ C. 3.33 kgs ✖ D. None of these
Solution:
Option(B) is correct
Flower-nectar contains $50\%$ of non-water part.
In honey this non-water part constitutes $85\% (100-15)$.
Therefore $0.5X$ Amount of flower-nectar = $0.85X$ Amount of honey = $0.85\times 1$ kg
Therefore amount of flower-nectar needed
$=\left(\dfrac{0.85}{0.5}\right)\times 1$
$=1.7$ kg
## (7) Comment(s)
Babar
()
50% of 100g is 50 g. if we are to get 1 kg honey we have to have 2 kg raw material because there is 50% water. there are also 15% additional water contents so we have to have more than 2 kg raw material. the given answers are wrong.
Azex
()
Doubt. | {
"domain": "lofoya.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534338604443,
"lm_q1q2_score": 0.8561683247684924,
"lm_q2_score": 0.8723473730188542,
"openwebmath_perplexity": 4781.36100749182,
"openwebmath_score": 0.5249518752098083,
"tags": null,
"url": "http://www.lofoya.com/Solved/1481/when-processing-flower-nectar-into-honeybees-extract-a"
} |
c#, performance, linq, antlr, rubberduck
return result;
}
private IEnumerable<string> GetImplementedInterfaceMembers(Declarations declarations, string componentName)
{
var classes = declarations.Items.Where(item => item.DeclarationType == DeclarationType.Class);
var interfaces = classes.Where(item => item.References.Any(reference =>
reference.Context.Parent is VBAParser.ImplementsStmtContext
&& reference.QualifiedModuleName.ModuleName == componentName));
var members = interfaces.SelectMany(declarations.FindMembers)
.Select(member => member.ComponentName + "_" + member.IdentifierName);
return members;
}
}
}
As you can see there are a number of constraints and assumptions that we need to make here: | {
"domain": "codereview.stackexchange",
"id": 12992,
"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#, performance, linq, antlr, rubberduck",
"url": null
} |
experimental-physics, orbital-motion, home-experiment, moon, tidal-effect
In any case, it's clear that some kind of measurement must be possible: in the worst case you can send an unmanned rocket probe to the presumed location of the Moon where its gravitational effect should be obvious. Such a space probe is very expensive though. This is why I'm asking not whether such a measurement is possible, but how easy it is. In the summer of 2010, I had the opportunity to attend a presentation by Reiner Rummel, involved in the GOCE satellite containing a very precise gradiometer. The presentation can be found on the ESA website. It contains a table with orders of magnitude for the accelerations they could measure when still in the lab.
The gravitational acceleration in the lab in Munich they measured is $g=9.80724672 m s^{-2}$. Components (quoted literally from the aforelinked presentation), all units in $m s^{-2}$: | {
"domain": "physics.stackexchange",
"id": 91562,
"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": "experimental-physics, orbital-motion, home-experiment, moon, tidal-effect",
"url": null
} |
python, game, python-3.x
Title: Boggle board game solver in Python I have written a Boggle board solver in Python 3. I would like comments on readability and structure. Thank you!
Boggle
Boggle is a board game with a 4x4 board of squares, each of which has a letter, in which you score points by finding words on the board. This is an example Boggle board:
c a t c
a t c a
t c a t
c a t c
This board contains the words 'cat', 'act', 'tact', etc. The words must be made up of neighboring squares, and you can't use the same square twice in a word. Words don't need to be in a straight line.
Program overview
Create an empty Boggle board, with a given word list:
b = Boggle('twl06.txt')
The program depends on an external dictionary file. You can obtain one here for example.
Fill the board, row by row:
b.set_board('catcatcatcatcatc')
List the words in the board:
b.find_words()
Score the board:
b.score() | {
"domain": "codereview.stackexchange",
"id": 22770,
"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, game, python-3.x",
"url": null
} |
standard-model, quarks, weak-interaction
The basis of your error is misappreciation of the differing roles of flavor (mass eigenstates) and weak isospin states. The six flavors used, upness, down-ness, charm, strangeness, top and beauty, correspond to mass eigenstates, the six quarks we know. In the lepton sector, the three charged leptons and the three neutrino mass eigenstates, (hopefully) temporarily dubbed 1, 2, and 3. | {
"domain": "physics.stackexchange",
"id": 70235,
"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": "standard-model, quarks, weak-interaction",
"url": null
} |
#### ktpr2
Um, isn't that just a cylinder then? And I suppose i introduced an extra constraint; the cross sectino is never said to decrease.
#### ehild
Homework Helper
ktpr2 said:
Um, isn't that just a cylinder then? And I suppose i introduced an extra constraint; the cross sectino is never said to decrease.
It is!!!! :rofl:
ehild
#### HallsofIvy
Homework Helper
The figure in the original problem is not a cylinder because, if it were, the cross sections would be rectangles, not squares (the cross section at the diameter would be a square but as you move toward the ends of the diameter at right angles to your cross sections, the base length gets smaller- with a cylinder the height doesn't).
ktpr2 was right the first time- it's a sort of "blocky" football. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9674102566433705,
"lm_q1q2_score": 0.8061667626202791,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 789.1381134995759,
"openwebmath_score": 0.7411032915115356,
"tags": null,
"url": "https://www.physicsforums.com/threads/volume-question-with-cirular-base-and-square-top.80013/"
} |
sam, ngs, samtools, gatk, picard
I see that the value under the column PERCENT_DUPLICATION in dups/dupsMetrics.txt is 0.065555 (given the column name, I would expect that the value is indeed 0.06%, and not 6.55%)
What would be the explanation between the discrepancy in the output of samtools flagstat and MarkDuplicates. Is it reasonable to expect that the value displayed by samtools flagstat is rounded to zero, given the low percentage which was observed by MarkDuplicates (0.06%)? There are duplicates, in this line:
1636809 + 0 duplicates, gives 1636809/26595942 = 0.06154356
According to samtools documentation for flagstat:
Provides counts for each of 13 categories based primarily on bit flags
in the FLAG field. Each category in the output is broken down into QC
pass and QC fail. In the default output format, these are presented as
"#PASS + #FAIL" followed by a description of the category.
So you can usually take whatever is in the first column | {
"domain": "bioinformatics.stackexchange",
"id": 1346,
"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": "sam, ngs, samtools, gatk, picard",
"url": null
} |
fluid-dynamics, pressure
Title: Why do trains have to slow down when crossing in a tunnel? When two trains cross inside a tunnel, the velocity of the air around the train increases so the pressure decreases (Bernoulli's Principle). Using that logic, the windows are pushed outwards because the pressure outside is inferior then the pressure inside the train (which continues to be $P_{\rm atm}$, right?).
The problem is when two trains cross on a tunnel the relative velocity between them will be $v = v_{\rm train\,1} - v_{\rm train\,2}$. So the velocity will be inferior compared to the velocity of the train going by himself.
My logic must be wrong because I'm pretty sure trains only slow down when crossing the tunnel together, right? I think you're confused. When two trains cross each other, the velocity one sees the other is (classically):
$$
\vec{v}_{1,2} = \vec{v}_{2,t} - \vec{v}_{1,t}.
$$
But they go in opposite directions, so the absolute value (i.e. speed) is simply the sum
$$
v_{1,2}=v_{1,t}+v_{2,t},
$$ | {
"domain": "physics.stackexchange",
"id": 67827,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, pressure",
"url": null
} |
vba, excel
Dim j As Long
For j = LBound(splitAddresses) To UBound(splitAddresses)
If Len(splitAddresses(i)) > 1 Then
Dim splitRecord As record
Set splitRecord = New record
' Because of how objects are passed around, you cant copy a class through assignment. You must duplicate the properties manually into a new class.
splitRecord.FromField = initialRecord.FromField
splitRecord.Subject = initialRecord.Subject
splitRecord.ReceivedDate = initialRecord.ReceivedDate
splitRecord.InFolder = initialRecord.InFolder
splitRecord.Size = initialRecord.Size
splitRecord.WeekDay = initialRecord.WeekDay
splitRecord.RecordDate = initialRecord.RecordDate
splitRecord.Month = initialRecord.Month
splitRecord.Year = initialRecord.Year | {
"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
} |
Note that $\frac{\binom{r-1}{j}\binom{w}{n-j-1}}{\binom{r+w-1}{n-1}}$ is the probability that when you draw $n-1$ balls from an urn that contains $r-1$ red and $w$ white, you will get exactly $j$ red balls. When we sum this from $j=0$ to $r-1$, we are adding up all the probabilities, so the complicated-looking sum is equal to $1$. We conclude that $$E(X)=\frac{rn}{r+w}\sum_{j=0}^{r-1} \frac{\binom{r-1}{j}\binom{w}{n-j-1}}{\binom{r+w-1}{n-1}}=\frac{rn}{r+w}.$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9911526462237642,
"lm_q1q2_score": 0.8056755998433898,
"lm_q2_score": 0.8128673246376009,
"openwebmath_perplexity": 88.55277140542196,
"openwebmath_score": 0.9595666527748108,
"tags": null,
"url": "http://math.stackexchange.com/questions/119145/expected-value-of-a-hypergeometric-random-variable"
} |
where calculating the partial derivatives is hard.) and an additional 40 workbooks with extra practice problems, to help you test your understanding along the way. Don't show me this again. Elementary partial derivative problems by Duane Q. Nykamp is licensed under a Creative Commons Attribution-Noncommercial-ShareAlike 4.0 License. Partial fraction expansion. Here is a set of practice problems to accompany the Partial Derivatives section of the Partial Derivatives chapter of the notes for Paul Dawkins Calculus III course at Lamar University. 10 docs 13 videos 15 tests. Questions on the quiz include the use of variables and exponents. Find @f @x and @f @y for the following functions: 1. f(x;y) = (x2 1)(y + 2) 2. f(x;y) = ex+y+1 3. f(x;y) = e x sin(x+ y): Solutions 1. Chapter 6 - Application of Derivatives. ${x^2}\sin \left( {{y^3}} \right) + x{{\bf{e}}^{3z}} - \cos \left( {{z^2}} \right) = 3y - 6z + 8$. Courses View All. Vectors and Matrices Part A: Vectors, Determinants and Planes ... | {
"domain": "townhouserehab.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846691281407,
"lm_q1q2_score": 0.819514526715087,
"lm_q2_score": 0.8376199592797929,
"openwebmath_perplexity": 930.6463613678525,
"openwebmath_score": 0.449405699968338,
"tags": null,
"url": "http://townhouserehab.com/qgmtpkm/partial-derivatives-practice-questions-a000ce"
} |
ros-humble, ros2-control, gazebo-ros2-control
)
)
declared_args.append(
DeclareLaunchArgument(
"description_file",
default_value = "linear_slider.urdf.xacro",
description = "URDF/xacro description file of the robot."
)
)
declared_args.append(
DeclareLaunchArgument(
"prefix",
default_value = '""',
description = "Prefix of the joint names, useful for multi-robot setup. If changed, then you need to update the joint names in the controllers' description."
)
)
declared_args.append(
DeclareLaunchArgument(
"use_mock_hardware",
default_value = "false",
choices=['true', 'false'],
description = "Start robot with fake hardware mirroring command to its states."
)
)
declared_args.append(
DeclareLaunchArgument(
"mock_sensor_commands",
default_value = "false", | {
"domain": "robotics.stackexchange",
"id": 39074,
"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-humble, ros2-control, gazebo-ros2-control",
"url": null
} |
quantum-mechanics, electromagnetism, general-relativity, speed-of-light
How can there be experimental evidence of non-zero difference between the speed of EM waves and GWs? Although I did not read the full paper, there might be some details contribuing to the answer.
In theory light and GW travel with the same speed, but the medium in which they travel is very different. Light travels through the current medium in space. GW perform changes to the space, that travel with the speed of light. So while GW are not
affected from a medium, light is.
Now as you would expect the space to be completly empty, it isn't. Particles can form in pairs of particle and anti-particle for short times, due to the Heisenberg uncertainty principle (borrow energy for a short time -> create the mass for particle-anti-particle pairs -> give them back (annihilation) in time). This "fills" the vacuum with virtual particles, which create an effective medium and lowers the speed of light, if interactions of the photons and the virtual particles happen. | {
"domain": "physics.stackexchange",
"id": 52270,
"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, electromagnetism, general-relativity, speed-of-light",
"url": null
} |
cosmology, cosmological-inflation, multiverse
perceives the bubble universe to be infinite? This analogy may help: suppose you want to simulate Conway's game of life on an infinite board with unbounded, nonperiodic initial conditions (e.g., the binary digits of pi in a spiral pattern). You can't start by simulating the first time step of every cell, because it would take forever and you'd never get to the second time step (it would also take infinite storage space). But you can simulate the first time step at the origin, then the next time step of a 3×3 square centered at the origin, then the next time step of a 5×5 square, etc. This way, you will eventually simulate every particular time step, no matter how large, of every particular cell, no matter how far from the origin. The evolution of distant cells lags behind the origin, but that makes no difference to the correctness of the simulation. You also need only finite storage space at any finite simulation time. | {
"domain": "physics.stackexchange",
"id": 80830,
"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, cosmological-inflation, multiverse",
"url": null
} |
human-biology, olfaction, nose, odour
Being exposed to a strong odour for some time would make the subject smell an other odour (a complementary odour?) when the strong odour disappear even if nothing casts this new "complementary" odour to the nose. We could call this an "afterodour" or a "complementary ordour". The problem with odors is that no known odorant hits only one olfactory receptor. A saturating concentration of compound X for receptor A might be saturating another receptor B, but not receptor C. If you now decrease the concentration, receptor A is still saturated, receptor B is only partially activated and receptor C is not activated at all. Since smell is perceived as the sum of inputs from all olfactory receptors, the smell at the different concentrations will be perceived totally different because of the different receptor activation. Exposing a nose to a strong stimulus will always stimulate more than one receptor, so saturation will occur at more than one receptor. | {
"domain": "biology.stackexchange",
"id": 5638,
"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-biology, olfaction, nose, odour",
"url": null
} |
graph-theory, co.combinatorics, soft-question, big-list, expanders
The paper includes definitions for superconcentrators, generalizers, and non-blocking networks. One may also encounter other types of graphs, such as expanders and Ramanujan graphs in the literature.
These types of graphs are usually studied as "families of graphs." There are a number of papers (such as Pinsker [1], Valiant, Pippenger, and Gabber-Galil) which try to explicitly construct such families, while optimizing parameters like size, density, sparsity, and the like.
The problem is that while those papers are excellent for research, they don't help much pedagogically. Let's clarify: Consider a student who sees the definition of a concentrator (or any similar graph) for the first time. His best bet to understand the definition is to imagine it pictorially, or see an illustration of examples and non-examples of a concentrator.
I've been searching for such simple examples of Special Graph Families for quite a while, but didn't achieve much. So, the question is: | {
"domain": "cstheory.stackexchange",
"id": 730,
"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": "graph-theory, co.combinatorics, soft-question, big-list, expanders",
"url": null
} |
# Let $A$ be the $n\times n$ matrix with a $1$ in every entry. What are the eigenvalues of $A$? Is $A$ diagonalizable?
Let $A$ be the $n\times n$ matrix with a $1$ in every entry. What are the eigenvalues of $A$ and a basis for each eigenspace? Is $A$ diagonalizable?
Having some trouble with this one. I tried using the fact that $\lambda$ is an eigenvalue of $A$ iff there exist non-zero solutions to $Ax=\lambda x$. Well, clearly the $1\times n$ non-zero vector $x$ with all entries equal is an eigenvector of $A$, with corresponding eigenvalue $\lambda=n$, since $Ax=nx$. But I can't seem to get much further than that in terms of finding eigenvalues for $A$, any hints/suggestions? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964177527897,
"lm_q1q2_score": 0.8696294921747943,
"lm_q2_score": 0.8824278571786139,
"openwebmath_perplexity": 92.53505919731597,
"openwebmath_score": 0.9701855182647705,
"tags": null,
"url": "https://math.stackexchange.com/questions/1696366/let-a-be-the-n-times-n-matrix-with-a-1-in-every-entry-what-are-the-eigenv"
} |
master, turtlesim, ros-hydro, roscore, rosjava
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)
Caused by: org.ros.exception.RemoteException:
at org.ros.internal.node.response.Response.fromListChecked(Response.java:115)
at org.ros.internal.node.client.SlaveClient.publisherUpdate(SlaveClient.java:119)
at org.ros.internal.node.server.master.MasterServer.contactSubscriberForPublisherUpdate(MasterServer.java:269)
at org.ros.internal.node.server.master.MasterServer.publisherUpdate(MasterServer.java:251)
at org.ros.internal.node.server.master.MasterServer.registerPublisher(MasterServer.java:225) | {
"domain": "robotics.stackexchange",
"id": 15730,
"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": "master, turtlesim, ros-hydro, roscore, rosjava",
"url": null
} |
# What are some applications of elementary linear algebra outside of math?
I'm TAing linear algebra next quarter, and it strikes me that I only know one example of an application I can present to my students. I'm looking for applications of elementary linear algebra outside of mathematics that I might talk about in discussion section.
In our class, we cover the basics (linear transformations; matrices; subspaces of $\Bbb R^n$; rank-nullity), orthogonal matrices and the dot product (incl. least squares!), diagonalization, quadratic forms, and singular-value decomposition.
Showing my ignorance, the only application of these I know is the one that was presented in the linear algebra class I took: representing dynamical systems as Markov processes, and diagonalizing the matrix involved to get a nice formula for the $n$th state of the system. But surely there are more than these. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9702399069145609,
"lm_q1q2_score": 0.8064081493286263,
"lm_q2_score": 0.8311430436757312,
"openwebmath_perplexity": 362.63873754561075,
"openwebmath_score": 0.6874520778656006,
"tags": null,
"url": "https://math.stackexchange.com/questions/1072459/what-are-some-applications-of-elementary-linear-algebra-outside-of-math/1072463"
} |
thermodynamics
Title: Can we increase temperature of a gas by oscillating its pressure? Q: Is temperature directly proportional to rate of fluctuation of pressure?
--->What I mean by Oscillation/Fluctuation of Pressure
From oscillation of pressure I mean constantly increasing and decreasing the pressure by a fixed amount.
For example imagine a room with a pressure of 50 pascal, if we first increase its pressure to 55 and then decrease the pressure to 45 that would be oscillating the pressure by 5 units back and forth
Suppose we do not add more molecules and our cube container is changing the shape. There are no sound-like longitudinal waves produced and everywhere pressure changes at the same time.
]
Reason that made me ask this question:
Because if temperature depends upon the KE of molecules and we oscillate the pressure we will just be shaking the molecules inside. So this should increase the temperature as well because the more you shake the more motion particles do. | {
"domain": "physics.stackexchange",
"id": 98846,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics",
"url": null
} |
Depending on your preferred Layout convention, the derivative could be either
$$\frac{d(x^TAx)}{dx} = x^T(A + A^T)$$
or
$$\frac{d(x^TAx)}{dx} = (A + A^T)x$$
Yes. Write $$g(x,y) = x^TAy$$, note that $$f(x)=g(x,x)$$, and compute $$Df(x) = D_xg(x,x) + D_yg(x,x).$$You know that $$D_xg(x,y)(v) = v^TAy\quad\mbox{and}\quad D_yg(x,y)(v)=x^TAv.$$So $$Df(x)(v) = v^TAx + x^TAv = x^TA^Tv + x^TAv = x^T(A+A^T)v = ((A+A^T)x)^Tv.$$This means that $$\nabla f(x) = (A+A^T)x,$$in view of the characterization $$Df(x)(v) = (\nabla f(x))^Tv$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9904406012172463,
"lm_q1q2_score": 0.8143294989060836,
"lm_q2_score": 0.8221891327004133,
"openwebmath_perplexity": 544.8604197290794,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://math.stackexchange.com/questions/3845708/matrix-differentiation-with-vector-variables-on-either-side-of-matrix/3846274"
} |
homework-and-exercises, newtonian-mechanics, forces, friction
Title: Which normal force for friction? Two objects are stacked on each other with a nonzero coefficient of static friction between them, and the bottom block sits on a frictionless table. A force is applied rightward to the bottom block, and the right block moves along with it due to the static friction they exert on each other. My question is how do you know the magnitude of this static friction? Static friction is equal to the coefficient of friction multiplied by the normal force, but what normal force are we talking about? The normal force applied by the table on the bottom object? The normal force applied by the bottom force on the top block, even when it’s the bottom block that’s being pushed by the external force? Does the reaction force applied by the top block on the bottom block count as a “normal force”? The only friction in the problem is between the top and bottom block. There is no friction between the table and the bottom block, so the normal force at that interface is | {
"domain": "physics.stackexchange",
"id": 33681,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, forces, friction",
"url": null
} |
php, security, pdo, authentication, session
</li>
';
}else{
$_SESSION['crecketgaming_menuadmin'] = '';
}
$_SESSION['crecketgaming_profileicon'] = 'class="icon-user_male icon2x right padding"';
$_SESSION['crecketgaming_menuaccount'] = '<li><a>Account</a><ul><li><a href="/profile">My profile</a></li><li><a href="/logout">Logout</a></li></ul></li>';
$_SESSION['crecketgaming_webshopmessage'] = "<li><a>Market</a><ul><li><a href='index.php'>Market</a></li><li><a href='profile?userid=" . $_SESSION['crecketgaming_userid'] . "'>My profile</a></li><li><a href='newsale'>New/Change sale</a></li></ul></li>";
}elseif (!Isset($_SESSION['crecketgaming_username']) || $_SESSION['crecketgaming_username'] = "" ) {
$_SESSION['crecketgaming_webshopmessage'] = "<li><a href='index.php'>Market</a></li>";
$_SESSION['crecketgaming_loginmessage'] = "
<a href='login.php'>
<div class='s-12 l-12 shadow profbox'>
<div class='line'>
<div class='margin-bottom'> | {
"domain": "codereview.stackexchange",
"id": 12846,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, security, pdo, authentication, session",
"url": null
} |
type-theory, correctness-proof, intuition, proof-assistants, curry-howard
a type in the language corresponds to a formula in the logic
a program in the language corresponds to a description of a proof in the logic
a well-typed program in the language corresponds to a description of a valid proof in the logic.
a program of a specific type in the language corresponds to a proof of a specific formula in the logic
a value in the language correspond to truth in the logic
evaluation of programs to values corresponds to soundness of the proving rules
reification of values to programs corresponds to completeness of the proving rules
... | {
"domain": "cs.stackexchange",
"id": 4268,
"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": "type-theory, correctness-proof, intuition, proof-assistants, curry-howard",
"url": null
} |
c++, stl
3) What are you trying to acieve here?
if( ( num.size( ) & 1 ) == 1 )
You are trying to validate that the input has an even number of floats as input.
Why are you trying to make that fact cryptic. If you must do this then make a comment on you intent. Code is going to be in maintenance a lot longer than it takes to develop. Make sure you make it easy to understand.
5) You are doing too much work here:
for( vector<float>::iterator vit=num.begin( );
vit!=num.end( ); vit+=2 )
Here you could have used a standard algorithm. I would have used std::copy(). Also by using += 2 you are limiting yourself to random access iterators ie vectors. You are code should try and be neutral on the type of container. Thus limit yourself to the ++ operator.
6) Dynamically allocating the pointer.
point *in = new point( ); | {
"domain": "codereview.stackexchange",
"id": 531,
"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++, stl",
"url": null
} |
complexity-theory, reductions, polynomial-time
Title: polynomial time reduction of 2 langauges If we can reduce a language y to x.
x ≤P y
how do I prove
x(complement) ≤P y (complement) The definition of many-one reducibility means that, if you've proven that $X\leq Y$, you get $\overline{X}\leq\overline{Y}$ for free. | {
"domain": "cs.stackexchange",
"id": 3618,
"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": "complexity-theory, reductions, polynomial-time",
"url": null
} |
c#, .net, mvvm, async-await, windows-phone
public UserServiceProxy(IUserApi userApi, IUserRepository userRepository, IUserSettings userSettings, IAuthService authService)
{
if (userApi == null) { throw new ArgumentNullException("userApi", "The userApi can't be null"); }
if (userRepository == null) { throw new ArgumentNullException("userRepository", "The userRepository can't be null"); }
if (userSettings == null) { throw new ArgumentNullException("userSettings", "The settings can't be null"); }
if (authService == null) { throw new ArgumentNullException("authService", "The authService can't be null"); }
_userApi = userApi;
_userRepository = userRepository;
_userSettings = userSettings;
_authService = authService;
} | {
"domain": "codereview.stackexchange",
"id": 12000,
"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#, .net, mvvm, async-await, windows-phone",
"url": null
} |
c++, object-oriented, c++11
void to(const Point &target)
{
squareToMove.topLeft = offsetHalfWidth(target);
}
private:
Point offsetHalfWidth(Point p)
{
const float halfWidth(squareToMove.width / 2.0f);
return Point{
p.x - halfWidth,
p.y - halfWidth};
}
private:
Square &squareToMove;
};
class MoveCircle
{
public:
MoveCircle(Circle &circle)
:
circleToMove(circle)
{}
void to(Point position)
{
circleToMove.middle = position;
}
private:
Circle &circleToMove;
};
inline MoveSquare move(Square &square)
{
return MoveSquare{square};
}
inline MoveCircle move(Circle &circle)
{
return MoveCircle{circle};
}
The main idea is being able to have code that reads like a sentence. Such as:
int main() {
Square aSquare;
aSquare.topLeft = Point{1,1};
aSquare.width = 3;
Circle aCircle;
aCircle.middle = Point{1,1};
aCircle.radius = 2; | {
"domain": "codereview.stackexchange",
"id": 8450,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented, c++11",
"url": null
} |
java, performance, sorting, quick-sort
// Compares elemets in A1 and A2 and sorts them
while(current1 < A1.length && current2 < A2.length) {
if(A1[current1] < A2[current2])
temp[current3++] = A1[current1++];
else
temp[current3++] = A2[current2++];
}
// Merge two arrays into temp
while(current1 < A1.length)
temp[current3++] = A1[current1++];
while(current2 < A2.length)
temp[current3++] = A2[current2++];
}
public static long heap(int[] A) {
long startTime = System.nanoTime();
int temp;
int heapSize = A.length-1;
buildMaxHeap(A);
for(int i = A.length-1; i >= 1; i--) {
swap(A,0,i); // Root is now biggest element, swap to end of array
heapSize--; // Reduce heapSize to ignore sorted elements
maxHeapify(A,0,heapSize);
}
long endTime = System.nanoTime();
return endTime - startTime;
} | {
"domain": "codereview.stackexchange",
"id": 10166,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, performance, sorting, quick-sort",
"url": null
} |
organic-chemistry, alcohols, stability, carbocation, rearrangements
References:
Ye, T.; McKervey, M. A. Organic Synthesis with α-Diazo Carbonyl Compounds. Chem. Rev. 1994, 94 (4), 1091-1160. DOI: 10.1021/cr00028a010.
Mock, W. L.; Hartman, M. E. Synthetic scope of the triethyloxonium ion catalyzed homologation of ketones with diazoacetic esters. J. Org. Chem. 1977, 42 (3), 459-465. DOI: 10.1021/jo00423a015.
Liu, H. J.; Majumdar, S. P. On the Regioselectivity of Boron Trifluoride Catalyzed Ring Expansion of Cycloalkanones with Ethyl Diazoacetate. Synthetic Communications 1975, 5 (2), 125-130. DOI: 10.1080/00397917508061442. | {
"domain": "chemistry.stackexchange",
"id": 10174,
"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, alcohols, stability, carbocation, rearrangements",
"url": null
} |
were (provided only that both variables have nonzero standard deviations). $$\therefore |Cov(X,Y)| \le \sqrt{Var(X)Var(Y)}$$. Freely browse and use OCW materials at your own pace. Now here we have a non-negative random variable, and its expected value is 0, which means that when we, calculate the expected value of this there will be no, positive contributions and so the only contributions must be, This means that X minus rho Y has to be equal to 0 with, So X is going to be equal to rho times Y and this will. Now here we have a non-negative random variable, and its expected value is 0, which means that when we calculate the expected value of this there will be no positive contributions and so the only contributions must be equal to 0. For e.g., if the correlation coefficient between the heights and weights of students is computed as 0.98, it will be expressed simply as 0.98 (neither as 0.98 inches nor 0.98 pounds). It is visually apparent that in the situation in panel (a), $$x$$ could | {
"domain": "thaiplus.net",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9766692264378963,
"lm_q1q2_score": 0.8095990184965997,
"lm_q2_score": 0.8289388019824947,
"openwebmath_perplexity": 550.7072396013566,
"openwebmath_score": 0.6638980507850647,
"tags": null,
"url": "http://thaiplus.net/9p6gaeax/page.php?id=f1f531-coefficient-of-correlation-lies-between-proof"
} |
cc.complexity-theory, np, p-vs-np
If a problem satisfies the stronger requirement that
$\Omega(n^2)$ or $\omega(n^2)$ time is needed (for all large enough inputs) then better,
but infinitely often will do. Adachi, Iwata, and Kasai in a 1984 JACM paper show by reduction that the Cat and $k$-Mice game has an $n^{\Omega(k)}$ time lower bound. The problem is in P for each $k$. The problem is played on a directed graph. The moves consist of the cat and then one of the $k$ mice alternating steps. The mice win if they can land on a designated cheese node before the cat lands on them. The question is whether the cat has a forced win. It is actually a complete problem so the lower bound is really based on the diagonalization that gives the time hierarchy.
Grandjean showed that the Pippenger, Paul, Szemeredi, and Trotter time lower bound applies to a SAT encoding, though the result of Santhanam may subsume it. | {
"domain": "cstheory.stackexchange",
"id": 2053,
"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": "cc.complexity-theory, np, p-vs-np",
"url": null
} |
ruby, file-system
But hinting at what something is is very useful, and helps self-document the code. For example, I usually use plural for array variables or methods that return array. Also, somewhat particular to Ruby, a method call without arguments looks like any other variable, since we don't need to add () at the end. For instance, a line like directories.map ... looks the same whether directories is a local variable or a method. So if you were to refactor the code above and extract the first line into a separate method, you might as well call that method directories, since, hey, the name's worked well so far and it's pretty descriptive:
def directories # same name, but now a method
spec_repo.select { |path| File.directory?(path) }
end | {
"domain": "codereview.stackexchange",
"id": 6251,
"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": "ruby, file-system",
"url": null
} |
# A smooth function $f(x)$ has a unique local and global minimum. What happens to its location as $f(x)$ varies smoothly in time?
Let $f(x,t)$ be a smooth function $\mathbb R^2\to\mathbb R$ such that $F_t(x):=f(x,t)$ has a unique local minimum in $x$ for every fixed $t\in[0,1]$. Further assume that this local minimum of $F_t(x)$ is also the unique global minimum of $F_t(x)$.
How regularly does the location of this unique minimum vary with respect to $t$? In other words, if $x=\chi(t)$ is the $x$-value where $F_t(x)$ attains its unique minimum, can we say that $\chi(t)$ is a smooth function of $t$? If not, is $\chi(t)$ differentiable or continuous?
I asked a similar version of this question here. The answer was correct and very clever, but I was wondering what happens if we insist that the unique global minimum was also a unique local minimum. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.974821157567904,
"lm_q1q2_score": 0.8246425897590596,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 343.4851264965271,
"openwebmath_score": 0.6234963536262512,
"tags": null,
"url": "https://math.stackexchange.com/questions/2208776/a-smooth-function-fx-has-a-unique-local-and-global-minimum-what-happens-to"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.