text stringlengths 49 10.4k | source dict |
|---|---|
scikit-learn, decision-trees, cart
Title: scikit learn target variable reversed (DecisionTreeClassifier) I created a Decision Tree Classifier using sklearn, defined the target variable:
#extract features and target variables
x = df.drop(columns="target_column",)
y = df["target_column"]
#save the feature name and target variables
feature_names = x.columns
labels = y.unique()
#split the dataset
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x,y, test_size = 0.3, random_state = 42)
Additionally I checked the count of each of the two classes (Success, Failure) within y which confirmed to me that each has the correct count.
Then I fitted my DTClassifier:
clf = DecisionTreeClassifier(
criterion='gini',
splitter='best',
max_depth=None,
min_samples_split=2,
min_samples_leaf=1,
min_weight_fraction_leaf=0.0,
max_features=None,
random_state=42,
max_leaf_nodes=None,
min_impurity_decrease=0.0,
min_impurity_split=None,
#class_weight="balanced",
presort='deprecated',
ccp_alpha=0.0,
)
clf.fit(x_train, y_train)
The problem becomes apparent at the visualization step when I plotted the tree, each node shows me class = Failure when Failure is the minority and vice versa. Further down the line plotting the confusion matrix and calculating all the performance metrics it also becomes apparent, that the labels were reversed and I cannot figure out as to why.
Any ideas where I might need to look for the answer? If more code is necessary to give a feedback I can provide.
Much appreciated. It might be because of the conflict of order between model.classes_ and series.unique()
For a binary labels,
model.classes_ = array([0, 1])
series.unique() = array([1, 0])
Try creating a constant value i.e. np.array[0,1] for labels and see. | {
"domain": "datascience.stackexchange",
"id": 9478,
"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": "scikit-learn, decision-trees, cart",
"url": null
} |
Now multiply your original equation by z, getting $z\bar{z}=z^3$. Do you know an identity relating $z\bar{z}$ and |z|? This should lead you to consider cube roots of unity, which have a nice geometric interpretation. You might get some extraneous solutions here though (possibly, too tired to trust myself now lol).
Thanks to you, I just realized that I had missed a solution: $z=-\frac{1}{2}-i\frac{\sqrt{3}}{2}$
• August 28th 2011, 09:48 AM
terrorsquid
Re: Find solutions of z bar = z^2
I know that $\bar{z}z$ gives you $|z|^2$ right? the positive real part.
• August 28th 2011, 09:50 AM
alexmahone
Re: Find solutions of z bar = z^2
Quote:
Originally Posted by terrorsquid
I know that $\bar{z}z$ gives you $|z|^2$ right? the positive real part.
Yes. And $|z|=1$, so $z^3=1$.
• August 28th 2011, 09:58 AM
terrorsquid
Re: Find solutions of z bar = z^2
So applying this geometrically I would have a solution set of $cos(0+\frac{2\pi k}{3})$ where $k = 0, 1, 2$
Which is the same as the $z = 1$, $z=-\frac{1}{2}+i\frac{\sqrt{3}}{2}$ and $z=-\frac{1}{2}-i\frac{\sqrt{3}}{2}$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075777163567,
"lm_q1q2_score": 0.8058805139694544,
"lm_q2_score": 0.8376199633332891,
"openwebmath_perplexity": 1076.5609383163358,
"openwebmath_score": 0.9112849235534668,
"tags": null,
"url": "http://mathhelpforum.com/pre-calculus/186860-find-solutions-z-bar-z-2-a-print.html"
} |
c++, reinventing-the-wheel, memory-management, c++20
You said your focus was on the copy and move operations. Well, they’re all wrong, but I can’t even tell you how to fix them properly, because I can’t make sense of what you’re trying to do. But you basically have two options: | {
"domain": "codereview.stackexchange",
"id": 41951,
"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, memory-management, c++20",
"url": null
} |
c#, performance, php
}
C#: Sample usage to download and decrypt PHP output
string key = @"C:\path\to\private.txt";
using(WebClient wc = new WebClient()) {
// download encrypted string from php script
string encrypted = wc.DownloadString( "http://127.0.0.1/encrypt.php" );
// start stopwatch
var watch = System.Diagnostics.Stopwatch.StartNew();
string decrypted = crypt.decrypt( encrypted, key );
Console.WriteLine( "Elapsed: " + watch.Elapsed.TotalSeconds.ToString() );
Console.WriteLine(
decrypted
);
} Replace all this junk:
byte[] encryptedBytes = Enumerable.Range( 0, encrypted.Length -1 )
.Where( x => x % 2 == 0 )
.Select( x => Convert.ToByte( encrypted.Substring( x, 2 ), 16 ) )
.ToArray();
byte[] buffer = new byte[( rsa.KeySize / 8 )]; // the number of bytes to decrypt at a time
int bytesRead = 0;
using ( Stream stream = new MemoryStream( encryptedBytes ) ) {
while ( (bytesRead = stream.Read( buffer, 0, buffer.Length )) > 0 ) {
decrypted = decrypted + Encoding.UTF8.GetString( rsa.Decrypt( buffer, false ) );
}
} | {
"domain": "codereview.stackexchange",
"id": 23650,
"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, php",
"url": null
} |
general-relativity, forces, gravity, earth, atmospheric-science
Title: How does Earth hold its atmosphere? According to Einstein's theory of relativity, gravity is not pulling us down but space is pushing us down. This mean there is no gravity and its an illusion. So, in this scenario how does Earth hold its atmosphere? Since there is no force to pull it down.
This mean there is no gravity and its an illusion
This is a very common statement in popular science accounts of general relativity, and while it's true it's also misleading.
If you release an object above the Earth then that object will immediately start accelerating towards the Earth. Isaac Newton would say this is because there is a force pushing the object towards the Earth and that's what we mean by the gravitational force. Albert Einstein would say there is no force pushing the object towards the Earth and the object accelerates towards the Earth due to the curvature of spacetime. It is in this sense that we say gravity isn't really a force.
But in both cases the object accelerates towards the Earth, and if the object is an air molecule then that air molecule accelerates towards the Earth. So the Earth's atmosphere stays with the Earth because the air molecules that make up the atmosphere are all individually accelerating towards the Earth just like any other object does. The fact the atmosphere is bound to the Earth is no more surprising than the fact you and I are also bound to the Earth.
I suppose the surprising thing is why the atmosphere doesn't all fall immediately to the Earth's surface to form a thin dense layer of air molecules. The reason this doesn't happen is that air molecules are all whizzing around at surprisingly high speeds - typically hundreds of metres per second depending on the temperature. The air molecules bash into each other and knock each other around, and the air molecules near the ground bash into the air molecules above them and stop them falling down. | {
"domain": "physics.stackexchange",
"id": 42117,
"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, forces, gravity, earth, atmospheric-science",
"url": null
} |
c#, sql
Title: Efficient way to build table within database or update it using C# I have a headless application that does either of two things.
If table does not exist within database create it and copy all the data over
OR
If table exists update it
Now I usually use access layers but this application is a bit older so I can't. This is what I've written.
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System;
using System.Text.RegularExpressions;
using System.Reflection;
namespace FPS_ClientTable_Mirroring
{
class DoWorkController
{
private ApplicationSettings applicationSettings;
internal int Start(ApplicationSettings applicationSettings)
{
string sourceCS = applicationSettings.MSWConnectionString;
string destinationCS = applicationSettings.ClientTableConnectionString;
int doesDbExist = 0;
try
{
this.applicationSettings = applicationSettings;
DateTime yesterday = applicationSettings.ProcessingDate.AddDays(-1);
applicationSettings.Logger.Info("Checking for EODTable within ClientTable");
SqlConnection connectionClientTable = new SqlConnection(destinationCS);
SqlCommand cmd = new SqlCommand("SELECT CASE WHEN OBJECT_ID('dbo.EODTable', 'U') IS NOT NULL THEN 1 ELSE 0 END", connectionClientTable);
connectionClientTable.Open();
doesDbExist = Convert.ToInt32(cmd.ExecuteScalar());
if (doesDbExist == 1)
{
applicationSettings.Logger.Info("Found EODTable within ClientTable");
applicationSettings.Logger.Info("Updating EODTable within ClientTable");
connectionClientTable.Close(); | {
"domain": "codereview.stackexchange",
"id": 41897,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, sql",
"url": null
} |
group-representations, higgs, symmetry-breaking, electroweak, chirality
This statement implies existense of extra physical states which have same values of spin, strangeness and the baryon number as experimentally observed ones, but with opposite parity. Since we don't see these states, but below energy scale $E\sim \Lambda_{QCD} \sim 0.1 \text{ GeV}$ we see approximately massless meson states, we have to require that aproximate $SU_{L}(3)\times SU_{R}(3)$ symmetry is spontaneously broken in QCD by itself down to $SU_{\text{diag}}(3)$ at scales $\sim \Lambda_{QCD}$. It is broken by quark bilinear form VEV, namely $\langle |\bar{u}u|\rangle \sim \Lambda_{QCD}^3$. In the result, we have pseudogoldstone bosons octet - $\pi^{0, \pm}, \eta^{0} , K^{0}, \bar{K}^{0, \pm}$.
Suppose now we neglect the $s-$quark contribution into such picture. Then we deal with SSB $SU_{L}(2)\times SU_{R}(2)$ down to $SU_{\text{diag}}(2)$. $SU_{\text{diag}}(2)$ in this case is the group of isospin transformation. It is not exact, however since masses of $u-,d-$quarks are not the same: for example, this drives the pure QCD reaction
$$
d + d \to He^{4} + \pi^{0}
$$
which doesn't conserve the isospin.
Questions 2 and 3
QCD chiral symmetry in principle has nothing common to electroweak symmetry. First of all, QCD chiral symmetry group is global symmetry of quark triplets transformation, left and right, while electroweak symmetry group is combined local $SU(2)$ transformation of left quark weak doublets and their local $U_{Y}(1)$ trasformation:
$$ | {
"domain": "physics.stackexchange",
"id": 28257,
"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": "group-representations, higgs, symmetry-breaking, electroweak, chirality",
"url": null
} |
Mean Median Mode Order Minimum Maximum Probability Mid-Range Range. For this, we need the inverse trig functions, which undo the direction of the original trig functions. Then is the horizontal coordinate of the arc endpoint. Free trigonometric equation calculator - solve trigonometric equations step-by-step. The function h(x) is an example of a rational polynomial function. There are related clues (shown below). The cosine function returns the wrong answer for the cosine of 90 degrees. What is the general equation of a cosine function with an amplitude of 3, a period of 4pi, and a horizontal shift of -pi? y=3cos(0. Versine and haversine were used the most often. Allowed data types: float. For example, For example, (11). Possible Answers: It's measured in radians. The trigonometeric functions, the sine function (sin) and cosine function (cos) are obtained for a = -1. If you assign each amplitude (the frequency domain) to the proper sine or cosine wave (the basis functions), the result is a set of scaled sine and cosine waves that can be added to form the time domain signal. Compare the graph of the cosine function with the graph of the angle on the unit circle. The result will be between -1 and 1. 01:pi; plot(x,cos(x)), grid on The expression cos(pi/2) is not exactly zero but a value the size of the floating-point accuracy, eps, because pi is only a floating-point approximation to the exact value of. The Exponential Function and the Trig Functions. Unit Circle is a circle with a radius of one. Inverse trigonometric functions map real numbers back to angles. Graph of Trig. For example, can appear automatically from Bessel, Mathieu, Jacobi, hypergeometric, and Meijer functions for appropriate values of their parameters. CHARACTERISTICS OF SINE AND COSINE FUNCTIONS. The first step will be to replace the tangent function with sine and cosine using the first quotient formula. When the cosine of y is equal to x:. Active 2 years ago. What is the amplitude of f(x) = 4 sin(x) cos(x)? | {
"domain": "tuningfly.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.988491850596674,
"lm_q1q2_score": 0.8673786582643681,
"lm_q2_score": 0.8774767922879693,
"openwebmath_perplexity": 521.5547638858176,
"openwebmath_score": 0.8494910001754761,
"tags": null,
"url": "http://tuningfly.it/ikjw/cosine-function.html"
} |
rotational-dynamics
Title: Will the rotational axis of a cylindrical space habitat precess? I am curious if you have a rotating cylinder in space -- let's say it's a space habitat a la Arthur C. Clarke's Rama novels. As far as I am aware once the rotation starts (we are assuming it rotates along the longer, central axis of the cylinder) it should keep on going. So far so good.
But there are tiny forces acting on it as well, especially if it is in a solar system with larger objects around it giving really tiny gravitational nudges. So I was curious if that rotation might change -- if eventually the axis of rotation would move, creating a "wobble" and ending up with a cylinder rotating on an axis 90 degrees offset from its original rotational motion, so it ends up rotating end over end. I was reading some answers on another stackexchange and someone mentioned this as an issue with a cylindrical space hab, so I was curious if it was the case or if it is one of those things that is on a relatively longish time scale so that it doesn't affect anything as a practical matter.
Planets do wobble, of course, and their axes precess, so I was thinking the same should apply to a cylindrical space habitat. On the other hand it takes 26,000 years or so for the Earth's precession to complete a full cycle, so for a space habitat it might not matter. There's a lot to untangle here.
Gyroscopic precession of a spinning body arises when an external force is acting on that spinning body in such a way that the spinning body experiences a torque. I will get back to gyroscopic precession later, first I will discuss another form of change of state of rotation. | {
"domain": "physics.stackexchange",
"id": 79761,
"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": "rotational-dynamics",
"url": null
} |
quantum-field-theory, condensed-matter, propagator, dispersion, phonons
The $\lambda$ , $\mu$ are the Lame coefficients of the elastic isotropic medium which has density $\rho$.
The $H$ Hamiltonian can be written as $$H=\int d^3 x \left( \frac{1} 2 (\partial_t {\vec{\varphi}})^2 + \frac{1} 2 (c_p^2 (\nabla . {\vec \varphi})^2 + c_T^2 (\nabla \times {\vec \varphi})^2) \right)$$ with a corresponding Lagrangian density $$\mathscr L = \frac{1} 2 (\partial_t {\vec \varphi})^2 - \frac{1} 2 (c_p^2 (\nabla . \vec{\varphi})^2 + c_T^2 (\nabla \times \vec{\varphi})^2) $$ the phonon field being $$ \vec {\varphi}(t , x) = \int \frac{d^3\vec q}{(2\pi)^3} \sum_s \left( \frac{V}{2\omega_2(\vec q)} \right)^{\frac{1} 2} \mathbf e_s(\vec q)(b_{\vec q} e^{-i \omega_s(q) t + i \vec q \vec x} + b^{\dagger}_{\vec q} e^{i \omega_s(q) t - i \vec q \vec x} ) $$ where $\mathbf e_s$ , $s = 1,2,3$ are the polarization versors and $V$ is the volume. | {
"domain": "physics.stackexchange",
"id": 99758,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, condensed-matter, propagator, dispersion, phonons",
"url": null
} |
c++, programming-challenge, reinventing-the-wheel, homework
The slow square root is a problem of its own (how big of a problem depends on the size of the strings), but a very bad effect happens if table_size is a power of four (which it is half the time): point would be a power of two. So the multiplication (modulo a power of two) just shifts bits out of the top and loses them, deleting bits in a first-in-first-out fashion: the final hash is only affected by the last couple of characters, the bits from the first characters get shifted out. The effect gets worse as the table gets bigger, eventually only the very last character would be part of the hash.
The overall effect on your program is that as the table gets bigger, performance fluctuates between OK (probably) for odd power sizes and Increasingly Bad for even power sizes, getting worse and worse for bigger tables and long strings that share a suffix.
This wouldn't have been an issue for prime size tables, but that comes with a significant downside of its own.
What to use instead: std::hash<std::string> probably, or write a hash that does not suffer from this problem, there are many string hashing algorithms that don't have this issue.
Also b should really be some unsigned type, both to avoid the scary UB nature of signed integer overflow and also the more practical concern of avoiding a negative value as result (as a reminder, % on signed types returns the signed remainder, the result can be negative depending on the inputs). Which leads to:
The Types
A lot of variables and return types here are of type int. Many of them should be something else, such as size_t. Using int results in many unexpected type conversions, for example in index %= this->table.size(); which actually converts index to size_t first, then does the remainder, then converts back to an int again. Having a signed index risks overflowing it if the step gets big, and often costs an explicit sign-extension operation.
The first index, which comes from GetHash, could be negative, which would be bad (indexing the vector at a negative index).
The Quadratic step
You wrote:
new_index += pow(step, 2); | {
"domain": "codereview.stackexchange",
"id": 36726,
"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++, programming-challenge, reinventing-the-wheel, homework",
"url": null
} |
particle-physics, neutrons, dipole, dipole-moment
Why do we have reason to believe a meaningful neutron EDM exists?
The $\CP$ transformation is a mathematical procedure which transforms our model of a matter particle into our model of its antimatter partner. When we say "this theory is symmetric under $\CP$," we mean, explicitly or implicitly, that the theory predicts matter and antimatter will evolve the same way under the same conditions. We therefore have experimental evidence that our actual universe is not symmetric under $\CP$: our universe is full of matter baryons, but antimatter baryons occur only rarely and briefly.
And in the spirit of Gell-Mann's totalitarian principle, if there is $\CP$ violation anywhere in the universe, then there is $\CP$ violation in the neutron. It leaks in by the same mechanism as do corrections to the magnetic dipole moment, a mechanism which was already mentioned above in the context of "vacuum polarization." If we have the same vacuum today that we had during baryogenesis, then whatever $\CP$ violation gave us a matter-filled universe is still happening deep down in the belly of a neutron interacting with an electric field.
And if we can detect that $\CP$ violation in the neutron, it will tell us something about the baryogenesis epoch.
(Here are
some
related
answers
I've written about using the same trick to study the $P$-violating weak interaction.)
We have already discovered some violation of $\CP$ symmetry in the Standard Model. That known $\CP$ violation corresponds to a Standard Model prediction for the neutron's EDM of $d_\text{n}^\text{SM} \sim 10^{-17}\efm$, which is four orders of magnitude below the current limit. However, the current Standard Model also underpredicts the $\CP$-violating baryon asymmetry of the universe, and by a comparable factor. This makes the current generation of nEDM experiments very interesting, whether they finally see a nonzero effect or whether they continue to set more-stringent upper limits.
How is it possible for such a thing to exist? | {
"domain": "physics.stackexchange",
"id": 76648,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, neutrons, dipole, dipole-moment",
"url": null
} |
homework-and-exercises, electrostatics, charge, potential
We know that the charge induced on the sphere resides in its surface, because it is a conductor. Also, the electric field inside the sphere is null. Try then to apply boundary conditions for $\vec{E}$ on the surface, i.e.,
$$\sigma=\varepsilon_0\hat{r}\cdot\left.\left[\vec{E}_{\rm outside}-\vec{E}_{\rm inside}\right]\right|_{r=R}\tag{1}$$
Convince yourself that the problem then reduces to find the potential outside the sphere and derivate it with respect to $r$.
To find the potential outside, the safest way to go is to use the method of images, which relies on uniqueness theorems. The idea is to put mirror charges strategically, outside the region where we want the solution (we want the potential for $r>R$, so we need to put charges in $r<R$), so as to satisfy the boundary condition $V(r=R)=0$.
Suppose that the conducting sphere isn't there, consider only the point charge. Ask yourself, where should I place an image charge $q'$ and what value should it have so that the total potential of both charges
$$V(\vec{r})=\frac{1}{4\pi\varepsilon_0}\left[\frac{q}{|\vec{r}-\vec{r}_q|}+\frac{q'}{|\vec{r}-\vec{r}_{q'}|}\right]\tag{2}$$
vanishes at $r=R$. I can tell you that it will be on the line that goes from the center of the sphere to the charge $q$. Try to find $q'$ as a function of the distances you know and the charge $q$. | {
"domain": "physics.stackexchange",
"id": 70130,
"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, electrostatics, charge, potential",
"url": null
} |
metric-tensor, conventions, spinors, wick-rotation, amplituhedron
There is bijective isometry from the split-signature space $(\mathbb{R}^{2,2},||⋅||^2)$ to the space of $2\times 2$ real matrices $({\rm Mat}_{2\times 2}(\mathbb{R}),\det(⋅))$,
where
$$\begin{align} ||p||^2~=~&(p^0)^2-(p^1)^2+(p^2)^2-(p^3)^2~=~\det(P), \cr
p~=~&(p^0,p^1,p^2,p^3)~\in~\mathbb{R}^{2,2},\cr
P~=~&\sum_{\mu=0}^3p^{\mu}\sigma_{\mu}~\in~
{\rm span}_{\mathbb{R}}\{ \sigma_0,\sigma_1,i\sigma_2,\sigma_3\} ~=~{\rm Mat}_{2\times 2}(\mathbb{R}).\end{align}$$
There is a bilinear map
$$ \mathbb{R}^2\times \mathbb{R}^2~\ni~(\lambda,\tilde{\lambda})\quad\mapsto\quad P~:=~\lambda\tilde{\lambda}^T~\in~ {\rm Mat}_{2\times 2} (\mathbb{R}),$$
from 2 Weyl spinors $\lambda,\tilde{\lambda}$ to a rank-1 operator $P$, which necessarily has vanishing determinant, i.e. the corresponding momentum is light-like/null. | {
"domain": "physics.stackexchange",
"id": 81213,
"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": "metric-tensor, conventions, spinors, wick-rotation, amplituhedron",
"url": null
} |
# Statistics of 7 game playoff series
Background: a friend of mine makes a hobby (as I imagine many do) of trying to predict hockey playoff outcomes. He tries to guess the winning team in each matchup, and the number of games needed to win (for anyone unfamiliar with NHL hockey a series is decided by a best of 7). His record this year after 3 rounds of play (8+4+2=14 best of 7 matchups) is 7 correct/7 incorrect for winning team and 4 correct/10 incorrect for number of games (he only considers the number of games correct if he also picked the winning team).
We got to joking that he's doing no better than blind guessing on the teams question, but that he's substantially beating the odds if one assumes that the probabilities for a 4, 5, 6 or 7 game series are equal (would expect a 12.5% success rate, he's at 28.5%).
This got us wondering what the odds actually are for each possible number of games. I think I've worked it out, but I want to tie up a few loose ends since part of my approach was brute-force scribbling on a big piece of paper. My basic assumption is that the outcome of every game is random with probability $\frac{1}{2}$ for a each team to win.
My conclusion is that:
$$\rm P(4\;games) = \frac{2}{2^4} = 12.5\%\\ P(5\;games) = \frac{8}{2^5} = 25\%\\ P(6\;games) = \frac{20}{2^6} = 31.25\%\\ P(7\;games) = \frac{40}{2^7} = 31.25\%$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9697854181721518,
"lm_q1q2_score": 0.8442925262348877,
"lm_q2_score": 0.8705972583359805,
"openwebmath_perplexity": 662.4149336414775,
"openwebmath_score": 0.44379115104675293,
"tags": null,
"url": "https://stats.stackexchange.com/questions/101063/statistics-of-7-game-playoff-series"
} |
everyday-life, aerodynamics, drag, turbulence
Title: Benefits of rear spoiler in cars What would be the benefits of rear spoilers in cars, like this one: From Wikipedia:
A spoiler is an automotive aerodynamic device whose intended design function is to 'spoil' unfavorable air movement across a body of a vehicle in motion, usually described as turbulence or drag.
A rear spoiler is designed to change the flow of air over the rear of the vehicle. This change in air flow increases downforce on the rear of the vehicle to help improve traction in an effort to prevent sliding while cornering.
Benefit 1: Maintain Traction
Benefit 2: Increase Fuel Efficiency
Benefit 3: Create a Stylish Look
Benefit 4: Increase Braking Stability | {
"domain": "physics.stackexchange",
"id": 17064,
"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": "everyday-life, aerodynamics, drag, turbulence",
"url": null
} |
electromagnetic-radiation, visible-light, photons
The evidence for the photon model is, ultimately, in the way it is knitted deeply into the whole theoretical framework of modern physics. It is the only way to understand the full range of electromagnetic phenomena, whether stars shining or electrons changing state in atoms, or light detectors, or photosynthesis, or thousands of other observations. It is this wealth of information that makes us confident that the photon description is the right one.
In my lab we use single-photon-sensitive detectors all the time. We have got used to saying, when the detector emits $N$ electrical pulses, "we have detected $N$ photons". This answers your question "have we ever observed photons physically". We can also detect the shape of the light field using cameras; this amounts to observing what the photons "look like", though to get a complete picture you have to accumulate many images of a light field which stays constant over time, so really you are looking at many photons arriving one after another, but all with the same spatial distribution. The distribution gives the probability distribution of where in space the detector (such as a camera) will register some energy. | {
"domain": "physics.stackexchange",
"id": 82834,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetic-radiation, visible-light, photons",
"url": null
} |
classical-mechanics, coordinate-systems, hamiltonian-formalism, phase-space, canonical-conjugation
function of $\left(q_1\right)=$ function of $\left(q_2, q_3 \ldots \ldots . . q_f\right)$ not involving $q_1$. This would again be a constant. The process of separation of the variables will thus go on at each stage throwing out a constant, so that finally the solution will be of the form:
$$
\begin{aligned}
F & =F\left(q_i, Q_i, t\right) \\
& =F\left(q_i, \alpha_i, t\right)
\end{aligned}
$$
where $\alpha_i$ 's are the '$f$' constants in the process of separation of variables, one of which is just $E$. Again we know that with (1) satisfied the $Q_i$ 's will all be constants, so we make the identitification:
$$
Q_i \equiv \alpha_i
$$
In this above derivation, I didn't understand (in chronological order) | {
"domain": "physics.stackexchange",
"id": 92889,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, coordinate-systems, hamiltonian-formalism, phase-space, canonical-conjugation",
"url": null
} |
human-biology, toxicology
Title: Is nicotine toxic to humans? More specifically, is nicotine in the concentrations that smokers receive when smoking cigarettes toxic? I know that in great enough concentrations it can be toxic (but then, so can just about anything else, including oxygen) and I know that in plants it is used as a defense against insects and can even be used as an insecticide. However, it has always been my understanding that nicotine is irrelevant as far as the harmful effects of smoking go.
I recently had a conversation with another biologist who had just quit smoking and had done quite a bit of research on the subject. He said that nicotine itself is in fact bad for you and, therefore, that tobacco-less alternatives to cigarettes (such as electronic cigarettes) are still harmful because of the nicotine alone.
Does anyone have any more information on this? Perhaps some references? Or, even better, a detailed explanation of the pathways involved? Again, I stress, not about nicotine's toxicity in general but about its harmful effects on vertebrates (preferably human) at the kinds of concentrations one could expect to ingest when smoking. I think its useful to say that nicotine is not very toxic to humans - cells don't die or get sick for typical smoking habits. Secondary health effects are possible, but here is a toxicological profiles.
Nicotine is a toxin in large enough quantities and nicotine has an LD50 (lethal dose for 50% of individuals) of 0.5-1 mg Nicotine / kg of body weight. So even a small spill on your skin of the chemical can be life threatening, but for smokers the nicotine itself is not dangerous.
Individuals who smoke intake about 1 mg per cigarette smoked. So a small adult (110 lbs) can smoke 25 cigarettes in a short period of time (or all at once!) and just barely get to the bottom end of that limit. Nicotine is water soluble and clears out through the urine at a fast rate though - half of the nicotine from a cigarette is cleared from your system within 2 hours, which means that 4-5 pack a day smokers are not really killing themselves (from nicotine).
That being said, children are about 5-10 times more sensitive than adults, so even 5-6 cigarettes in an hour can be toxic. That's quite a bit of smoking though. | {
"domain": "biology.stackexchange",
"id": 7965,
"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, toxicology",
"url": null
} |
data-structures, trees, sets
Title: Suggest a Data Structure To Manage 2 Sets I was given the following problem which really baffled me, and I would like some guidance in solving it.
I want to make a data-structure which represents two sets $A,B\subseteq \mathbb{R}$, so that I can Insert an element to a set of my choosing in $O(\log n)$ (where $n$ is the number of elements existing in both sets).
However, it is also required to be able to find in $O(1)$ some $x \in A\cup B$ such that the amount of elements in $A$ lesser than $x$, equates to the number of elements in $B$ greater than $x$, if exists:
$$\left | \left \{ y\in A: y<x \right \} \right | = \left | \left \{ y\in B: y>x \right \} \right |$$
Now the obvious direction is to use balanced trees (say AVL). I can use the same tree for both sets or separate to 2 different trees. I also presume I should store more data in the nodes, However I'm not sure which. I thought about storing the number of elements smaller and greater but that would make the Insert method $O(n)$, since I have to update many nodes in the respective tree. You are on the right approach to attach "more data" to a balanced search tree.
For all $x\in A\cup B$, let $$d(x)=\left | \left \{ y\in A: y<x \right \} \right | - \left | \left \{ y\in B: y>x \right \} \right |,$$ which is an increasing function on $x$.
For simplicity, let us assume all elements are distinct first. We can use a balanced search tree $T$ to store all elements in $A$ and $B$, keeping track of whether each element comes from $A$ or $B$. | {
"domain": "cs.stackexchange",
"id": 13945,
"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-structures, trees, sets",
"url": null
} |
nuclear-physics, radiation
I did my research, but couldn't understand the reason for this behaviour. Can anyone explain this anisotropy in simple terms? It is even better if you can also provide other anisotropic events as examples. Maybe you can also suggest some lecture notes for a quick introduction to the topic. Thanks. Nuclear scattering and excitations can be messy to understand, but the existence of anisotropy in these nuclear reactions is no more mysterious than the anisotropy in a clean particle physics process such as $e^+ e^- \rightarrow J/\psi \rightarrow \mu^+ \mu^-$, where the anisotropic angular distribution of the muons is$$\frac{d\sigma}{d\cos\theta}\propto 1+\cos^2\theta$$
The "orientation" of any intermediate state and hence the angular distribution of any final-state particles is not random but is instead constrained by angular-momentum conservation.
As @Jon_Custer notes in a comment, the initial state in any scattering process is not isotropic – the incident beam defines an axis. There is no requirement that the final state be isotropic relative to that axis, and the angular distribution relative to that axis depends on how much different angular-momentum states contribute.
For example, Feynman III 18–5 "Measuring a nuclear spin" discusses how the angular distributions in $^{12}\mathrm{C}+^{12}\!\mathrm{C}\rightarrow ^{16}\!\mathrm{O} + \alpha_1 + \alpha_2$ can be use to determine the spin of intermediate $^{20}\mathrm{Ne}^∗$ excited states.
More generally in both nuclear and particle physics, partial wave analysis uses the angular distribution to determine the spin-parity of any resonant intermediate states, such as nuclear, mesonic, or baryonic excitations. | {
"domain": "physics.stackexchange",
"id": 93679,
"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": "nuclear-physics, radiation",
"url": null
} |
melting-point, decomposition
Salts with stronger acid and base components are more difficult to decompose, because more energy is required to reverse the acid-base combination. Magnesium sulfate has a higher decomposition temperature than zinc sulfate because magnesium oxide is a stronger base than zinc oxide. Similarly, magnesium sulfate requires a much higher temperature to decompose than magnesium carbonate; the latter decomposition requires evolving weakly acidic $\ce{CO2}$ whereas the former would have to evolve strongly acidic $\ce{SO3}$ or couple the acid-base separation with the thermal decomposition of $\ce{SO3}$ to $\ce{SO2 + (1/2) O2}$. Sometimes redox reactions can facilitate decomposition if they convert stronger acids and bases to weaker ones, such as ammonium nitrate being decomposed to water and nitrous oxide rather than ammonia and nitric acid. | {
"domain": "chemistry.stackexchange",
"id": 13434,
"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": "melting-point, decomposition",
"url": null
} |
np-complete, np-hard, np, decision-problem, hamiltonian-circuit
Title: Verifying Hamiltonian Cycle solution in O(n^2), n is the length of the encoding of G In the textbook of CLRS, 'ch. 34.2 Polynomial-time verification' it says the following:
Suppose that a friend tells you that a given
graph G is hamiltonian, and then offers to prove it by giving you the vertices in order along the hamiltonian cycle. It would certainly be easy enough to verify the proof: simply verify that the provided cycle is hamiltonian by checking whether it is a permutation of the vertices of $V$ and whether each of the consecutive edges along the cycle actually exists in the graph. You could certainly implement this verification algorithm to run in $O(n^2)$ time, where $n$ is the length of the encoding
of $G$. | {
"domain": "cs.stackexchange",
"id": 14340,
"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": "np-complete, np-hard, np, decision-problem, hamiltonian-circuit",
"url": null
} |
navigation
laser_scan_sensor: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: -0.05, max_obstacle_height: 2.0}
sonar_scan_1: {data_type: LaserScan, topic: sonar_scan_1, marking: true, clearing: true, min_obstacle_height: -1.0 , max_obstacle_height: 2.0}
sonar_scan_2: {data_type: LaserScan, topic: sonar_scan_2, marking: true, clearing: true, min_obstacle_height: -1.0, max_obstacle_height: 2.0}
sonar_scan_3: {data_type: LaserScan, topic: sonar_scan_3, marking: true, clearing: true, min_obstacle_height: -1.0 , max_obstacle_height: 2.0}
sonar_scan_4: {data_type: LaserScan, topic: sonar_scan_4, marking: true, clearing: true, min_obstacle_height: -1.0, max_obstacle_height: 2.0}
global_costmap_params.yaml
global_costmap:
global_frame: /map
robot_base_frame: /base_link
update_frequency: 5.0
publish_frequency: 1.0
static_map: true
rolling_window: false
resolution: 0.05
map_type: costmap
transform_tolerance: 0.5
local_costmap_params.yaml
local_costmap:
global_frame: /map
robot_base_frame: /base_link
update_frequency: 5.0
publish_frequency: 1.0
static_map: false
rolling_window: true
width: 3.0
height: 3.0
resolution: 0.01
transform_tolerance: 0.5
map_type: costmap
move_base.launch
<launch>
<env name="ROSCONSOLE_CONFIG_FILE"
value="$(find security_robot_2dnav)/rosconsole.conf"/>
<master auto="start"/> | {
"domain": "robotics.stackexchange",
"id": 20104,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation",
"url": null
} |
• In 1, you're using a wrong definition of linear independence. Mar 11 '18 at 19:48
• Do you mean the following one: $0 =\sum_i r_i z_i$ iff $r_i =0$ for all $i$? I suppose that your point is that here all $r_i$ in the sum could be not invertible. Or another one? Mar 11 '18 at 20:10
• Yes, that's exactly the issue. Mar 11 '18 at 20:12
• I modified my argument. Thank you for the advice. Mar 11 '18 at 20:20 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9637799410139921,
"lm_q1q2_score": 0.8031415293153307,
"lm_q2_score": 0.8333245953120233,
"openwebmath_perplexity": 99.64771891464088,
"openwebmath_score": 0.9789889454841614,
"tags": null,
"url": "https://math.stackexchange.com/questions/2686590/question-about-basis-of-free-modules/2686713#2686713"
} |
php, rest, curl, phpunit
$this->assertEquals($this->curlGetInfoMockResponse['request_header'], $this->client->getRequestHeader());
$this->assertEquals($this->curlGetInfoMockResponse['http_code'], $this->client->getResponseCode());
$this->assertEquals($this->curlExecMockResponse, $this->client->getResponseBody());
$this->assertAttributeEquals(null, 'curl', $this->client);
$this->assertEquals(null, $this->client->getRequestData());
} | {
"domain": "codereview.stackexchange",
"id": 24574,
"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, rest, curl, phpunit",
"url": null
} |
## Friday, April 24, 2015
### Mathematics Problems in an Age of Accountability and High Stakes Testing.
In an effort to improve education, we have entered an era of accountability via high stakes testing. What does this mean to mathematics education, and what impact does this accountability have on learning?
Both as a private math instructor, and a math learning center instructor, I work with students of all levels and ages. One observation I have made is that the math homework assigned to most of my public school students consists almost entirely of standardized tests worksheets. My students really know how to take a test. They know a great number of 'tricks', even some that don't require them to understand, or even read the question completely! Apparently, they spend a large percentage of class time every day learning test taking 'techniques' and working problems almost strictly from these practice worksheets--time that, I believe, can be better spent actually learning the material.
When I first begin working with some of these students, and I assign them some straight forward problem to work out, I usually get blank stares. Some even ask me, "What are the choices?" Of course I explain to them I would like them to try and solve the problem by themselves as much as they can. Frequently, thirty seconds later I get a remark saying, " I still don't get it," or "It's still too hard." At this point I ask the student to read the question to me, and surprisingly about 70% of the time they are able to solve the problem after just reading it, or actually writing some work down and trying after reading it. It turns out all they had to do was actually read the problem thoroughly, or actually attempt the problem by writing out and organizing their ideas.
What happens when the problems aren't so straightforward though? In my experience they seem to give up after about two minutes if they can't arrive at an answer. An observation I don't experience very often with their private school counterparts.
Conditioning our students to solve math problems this way cheats them from understanding what math really is, and how beautiful it can be. In order to solve more interesting problems in mathematics a student must be willing to invest the time and effort, as well as apply a bit of ingenuity and imagination. Sometimes patterns are straightforward, other times this is far from the case.
Take for example the following sequence: | {
"domain": "blogspot.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429129677614,
"lm_q1q2_score": 0.8121303754646826,
"lm_q2_score": 0.8244619242200082,
"openwebmath_perplexity": 1061.8735814451616,
"openwebmath_score": 0.42218711972236633,
"tags": null,
"url": "http://buildingblocks123.blogspot.com/"
} |
reference-request, denotational-semantics
[Kön32] D König. Theorie der endlichen und unendlichen Graphen.
Technical report, Leipzig, 1932.
[Plo76] GD Plotkin. A powerdomain construction. SIAM Journal on
Computation, 5(3):452-487, 1976.
Disclaimer: this is taken almost verbatim from a book I once co-authored:
WP de Roever and K Engelhardt. Data Refinement: Model-Oriented
Proof Methods and their Comparison. Cambridge University Press, 1998. | {
"domain": "cstheory.stackexchange",
"id": 970,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-request, denotational-semantics",
"url": null
} |
vba, excel, form
You'll want to store your three different statuses at the module level and create them at an appropriate time. Perhaps on the sheet activate event. Otherwise, you'll need to create them on the fly each time the procedure is run. I'm not sure which way I'd go, but the important part is abstracting the data right now.
Private high As TStatus
Private medium As TStatus
Private low As TStatus
Private Sub InitStatusVariables()
high.Name = "High"
high.Abbreviation = "H"
high.Color = RGB(217, 0, 0) 'Red
medium.Name = "Medium"
medium.Abbreviation = "M"
medium.Color = RGB(255, 204, 0) 'Orange
low.Name = "Low"
low.Abbreviation = "L"
low.Color = RGB(153, 204, 0) ' Green
End Sub
So now, we can go ahead and write that HandleCheckBoxClick method. We'll pass in the actual checkbox control along with our predefined true state and false state.
Private Sub HandleCheckBoxClick(cntrl As CheckBox, trueState As TStatus, falseState As TStatus)
If cntrl.Value = True Then
Range("i6", "m6").Value = trueState.Name
Range("r3").Value = trueState.Abbreviation
Range("i6", "m6").Interior.Color = trueState.Color
Range("r3").Interior.Color = trueState.Color
Else
cntrl.Value = False
Range("i6", "m6").Value = falseState.Name
Range("r3").Value = falseState
Range("i6", "m6").Interior.Color = falseState.Color
Range("r3").Interior.Color = falseState.Color
End If
End Sub
Awesome, but now the duplication inside of the method has become really obvious, but thankfully, easier to deal with. So let's refactor again.
Private Sub HandleCheckBoxClick(cntrl As CheckBox, trueState As TStatus, falseState As TStatus) | {
"domain": "codereview.stackexchange",
"id": 13093,
"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, form",
"url": null
} |
quantum-mechanics, atomic-physics, density-operator
Now, when I find the 0-space, what usually happens is that the solutions I get have complex diagonal elements, which means that my solution is not hermitian.
Of course, solutions of eigenvalue equations are just solutions up to a complex constant, but by that alone I am not able to cure the non-hermicity in this case.
Which makes me wonder: Should I even expect to get a solution that qualifies as a density matrix? (Self-Adjoint, and trace 1), by finding the kernel of the Liouvillian? I know that the Liouvillian is trace and hermiticity preserving, but does that also play a role in my calculation here, where I didn't pick a density-operator $\rho(0)$ for a start? I pondered a bit, and I think I have the answer to the question:
If $\rho$ is part of the Kernel, that is
\begin{align}
\mathcal{L}[\rho]= 0
\end{align}
Then
\begin{align}
\mathcal{L}[\rho]^{\dagger}=0 \\
=(\frac{i}{\hbar}[\rho, H])^{\dagger} - \sum_i \Gamma_i ( \sigma_i \rho \sigma_i^{\dagger} - \frac{1}{2} ( \rho \sigma_i^{\dagger} \sigma + \sigma_i^{\dagger} \sigma \rho))^{\dagger} \\
=(\frac{i}{\hbar}[\rho^{\dagger}, H]) - \sum_i \Gamma_i ( \sigma_i \rho^{\dagger} \sigma_i^{\dagger} - \frac{1}{2} (\sigma_i^{\dagger} \sigma \rho^{\dagger} + \rho^{\dagger} \sigma_i^{\dagger} \sigma)) \\
\end{align}
because $H$ is hermitean.
Then
\begin{align}
= \mathcal{L}[\rho^{\dagger}]= 0 | {
"domain": "physics.stackexchange",
"id": 94924,
"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, atomic-physics, density-operator",
"url": null
} |
Use interactive calculators to plot and graph functions. I could imagine myself, just as Strogatz, trying to see if a phase portrait of a reversible system resembles something in nature, such as a manta ray (as in one of the examples he worked out). The Jacobian matrix is A = 0 1 3x2. The phase space plot and such a family of trajectories together are a phase space portrait, phase portrait, or phase diagram. Stability Analysis for ODEs Marc R. c) Write the Matlab code to plot the phase portraits. Step 3: Using the eigenvectors draw the eigenlines. This is a practicing course for MATLAB taught by Ahmed Rezk and Ahmed Mahdy. The dimension of the phase space is the number of intial conditions required to uniquely specify a trajectory; it is the number of variables in the dynamical system. For mechanical systems, the phase space usually consists of all possible values of position and momentum variables. This is a topic that’s not always taught in a differential equations class but in case you’re in a course where it is taught we should cover it so that you are prepared for it. field, a phase portrait is a graphical tool to visualize how the solutions of a given system of differential equations would behave in the long run. For all figures in this article, the plot range of x and y from known densities is set to include 99% quantiles of the target density. Essentially, you only need to solve the differential equations and then plot the result. A (discrete) phase portrait of the system ~x(t+ 1) = A~x(t) shows discrete trajectories for vari-ous initial states, capturing all the qualitatively different scenarios (as in Figure 6). That makes the origin an attractor, and hence, all solutions will be drawn into the origin, making the system asymptotically stable. In this section, we will show you how to plot data, modify plots and save your work. It does so by examining symmetric matrices, the damped harmonic oscillator, and other normal matrices. Python classes. Using functional magnetic resonance imaging (fMRI), we studied the neural correlates of the complexity of rhythmic finger tapping. Although the literature on nonlinear methods is vast, most of it has been written for applications that do not | {
"domain": "bjoy.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9898303422461274,
"lm_q1q2_score": 0.8393442126858083,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 579.6006147953274,
"openwebmath_score": 0.6228296756744385,
"tags": null,
"url": "http://zpvb.bjoy.pw/phase-portrait-plotter-matrix.html"
} |
c++
return 0;
}
Matrix2x2.h
#pragma once
#include <iostream>
struct Matrix2x2
{double _00, _01, _10, _11;};
std::istream& operator>>(std::istream&, Matrix2x2&);
std::ostream& operator<<(std::ostream&, Matrix2x2&);
const Matrix2x2 operator*(const double&, const Matrix2x2&);
const Matrix2x2 operator+(const double&, const Matrix2x2&);
const Matrix2x2 operator+(const Matrix2x2&, const Matrix2x2&);
Matrix2x2& operator+=(Matrix2x2&, const Matrix2x2&);
Matrix2x2.cpp
#include "Matrix.h"
std::istream& operator>>(std::istream& is, Matrix2x2& m)
{
return is >> m._00 >> m._01 >> m._10 >> m._11;
}
std::ostream& operator<<(std::ostream& os, Matrix2x2& m)
{
return os << m._00 << ' ' << m._01 << std::endl
<< m._10 << ' ' << m._11 << std::endl;
}
const Matrix2x2 operator*(const double& c, const Matrix2x2& m)
{
Matrix2x2 res{c*m._00, c*m._01, c*m._10, c*m._11};
return res;
}
const Matrix2x2 operator+(const double& c, const Matrix2x2& m)
{
Matrix2x2 res{ c+m._00, c+m._01, c+m._10, c+m._11 };
return res;
} | {
"domain": "codereview.stackexchange",
"id": 28423,
"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
} |
not have to be congruent in order to be similar. ALL of this is based on a single concept: That the quality that we call "area" is an aspect of dimensional lengths and angles. Both the areas would be 9, but the figures would not be congruent. Illustration of SAS rule: Two right triangles can be considered to be congruent, if they satisfy one of the following theorems. Light1729 Light1729 If two triangles are congruent then they must overlap each other completely, so, they have exactly equal area. Furthermore, your question is about congruent triangles and not similar triangles.l. prove that they are congruent. Notice we are not forcing you to pick a particular side, because we know this works no matter where you start. Here, instead of picking two angles, we pick a side and its corresponding side on two triangles. , the radic of two circles are 8 cm and 6 cm representively find the radius of the circle having area equal to the sum of the areas of the two circles, bnRlinP) = 16 and n(Q).10, what are the greatest and the least values of n(PU QI?8. The congruence of two objects is often represented using the symbol "≅". Only if the two triangles are congruent will they have equal areas. Comparing one triangle with another for congruence, they use three postulates. Isosceles triangles are triangles with two equal sides, and thus two equal angle measures. In this case, two triangles are congruent if two sides and one included angle in a given triangle are equal to the corresponding two sides and one included angle in another triangle. SSSstands for "side, side, side" and means that we have two triangles with all three sides equal. Since two triangles are similar therefore the ratio of the area is equal to the square of the ratio of its corresponding side a r e a ∆ A B C a r e a ∆ D E F = B C E F 2 = A B D E 2 = A C D F 2 B C E F 2 = A B D E 2 = A C D F 2 = 1 N o w , t a k i n g a n y o n e c a s e 1 = B C E F 2 1 = B C E F E F = B C However they can share a side, and as long as they | {
"domain": "logivan.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97997655637136,
"lm_q1q2_score": 0.8739539207645473,
"lm_q2_score": 0.8918110490322426,
"openwebmath_perplexity": 458.793011994633,
"openwebmath_score": 0.6022189855575562,
"tags": null,
"url": "https://logivan.com/ixi3dmsm/if-two-triangles-are-equal-in-area%2C-they-are-congruent-bbe282"
} |
c, array, interpreter
int *elema(array a, int ind[]){
int idx = 0;
int i;
for (i=0; i<a->rank; i++){
idx += ind[i] * a->weight[i];
}
idx += a->cons;
return elemr(a,idx);
}
int *elemv(array a, va_list ap){
int idx = 0;
int i;
for (i=0; i<a->rank; i++){
int ind;
ind = va_arg(ap, int);
idx += ind * a->weight[i];
}
idx += a->cons;
return elemr(a,idx);
}
int *elem(array a, ...){
va_list ap;
int *z;
va_start(ap,a);
z = elemv(a,ap);
va_end(ap);
return z;
}
// elem(a,i,j) -> elem(a,j,i)
void transpose2(array a){
int t;
t = a->dims[0],
a->dims[0] = a->dims[1],
a->dims[1] = t;
t = a->weight[0],
a->weight[0] = a->weight[1],
a->weight[1] = t;
} | {
"domain": "codereview.stackexchange",
"id": 18856,
"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, array, interpreter",
"url": null
} |
java, android, recursion, exception-handling, error-handling
then remove the code duplication from the case branches.
switch (httpVerb) {
case HTTP_POST:
return executeRequest(httpPost, authHeader, header);
case HTTP_PUT:
return executeRequest(httpPut, authHeader, header);
case HTTP_GET:
return executeRequest(httpGet, authHeader, header);
default:
return null;
}
Anyway, it doesn't seem too good that you have httpPost, httpGet and httpPut at the same time.
Wouldn't it worth to check the result of isInternetConnected() at the beginning of the method? I'm not too familiar with Android development, maybe it's the best to put into the catch block. Anyway, if it is not a slow/costly service I would call at the beginning of the method too.
Calling String.valueOf(numberOfTries) seem unnecessary. I could be simply
Log.i(TAG, "executing for the " + numberOfTries + " time");
I'd use a loop instead of recursion. Two links on the topic:
Exceptions, and how best to retry when a connection is reset?
Retrying Operations in Java | {
"domain": "codereview.stackexchange",
"id": 1906,
"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, android, recursion, exception-handling, error-handling",
"url": null
} |
Now, what I think I see is that with the operation bin 1 gets added, and with S *two* elements are added to the set. I just don't know how to formulate this nicely.
• I'm not sure, but I think the induction tag does not fit the kind of induction you're doing here. It seems to be used only for mathematical induction and transfinite induction. – Git Gud Apr 7 '14 at 19:57
• @git-gud I'm not a native English speaker, I was actually looking for something along the lines of "inductive proof" but could not find it. I took induction instead since the proof is done with induction. – Garth Marenghi Apr 7 '14 at 20:28
• There are different kinds of induction. The one used in here one of them, and it is induction, just not the kind the tag is for, I think. – Git Gud Apr 7 '14 at 20:31 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534338604444,
"lm_q1q2_score": 0.8024112770969057,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 854.1823791482055,
"openwebmath_score": 0.8896610140800476,
"tags": null,
"url": "https://math.stackexchange.com/questions/743996/proof-by-induction-of-propositional-formulas"
} |
homework-and-exercises, kinematics, velocity, differential-equations
Title: Differential equation for velocity regarded as a function of distance Given a differential equation for velocity, $dv/dt + v = 1$, as well as its solution, is it possible to derive a differential equation for velocity with respect to distance?
I found a solution to the differential equation to be
$$v = 1 - 1/e^t$$
and since $dx/dt = v$, $x = t + 1/e^t - 1$.
From this point I have tried to use the chain rule
$$\frac{dv}{dt} = \frac{dv}{dx} \frac{dx}{dt}$$
and ended up getting $dv/dx = (1 - v)/(1 - 1/e^t)$. I am not sure how to get the differential equation in terms of velocity as a function of distance. $$\frac{dv}{dt}=\frac{dv}{dx}\frac{dx}{dt}=\frac{dv}{dx}v$$
So the differential equation with x as the independent variable becomes
$$v(v'+1)=1$$ | {
"domain": "physics.stackexchange",
"id": 25497,
"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, kinematics, velocity, differential-equations",
"url": null
} |
quantum-mechanics, wavefunction, quantum-states
Title: How is the wave function viewed as the quantum state? I am not sure how the wave function can be viewed as quantum state.
I begin with the eigen-equation
$$A|\psi\rangle = a|\psi\rangle$$
If $A$ is a $n$ dimensional matrix with different eigenvalues $a$, then there will be $n$ eigenvectors.
If I do orthonormalization to these eigenvectors, then there will be $n$ basis vectors.
If the $|\psi\rangle$ is vector in quantum state space, then this is the $n$ dimensional quantum state.
Next, more specific consideration. The Schrodinger equation,
$$H|\psi\rangle=E_n|\psi\rangle$$
with at the $n$ energy eigenvalue and $H$ is Hamiltonian (not in form of the matrix like above). Normally it is solved in the position state, that will be
$$H\Psi_n(x) = E_n\Psi_n(x)$$
where $\Psi_n(x) = \langle x|\psi\rangle$ is wave function of an $n$ energy eigenvalue.
In this form, the wave function is just a continuous coefficient of $|x\rangle$.
How does this $\Psi_n(x)$ become quantum state ?
Can I say that because there are $n$ wavefunctions on the same position space $|x\rangle$ then they form the Hilbert space and can be viewed as quantum state?
$$\int {\Psi_m}^*(x) \Psi_n(x) dx =<\Psi_m(x)|\Psi_n(x)>= \delta_{m,n}$$ The wavefunctions themselves are simply the coefficients in the expansion of the quantum mechanical state vector in the position basis, as you already said:
$$\Psi(x, \ t) \ = \ \langle x | \Psi \rangle$$ | {
"domain": "physics.stackexchange",
"id": 61201,
"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, wavefunction, quantum-states",
"url": null
} |
java, pig-latin
or using external library Guava
List<String> words = Splitter.on(" ").splitToList(userInput);
Avoid comments where you can.
In this case I can see you can easily avoid comment if you can wrap up the particular code snippet with the meaningful name. For instance You could take the user input and breaking it in a list in separate class and call the class from your main
List<String> words = new UserInputHandler().getInputAsList();
Try to use foreach loop over for loop:
You can easily use the foreach loop to iterate over words
for (String word : words) {
String pigLatinWord = translateWord(word); // Translates each word individually
output += pigLatinWord + " "; // Joins the translated word back into the output
}
Again as suggested before you can wrap the code inside for loop in a separate class so that you could call
for (String word : words) {
output = new PigLatinTranslator(word, output).translate();
} | {
"domain": "codereview.stackexchange",
"id": 36454,
"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, pig-latin",
"url": null
} |
Alternatively:
$\displaystyle S$ $\subseteq$ $\displaystyle T_2$ $\displaystyle \leadsto \ \$ $\displaystyle S$ $=$ $\displaystyle S \cap T_2$ Intersection with Subset is Subset $\displaystyle$ $\subseteq$ $\displaystyle T_1 \cap T_2$ Set Intersection Preserves Subsets
So:
$S \subseteq T_1 \land S \subseteq T_2 \implies S \subseteq T_1 \cap T_2$.
Now let $S \subseteq T_1 \cap T_2$.
From Intersection is Subset we have $T_1 \cap T_2 \subseteq T_1$ and $T_1 \cap T_2\subseteq T_2$.
From Subset Relation is Transitive, it follows directly that $S \subseteq T_1$ and $S \subseteq T_2$.
So $S \subseteq T_1 \cap T_2 \implies S \subseteq T_1 \land S \subseteq T_2$.
From the above, we have:
$S \subseteq T_1 \land S \subseteq T_2 \implies S \subseteq T_1 \cap T_2$
$S \subseteq T_1 \cap T_2 \implies S \subseteq T_1 \land S \subseteq T_2$
Thus $S \subseteq T_1 \land S \subseteq T_2 \iff S \subseteq T_1 \cap T_2$ from the definition of equivalence.
$\blacksquare$ | {
"domain": "proofwiki.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9918120905823452,
"lm_q1q2_score": 0.8410246789937467,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 233.37963033032875,
"openwebmath_score": 0.9932152032852173,
"tags": null,
"url": "https://proofwiki.org/wiki/Intersection_is_Largest_Subset"
} |
As we know that the altitudes of △ABC.\triangle ABC.△ABC 's a property of cyclic are. The quickest one has to do with arc measures and inscribed and on! The opposite angles that add to 180, and only if, it is.! Using arc measures and inscribed angles trademarks and copyrights are the sides equal, but many other quadrilaterals useful... College you want to attend yet parallel segments AB and DC ACT and SATs ∠BAH=∠CAO\angle BAH= \angle CAO∠BAH=∠CAO lesson must... Refresh your memory, an inscribed angle is an easy way to draw a circle what college you want attend... The word cyclic is from the above angle equalities both tangential quadrilaterals cyclic... Are chord-tangent quadrilateral and inscribed and circumscribed quadrilateral ABCD, angles a and C is the. Too Much Studying then prove that the sum of a quadrilateral has one pair of opposite sides x. Flavor and are solvable by elementary methods angle C = 180 ∠B ∠D... Have found a pair of opposite angles of a cyclic quadrilateral ACBDACBDACBD we... If HHH is its orthocenter, then it ’ s a cyclic quadrilateral properties quadrilateral is quadrilateral... And AF, AF, respectively produced to meet at x circumcircle or circumscribed circle, the. Of three consecutive angles in same segment are equal area of a quadrilateral... Of Olympiad flavor and are solvable by elementary methods the circumcircle, FFF... Are solvable by elementary methods the ACT and SATs 's formula you must be a Member. Lengths, the sum of angles a and C are inscribed angles the of! ∠C\Angle C∠C are acute but in an isosceles trapezoid, not only are the sides diagonals!, then prove that the angles of a cyclic quadrilateral is cyclic ( )... The ACT and SATs 's a property of cyclic quadrilaterals an easy way to tell Much Studying few! Become a Topographer: Step-by-Step Career Guide, Personality Disorder Crime Force: Study.com Academy Sneak Peek a! An Assistant Professor of Mathematics at Valdosta State University as well as an independent private | {
"domain": "wbrdc.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9805806540875628,
"lm_q1q2_score": 0.8192590013258874,
"lm_q2_score": 0.8354835452961425,
"openwebmath_perplexity": 2072.7705653590638,
"openwebmath_score": 0.5802627205848694,
"tags": null,
"url": "https://origin.wbrdc.com/subdural-intraspinal-zcqu/cyclic-quadrilateral-properties-003266"
} |
thermodynamics, power, continuum-mechanics
Title: Why is the total energy of system considered to be a state function? Mechanical power is not a state function because it changes with the change of the path taken from a specific initial point to a specific final point.
The same for thermal power. It is not a state function.
But the sum of mechanical and thermal power is the variation of total energy of the system, and the total energy is considered a state function.
I am not convinced since if the mechanical power decreased by some amount, the thermal power doesn't increase by the same amount..
So, why is the variation of the total energy considered a state function?
But the sum of mechanical and thermal power is the variation of total
energy of the system, and the total energy is considered a state
function.
That is true because heat and work are the only two basic means for transferring energy to or from a system. So while neither heat nor work are state functions the combination of the two must necessarily equal the change in the energy of the system (change in state function). For a closed system, the first law is
$$\Delta U=Q-W$$
I am not convinced since if the mechanical power decreased by some
amount, the thermal power doesn't increase by the same amount.
I'm not quite sure what you mean since it sounds like you may be confusing "thermal power" with internal energy.
At any rate, it is possible that the work done by or on the system can exactly equal the heat transfer out of or into the system, because in such a case $\Delta U=0$. An example is a reversible isothermal expansion or compression of an ideal gas.
Hope this helps. | {
"domain": "physics.stackexchange",
"id": 77532,
"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, power, continuum-mechanics",
"url": null
} |
circuit-construction, stabilizer-state, magic-states
Here is a circuit that prepares the state $\text{AND}_{1,2} \cdot \text{AND}_{1,3} \cdot \text{AND}_{2,3} \cdot \text{AND}_{1,2,3} \cdot |+\rangle^{\otimes 3}$ and then consumes it to perform a CCCZ: | {
"domain": "quantumcomputing.stackexchange",
"id": 3315,
"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": "circuit-construction, stabilizer-state, magic-states",
"url": null
} |
java, object-oriented, unit-testing, finance
/**
* Constructor
* @param startBalance The account's balance.
* @param annual_Interest_Rate The annual interest rate.
*/
public SavingsAccount(double startBalance, double annual_Interest_Rate)
{
balance = startBalance;
annualInterestRate = annual_Interest_Rate;
}
//end of Constructor
/**
* setAnnualInterestRate method sets the annual interest
* rate and calculates the monthly interest rate
* @param annual_Interest_Rate The annual interest rate.
*/
public void setAnnualInterestRate(double annual_Interest_Rate)
{
monthlyInterestRate = annualInterestRate / 12;
}
//end of setAnnualInterestRate method
/**
* The deposit method adds the amount to the balance
* and calculates the total deposit
* @param amount
*/
public void setDeposit(double amount)
{
balance += amount;
totalDeposits += amount;
}
//end of deposit method
/**
* The withdraw method subtracts the amount to the balance
* and calculates the total withdraws
* @param amount
*/
public void setWithdraw(double amount)
{
balance -= amount;
totalWithdraws += amount;
}
//end of withdraw method
/**
* The calculateMonthlyInterest method calculates the total
* interest and adds the monthly interest to the balance
*/
public void calculateMonthlyInterest()
{
totalInterest = totalInterest + balance * monthlyInterestRate;
balance = balance + balance * monthlyInterestRate;
}
//end of calculateMonthlyInterest method
/**
* The getBalance method returns the account's balance.
* @return The value of the balance field.
*/
public double getBalance()
{
return balance;
}
/**
* The getAnnualInterestRate method returns the annual interest rate.
* @return The value of the annual interest rate field.
*/
public double getAnnualInterestRate()
{
return annualInterestRate;
} | {
"domain": "codereview.stackexchange",
"id": 12654,
"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, object-oriented, unit-testing, finance",
"url": null
} |
gazebo
Title: Get WorldPtr to the simulated world by gzserver
Hi all,
I'm implementing my own simulator using Gazebo, Ignition and ROS. Using gzserver, a world file and my models, im able to get everything rendered correctly by gzserver and control everything. Now, i implemented the visualization in my simulator, in Qt, although it has low fps, but that's still a problem to be solved. Now, i want to control all the aspects of the world that is being simulated by gzserver.
Looking at Gazebo's API i noticed the classes World and Model under gazebo::physics, that allow me to control and have access to all of the data from the simulation that i need, and, so far so good. I just don't get how to have access do the world (get the matching WorldPtr) that is being simulated by gzserver, to be able to use all the funcionalities provided by World class.
The documentation doesn't helped me either, as it is poorly documented and no examples are given ...
Thanks in advance !
Pedro Silva
Originally posted by wicked88 on Gazebo Answers with karma: 38 on 2016-08-14
Post score: 0
I don't think there is a (trivial?) way to directly access WorldPtr from another process. Gazebo for example, runs two processes: gzserver, which holds the WorldPtr, and gzclient, which has no direct access to it. Instead, gzclient talks to gzserver via the transport layer.
If the current transport layer is not exposing enough for your use case, you could create a world plugin, or system plugin, which exposes the functionality you need for the GUI.
Let's say for example that you need CoM information for all models in the world. Your world plugin could publish that information on a new topic, and your GUI listens to it and displays the information accordingly.
That sounds like an awesome project, by the way :)
Originally posted by chapulina with karma: 7504 on 2016-08-15
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 3966,
"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": "gazebo",
"url": null
} |
array, vba, excel
Title: Report Building (Data Retrieval, Validation, Aggregation, Business Logic, Report Building, Visual Presentation) This:
Is a data table we get from our financial platform with lots of useful information. For reference, "--" is also the string they use to denote empty values.
This:
Is a spreadsheet I built (and had reviewed here) to track our customers' regular income requirements.
The code produces reports to show:
Whether clients with upcoming income have sufficient cash available in their accounts
Which accounts have a large % uninvested (above a minimum threshold value)
Which accounts are not attached to an investment model
A table of account notes appended to each of the above
Overview of the code:
Step 1: Get raw data into arrays
Step 2: Clean said data
Step 3: Produce Reports
Step 4: Print Reports to sheets and Format Presentation
N.B. The worksheet variables are codenames
N.B. There are a number of what I'll call "standard Functions" that appear in the code. You may safely assume that they do what they say they do.
As always, open to any and all feedback, at any level of abstraction. That said, I'm especially interested in the larger project-structure and general maintainability.
Module B1_Public_Variables
Option Explicit
Public Const WB_INCOME_LIST_FILEPATH As String = "S:\Lumin Admin Docs\Ascentric Cash Management\"
Public Const WB_INCOME_LIST_FILENAME As String = "Ascentric Client Income List.xlsm"
Public Const ASCENTRIC_TOP_LEFT_CELL_STRING As String = "Adviser" '/ At present, on row 3
Public Const NOTES_TOP_LEFT_CELL_STRING As String = "Adviser"
'/ Headers for this workbook | {
"domain": "codereview.stackexchange",
"id": 18114,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "array, vba, excel",
"url": null
} |
visualization, data-analysis
Title: Analysing 1GB of 200K of data rows having 50 columns Total Newbie question here :
5 years ago, I wrote a web application in LAMP stack not using a framework, targeting end users, which now has over 200,000 rows where each row has 50+ columns and the MySQL database size is over a GB.
How do I analyze the stats of the data including visually ?
Is there some tool to pass along this data to it and it magically generates stats ? There are multiple options if you want to extract insights from your data, some of which are:
Python or R : If you are comfortable in either of the 2 languages, you can easily generate visualizations in them. I cannot speak for R as I don't use it but in python there is a library called Dtale which automates exactly what you want. Just import the data into the function and it will generate multiple stats and visualizations for you.
PowerBI or Tableau : No code solution for visualizations. ALthough I don't know how these can magically generate stats or visualizations! But it is extremely easy for you to do so as these tools require a drag and drop functionality.
However the problem is not the tool but rather the large dataset size. If you have sufficient memory then there's no issue but if you are limited by your RAM then you would have to use batches to perform your analysis. Also there are some python BigData libraries that can be used. Either way what you want can easily be done.
Cheers! | {
"domain": "datascience.stackexchange",
"id": 11767,
"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": "visualization, data-analysis",
"url": null
} |
inorganic-chemistry, reaction-mechanism, ions
Weiss, A. W. Theoretical Electron Affinities for Some of the Alkali and
Alkaline-Earth Elements. Phys. Rev., 1968, 166 (1), 70-74
Tehan, F. J.; Barnett, B. L.; Dye, J. L. Alkali anions. Preparation and Crystal Structure of a Compound which contains the Cryptated Sodium Cation and the Sodium Anion. J. Am. Chem. Soc., 1974, 96 (23), 7203–7208
Dye, J. L. Compounds of Alkali Metal Anions. Angew. Chem., 1979, 18 (8), 587-598
Dye, J. L.; Ceraso, J. M.; Lok, M. T.; Barnett, B. L.; Tehan, F. J. A Crystalline Salt of the Sodium Anion (Na-). J. Am. Chem. Soc., 1974, 96 (2), 608-609 | {
"domain": "chemistry.stackexchange",
"id": 11039,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "inorganic-chemistry, reaction-mechanism, ions",
"url": null
} |
sorting, shell, posix, sh
last_sorted && exit 1
test "twenty${nl}seven" = "$(last_sorted "twenty${nl}seven")"
test "twenty${nl}seven" = "$(last_sorted "twenty${nl}seven" "twenty${nl}five")"
test "twenty${nl}five" = "$(last_sorted '' "twenty${nl}five")"
# Unit tests of file ops
d=$(mktemp -d)
trap 'rm -r "$d"' EXIT
cd "$d"
touch -t 12310900 "Hogmanay${nl}morning"
touch -t 12311200 "Hogmanay${nl}midday"
touch -t 12311500 "Hogmanay${nl}afternoon"
touch -t 12312200 "Hogmanay${nl}evening"
first_mtime && return 1
test "Hogmanay${nl}morning" = "$(first_mtime H*)"
last_mtime && return 1
test "Hogmanay${nl}evening" = "$(last_mtime H*)" Avoiding duplication
The pairs of functions have duplicated logic in them.
I would extract the comparator to avoid it.
Avoiding clever code
I find this a bit too clever:
${1+true} return 1
This alternative will have the same effect and I think looks more familiar and thereby easier to read:
test $# -gt 0 || return 1
Similarly, I find this one a bit clever too, because it combines two things, validating that there is a parameter and that it's a file:
test -e "${1-}" || return 1
I would spell out the two conditions, to separate the two intents:
test $# -gt 0 || return 1
test -e "$1" || return 1 | {
"domain": "codereview.stackexchange",
"id": 44194,
"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": "sorting, shell, posix, sh",
"url": null
} |
solubility, food-chemistry
Title: How can I avoid crystallisation of sugars in vinegar at low temperatures? I produce high density balsamic vinegar, when it's winter and the temperatures are very low, high density products tends to crystallize. think this is a problem of over saturation of the glucose. The main sugars are glucose and fructose the ratio is 1:0.95.
I try to make products that are lower than 70 brix, or 1,35 density and 6% acidity, composed by $\ce{CH3COOH}$ and tartaric acid.
How can I exactly calculate the solubility threshold of this mixture? How can I measure it?
How can I prevent the crystallization to happen?
Thank you very much
I can't sleep at night because of this problem !!! It is difficult to correctly measure the solubility, especially if it goes to multicomponent solutions, as your vinegar. It is possible to find tables with some components of your mixture, but you won't get the full picture, and it looks as the moment, when the hands-on experience is most important.
Nonetheless, I found some facts for you, namely:
the solubility of a-D-glucose in all the solvents increases with
increasing temperature and decreases with increasing volume fraction
of acetic acid, from Solubilities of {α-d-glucose in water + (acetic acid or propionic acid)} mixtures at atmospheric pressure and different temperatures
Another point is that the supersaturated solution can be stabilized by various means, and I think it already happens, as your vinegar contains lot of "impurities" from the grapes.
As for the second point, how to prevent it, the simplest solution will be to keep the temperature high enough, so that the crystallization does not occur. If this is not possible, the supersaturated solution will crystallize, sooner or later. If you than ask, how to slow down the process, until spring comes, filtration could help to remove the crystallization nuclei. | {
"domain": "chemistry.stackexchange",
"id": 760,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "solubility, food-chemistry",
"url": null
} |
# Multiple answers to $\int \sqrt{4t - t^2} \, \textrm{d} t$
I'm trying to understand why I'm getting different answers when taking different approaches to integrating
$$\int \sqrt{4t - t^2} \, \textrm{d} t$$
First, I tried substituting $\sqrt t = 2 \sin \theta$:
$$\begin{eqnarray} \int \sqrt{t}\sqrt{4 - t} \, \textrm{d} t &=& \int 2 \sin \theta \cdot \sqrt{4 - 4 \sin^2 \theta} \cdot 8 \sin \theta \cos \theta \, \textrm{d} \theta \\ &=& 32 \int \sin^2 \theta \cos^2 \theta \, \textrm{d} \theta \\ &=& 4 \int 1 - \cos 4 \theta \, \textrm{d} \theta \\ &=& 4 \theta - \sin 4 \theta + C \\ &=& 4 \theta - 4 \sin \theta \cos^3 \theta + 4 \sin^3 \theta \cos \theta + C \\ &=& 4 \arcsin \frac{\sqrt{t}}{2} + \frac{1}{2} (t - 2)\sqrt{4t - t^2} + C \\ \end{eqnarray}$$
Second, I tried completing the square and substituting $t - 2 = 2 \sin \theta$: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407175907054,
"lm_q1q2_score": 0.860383036838467,
"lm_q2_score": 0.8840392939666335,
"openwebmath_perplexity": 266.935391337121,
"openwebmath_score": 0.9391178488731384,
"tags": null,
"url": "https://math.stackexchange.com/questions/1679302/multiple-answers-to-int-sqrt4t-t2-textrmd-t"
} |
This lets them bring a 15th bar and catch the train with less than 5 minutes to spare.
It is not possible to move all 16 bars.
Consider the total distance that each person moves, in each direction, carrying each possible number of bars. For example $$R_2^+$$ is the total distance that Rod moves forward while carrying 2 bars. We can set up a system of equations. Both Rod and Lia must move a net distance of $$1$$ mile forwards: $$R_0^+ - R_0^- + R_1^+ - R_1^- + R_2^+ - R_2^- = 1 \\ L_0^+ - L_0^- + L_1^+ - L_1^- = 1$$ Both of them must spend less than $$370$$ minutes moving (note we have taken the reciprocals of their speeds in minutes per mile): $$20(R_0^+ + R_0^-) + 30(R_1^+ + R_1^-) + 60(R_2^+ + R_2^-) \le 370 \\ 30(L_0^+ + L_0^-) + 40(L_1^+ + L_1^-) \le 370$$ Finally, the total net distance moved by all the bars must be $$16$$ miles forwards: $$R_1^+ - R_1^- + 2(R_2^+ - R_2^-) + L_1^+ - L_1^- = 16$$ And of course each distance must be nonnegative.
Next (thanks to RobPratt) we multiply these equations by $$\frac{1}{2}$$, $$\frac{3}{7}$$, $$\frac{1}{40}$$, $$\frac{1}{70}$$, and $$-1$$ respectively, and sum them, yielding: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357591818725,
"lm_q1q2_score": 0.8179682590320194,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 947.357799367172,
"openwebmath_score": 0.5592548251152039,
"tags": null,
"url": "https://puzzling.stackexchange.com/questions/111626/the-thieves-and-the-gold-bars"
} |
We obtain with some help of Wolfram Alpha \begin{align*} G(x)&=\frac{x^3}{(1-x)(1-x^2)(1-x^3)}\\ &=-\frac{1}{8}\cdot\frac{1}{1+x}-\frac{1}{72}\cdot\frac{1}{1-x}-\frac{1}{4}\cdot\frac{1}{(1-x)^2}+\frac{1}{6}\cdot\frac{1}{(1-x)^3}\\ &\qquad+\frac{1}{9}\cdot\frac{1}{1-e^{-\frac{2\pi i}{3}}x}+\frac{1}{9}\cdot\frac{1}{1-e^{\frac{2\pi i}{3}}x}\tag{3}\\ &=\color{blue}{1}x^3+\color{blue}{1}x^4+\color{blue}{2}x^5+\color{blue}{3}x^6+\color{blue}{4}x^7+\color{blue}{5}x^8+\color{blue}{7}x^9+\color{blue}{8}x^{10}\\ &\qquad+\color{blue}{10}x^{11}+\color{blue}{12}x^{12}+\color{blue}{14}x^{13}+\color{blue}{16}x^{14}+\color{blue}{19}x^{19}+\color{blue}{21}x^{20}+\cdots \end{align*}
From (3) we obtain a closed formula for the coefficients $g_n=[x^n]G(x)$ for $n\geq 3$:
Comment: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9915543728093004,
"lm_q1q2_score": 0.8152452319654452,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 169.41428193310296,
"openwebmath_score": 0.9724651575088501,
"tags": null,
"url": "https://math.stackexchange.com/questions/1867469/number-of-integer-triplets-a-b-c-such-that-abc-and-abc-n"
} |
proteins, enzymes, cellular-respiration
Earlier models proposed simple rotational diffusion of a rigid c12 ring, possibly driven by electrostatic forces. The structural data on protonation-linked conformational changes in subunit c indicate that the process may be more mechanical, with local rotations within subunit c driving larger-scale rotations of the c12 oligomer as a whole, in a `wheels within wheels' type of mechanism.
The whole paper's a good read. But this is as current as I am on the topic, and it's likely that a more detailed mechanism has been determined for the action of ATP synthase since 1999. | {
"domain": "biology.stackexchange",
"id": 117,
"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": "proteins, enzymes, cellular-respiration",
"url": null
} |
graphics, tex
%1: frame colour
\newcommand*{\addglasses}[1]{%
\path[draw=#1,line width=1] (0.93,1.62) -- (1.30,1.50);%
\draw[line width=1,color=#1] (0.73,1.67) arc (65:92:0.20);%
\path[draw=#1,line width=1,rotate=-20] (0.23,1.7675) circle (0.125);%
\path[draw=#1,line width=1,rotate=-20] (-0.06,1.74) circle (0.1143);%
}
\begin{document}
\begin{tikzpicture}
\duck{yellow}%
\addglasses{brown}%
\end{tikzpicture}
\end{document} Not much to say about the last version; on the other hand, you could exploit PGF keys.
\documentclass{article}
\RequirePackage{xcolor}
\RequirePackage{tikz}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% combine ducks
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
%1: skin colour
\newcommand*{\duck}[1][]{\tikzset{/duck/.cd,#1}\duck@draw} | {
"domain": "codereview.stackexchange",
"id": 26758,
"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": "graphics, tex",
"url": null
} |
particle-physics, feynman-diagrams, weak-interaction
Title: Can interactions be both Cabibbo suppressed and allowed? Concerning the decay of the $K^+$ meson as shown in picture. I am restricting the analysis to the first two generations of quarks. As far as I understand, Cabibbo suppressed decays occur at $W$-vertices with either $u$-$s$ quarks or $c$-$d$ quarks, while Cabibbo allowed decays occur at W-vertices with either u-d quarks or c-s quarks. In the decay in the picture, the first w-vertex contains u-s quarks (anti-quarks in this case) and would thus be suppressed, while the second w-vertex involves u-d quarks and would thus be allowed. Is the overall reaction then both allowed and suppressed or is it just suppressed? I think I may have got something wrong. Can you only talk about allowed/suppressed decays in semi-leptonic decays, where only one quark-W vertex exists? This would classify as 'suppressed'
If both vertices are c-d or s-u a process is called 'doubly suppressed'. For an example see https://arxiv.org/abs/1901.06222 | {
"domain": "physics.stackexchange",
"id": 85251,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "particle-physics, feynman-diagrams, weak-interaction",
"url": null
} |
waves, harmonic-oscillator
Title: Watertank waves Say we have a rectangular tank of water and we push it lengthwise. Suppose the surface stays planar. What would be the trajectory of the centre of mass? If the water surface remains "essentially planar" it has to tilt. In that case the angle of the tilt will have a sinusoidal variation with time, and the center of mass calculation follows from drawing a diagram that shows the two triangles (one above, one below the mean surface) and calculates how much material is in each as a function of time. If the entire tank has linear motion after the push, you obviously would have to add that to the harmonic motion of the center of mass... | {
"domain": "physics.stackexchange",
"id": 18764,
"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": "waves, harmonic-oscillator",
"url": null
} |
regex, .htaccess
Title: Redirecting all pages under a certain directory to a single file I want to redirect all pages under a certain directory to a single file, like so:
/dir/a → /dir/new
/dir/b → /dir/new
/dir/new → /dir/new
With the straightforward
RedirectMatch 301 ^/dir/ http://example.com/dir/new
I get a redirect loop, since /dir/new redirects to itself. I replaced it with a regular expression
RedirectMatch 301 ^/dir/($|[^n]|n$|n[^e]|ne$|ne[^w]|new.) http://example.com/dir/new
which matches all URLs except the desired one. This works, but it's obviously the 'wrong' way to do it. What's a better way? RedirectMatch doesn't redirect all pages under a certain directory to a single file:
Then any request beginning with URL-path will return a redirect request to the client at the location of the target URL. Additional path information beyond the matched URL-path will be appended to the target URL.
That is, a request for /dir/a/blah would get redirected to /dir/new/blah, not to /dir/new as you said you wanted.
As a solution, I suggest using mod_rewrite:
RewriteEngine on
RewriteCond $0 !=/dir/new
RewriteRule ^/dir/.* /dir/new [R] | {
"domain": "codereview.stackexchange",
"id": 11841,
"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": "regex, .htaccess",
"url": null
} |
Assuming that we have three-dimensional real vectors : $Assumptions = (u | v | w) ∈ Vectors[3, Reals]; we can use e.g. various tensor functions (new in ver. 9) e.g. TensorReduce to reduce (simplify) a tensor expression, e.g. TensorReduce[ v.v + w.w - (v + w).(v + w) ] TensorReduce[u \[Cross] (v \[Cross] w) ] -2 v.w -w u.v + v u.w We can perform ... 8 Let us first define the vector field A = {10 x, 20 y^3, 30 z}; and load the vector analysis package: << VectorAnalysis` SetCoordinates[Cartesian[x, y, z]]; Now let's define$A\cdot \nabla A$field = (A.Grad[#]) & /@ A (* ==> {100 x, 1200 y^5, 900 z} *) and plot both fields: pl1 = VectorPlot3D[A, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, ... 8 Observe that even when the tangent vector$r'(t)$is not normalized, it is still a linear combination of$T(t)$and$N(t)$. Thus--operating under the usual assumptions that$r'$and$r''$exist and are linearly independent--all we have to do is make an orthonormal frame out of$r'(t)$and$r''(t)$(which is very much in the spirit of the entire proceeding). ... 7 The answer depends a lot on what you mean by "doing" vector calculus. You want results to be displayed without using component notation, and that's in general a difficult thing to achieve. A prerequisite about doing completely symbolic vector calculus is to define the simplification rules. But even in "non-vector" algebra it's often hard to get Simplify to ... 7 It isn't too hard to roll your own routine, of course: UnitNormalVector[f_, {u_, | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9597620591027811,
"lm_q1q2_score": 0.8018654038483934,
"lm_q2_score": 0.8354835411997897,
"openwebmath_perplexity": 1951.9357238091095,
"openwebmath_score": 0.660406768321991,
"tags": null,
"url": "http://mathematica.stackexchange.com/tags/vector-calculus/hot"
} |
biochemistry, molecular-biology
How do we get from that to "This distribution was consistent with two rate-limiting stochastic steps?"
If we recall from our stats class (or look up properties of the Gamma distribution on Wikipedia), a Gamma distribution with integer values of $k$ is the distribution of the waiting time for $k$ events to occur in a Poisson process. The setup of a Poisson process is that you are tracking the occurrence of unlikely/infrequent events in time, so the fact that the distribution $h(t)$ of burst times looks like a $\mathrm{Gamma}(2,\tau)$ suggests that the burst duration $\tau_{\mathrm{burst}}$ is determined by the occurrence of 2 stochastic events (with the same "frequency" $1/\tau$). In other words, this distribution is consistent with the following scenario: a nuclear localization occurs, and then will stop after two particular events, where the timing of the events is governed by a Poisson process (which, as WYSIWYG pointed out, is a reasonable model for the occurrence of chemical reactions with reasonably slow kinetics, i.e. you can count individual reactions in time). If this is true, the distribution of $\tau_{\mathrm{burst}}$ will look like $te^{-t/\tau}$.
The authors generalize that statement somewhat by saying that technically there could be more events/reactions required to terminate a localization burst, but all but 2 of those reactions happen extremely rapidly, i.e. there are 2 rate-limiting steps in the decision process (both of which happen to have the same value for $\tau$). | {
"domain": "biology.stackexchange",
"id": 1502,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "biochemistry, molecular-biology",
"url": null
} |
quantum-mechanics, optics, experimental-physics, quantum-optics
The lower part of the figure shows the Mueller optical calculus matrix calculation needed to calculate the transmitted light intensity, I. Note that I is the uppermost component of the Stokes output vector.
The Mueller matrices for the ideal horizontal linear polarizer and the general linear retarder (GLR) are from the wikipedia article on Mueller calculus. These matrices, with trivial notation changes and possible trivial component sign changes in the GLR matrix, are readily found in other sources: see references below.
To find the maximum transmitted light intensity, set $\theta = 0$ degrees and $\delta = 0$ degrees in the GLR matrix. It then reduces to the identity matrix and the calculation of the maximum transmitted light yields a value of 0.5. This calculation is shown in the upper part of the next figure:
To find the minimum transmitted light intensity, let $\theta = 45$ degrees in the GLR matrix, which simplifies considerably, and do the calculation shown in the lower part of the second figure.
References other than wikipedia:
W.A. Shurcliff, Polarized Light, Harvard University Press, Cambridge, MA, 1962, Appendix 2.
Kliger, D. S.,Lewis, J. W., Randall, C. E., Polarized Light in Optics and Spectroscopy, 1st ed., Academic Press, Boston, 1990, Appendix B II.
As noted above, $\theta = 45$ degrees minimizes the transmitted light intensity. This is easily verified by running the optical calculus simulation program shown in the upper part of the first figure. The program appears to be a block diagram because that is how I programmed it long ago and it is the same program as I used in my answer here.
For the 71 degrees retardance used in the simulation in the first figure, the transmitted light intensity was 0.331392038614 for $\theta = 45$ degrees. Keeping the retardance constant and running the program for $\theta$ angles from 0 to 90 degrees, in increments of 1 degree, yields the following plot: | {
"domain": "physics.stackexchange",
"id": 85757,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, optics, experimental-physics, quantum-optics",
"url": null
} |
Dedekind's Product Theorem (which a friend of mine calls the "Royal Dutch Airlines Theorem") states that if $K\subseteq L\subseteq M$ are fields, then $$[M:K] = [M:L][L:K].$$ The proof of the theorem is constructive: if $\{m_i\}_{i\in I}$ is a basis for $M$ as an $L$-vector space, and $\{\ell_j\}_{j\in J}$ is a basis for $L$ as a $K$-vector space, then one shows that $\{m_i\ell_j\}_{(i,j)\in I\times J}$ is a basis for $M$ as a $K$-vector space. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357628519819,
"lm_q1q2_score": 0.8115607447686002,
"lm_q2_score": 0.8289388146603365,
"openwebmath_perplexity": 145.8034770659341,
"openwebmath_score": 0.9276941418647766,
"tags": null,
"url": "http://math.stackexchange.com/questions/131572/finite-extensions-and-bases"
} |
shors-algorithm
After that you can calculate factors $p,q = \gcd\{a^{r/2}\pm1;N\} = \gcd\{11\pm1;15\}$, i.e. $p =\gcd\{12;15\}=3$ and $q =\gcd\{10;15\}=5$. | {
"domain": "quantumcomputing.stackexchange",
"id": 3523,
"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": "shors-algorithm",
"url": null
} |
machine-learning
...and haven't missed anything
Say that $f\left(x\right)$ is well-behaved, where
$$
\begin{array}{ccccr}
&&\left|f\left(x\right)-f\left(x-1\right)\right|<10 && \forall x \\
\end{array}
$$
; then you can construct new evaluation strategies where you try to minimize the number of evaluations by identifying points that can't be minimal and skipping them.
It's hard to know what you might be missing
In machine learning cases where you're analyzing the real world, we don't really have an analytical problem statement. Physics isn't perfectly accurate; measurements aren't perfectly reliable; and things can change.
So, you're right that data scientists can usually improve algorithms in real-world cases.
Human brains are good at human problems due to extreme selection bias
Regarding, | {
"domain": "cs.stackexchange",
"id": 8925,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning",
"url": null
} |
ros, ros-fuerte, raspberrypi, dependencies, image-transport
Title: install dependencies on raspberry pi
Hi
I installed ros fuerte in my raspberry pi in which there is raspbian wheezy and all work fine.
Now i must use the raspberry to receive a stream video from a webcam and publish the images, but when i create the package, doesn't find the dependecies image_transport opencv and cv_bridge.
How can install its without reinstall ros?
thanks
Originally posted by mrpiccolo on ROS Answers with karma: 36 on 2013-02-26
Post score: 0
They may not be available for the Raspberry Pi it's an experimental platform at the moment.
Originally posted by tfoote with karma: 58457 on 2013-03-28
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 13069,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, ros-fuerte, raspberrypi, dependencies, image-transport",
"url": null
} |
1, -1, Determine Eigenvalues, Eigenvectors, Diagonalizable From a Partial Information of a Matrix, Maximize the Dimension of the Null Space of $A-aI$, Solve a System of Linear Equations by Gauss-Jordan Elimination, Dimension of Null Spaces of Similar Matrices are the Same, The Centralizer of a Matrix is a Subspace, Top 10 Popular Math Problems in 2016-2017 – Problems in Mathematics, Linear Combination and Linear Independence, Bases and Dimension of Subspaces in $\R^n$, Linear Transformation from $\R^n$ to $\R^m$, Linear Transformation Between Vector Spaces, Introduction to Eigenvalues and Eigenvectors, Eigenvalues and Eigenvectors of Linear Transformations, How to Prove Markov’s Inequality and Chebyshev’s Inequality, How to Use the Z-table to Compute Probabilities of Non-Standard Normal Distributions, Expected Value and Variance of Exponential Random Variable, Condition that a Function Be a Probability Density Function, Conditional Probability When the Sum of Two Geometric Random Variables Are Known. The eigenvalue is the factor by which it is stretched. But distinct eigenvectors can have the same eigenvalue. Those are in Q. it’s a Markov matrix), its eigenvalues and eigenvectors are likely to have special properties as well. All square, symmetric matrices have real eigenvalues and eigenvectors with the same rank as . A matrix A and its transpose possess the same eigenvalues but not necessarily the same eigenvectors. My problem! A matrix and its transpose have the same eigenvalues/characteristic polynomial. That's just perfect. Formally, =. Writing code in comment? (See Matrix Transpose Properties) It follows that since symmetric matrices have such nice properties, is often used in eigenvalue problems. Is an Eigenvector of a Matrix an Eigenvector of its Inverse? ST is the new administrator. Proof. matrix multiplied by its transpose on the left or right = same eigenvalues? Your email address will not be published. Thus, the matrix B is known as the Transpose of the matrix A. Please write to us at contribute@geeksforgeeks.org to report any issue with the above content. The set of all eigenvalues of A is | {
"domain": "levonline.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9334308110294983,
"lm_q1q2_score": 0.819063866407941,
"lm_q2_score": 0.8774767842777551,
"openwebmath_perplexity": 373.11426350705506,
"openwebmath_score": 0.8160443902015686,
"tags": null,
"url": "http://midnattssolsrallyt.com.php54.levonline.com/mrs-doubtfire-xwcehnm/dac93d-parallel-concurrent%2C-and-distributed-programming-in-java-github"
} |
ros2
Has anyone encountered this? How can I solve this problem?
Originally posted by Dr.Modi on ROS Answers with karma: 7 on 2022-02-18
Post score: 0
It looks like Command is not in Eloquent. https://github.com/ros2/launch/tree/eloquent/launch/launch/substitutions
It was added in Foxy. https://github.com/ros2/launch/blob/foxy/launch/launch/substitutions/command.py
Originally posted by tnajjar with karma: 166 on 2022-02-20
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 37454,
"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
} |
ros, ros2, build, dependencies, ros-bouncy
Could not find a package configuration file provided by
"ament_cmake_include_directories" with any of the following names:
ament_cmake_include_directoriesConfig.cmake
ament_cmake_include_directories-config.cmake
Add the installation prefix of "ament_cmake_include_directories" to
CMAKE_PREFIX_PATH or set "ament_cmake_include_directories_DIR" to a
directory containing one of the above files. If
"ament_cmake_include_directories" provides a separate development package
or SDK, be sure it has been installed.
Call Stack (most recent call first):
/home/environ/Developer/arm_ros2_ws/install/ament_cmake_target_dependencies/share/ament_cmake_target_dependencies/cmake/ament_cmake_target_dependenciesConfig.cmake:38 (include)
/home/environ/Developer/arm_ros2_ws/install/ament_cmake/share/ament_cmake/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
/home/environ/Developer/arm_ros2_ws/install/ament_cmake/share/ament_cmake/cmake/ament_cmakeConfig.cmake:38 (include)
CMakeLists.txt:5 (find_package)
Originally posted by austinstig on ROS Answers with karma: 31 on 2018-08-03
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 31460,
"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, build, dependencies, ros-bouncy",
"url": null
} |
GlobalProperty
This optional argument represents a sequence of couple statements {PropertyName,PropertyValue} that defines global objects' properties applied to all the curves created by this plot. For a complete view of the available properties (see GlobalProperty).
axes_handle
This optional argument forces the plot to appear inside the selected axes given by axes_handle rather than the current axes (see gca).
Description
semilogx plots data using a base 10 logarithmic scale for the x-axis and a normal (linear) scale for the y-axis. The possible syntaxes and arguments are the same as the plot function besides the condition that the abscisae values in x argument be strictly positive.
If the current axes is not empty and the the x-axis has a negative lower bound then its scale will remain linear after the plot.
Enter the command semilogx to see a demo.
Examples
w=logspace(-2,2,1000);
s=%i*w;
g=1../(s.^2+s+1);
clf("reset")
semilogx(w,abs(g));
title("$\LARGE \left|1/(s^2+s+1)\right|\mbox{ for }s=i\omega$")
xlabel("$\LARGE \omega$")
• plot — 2D plot
• semilogy — 2D semilogarithmic plot
• loglog — 2D logarithmic plot
• LineSpec — to quickly customize the lines appearance in a plot
• GlobalProperty — customizes the objects appearance (curves, surfaces...) in a plot or surf command
History
Version Description 6.1.1 Function semilogx added. | {
"domain": "scilab.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811611608242,
"lm_q1q2_score": 0.8023698345755244,
"lm_q2_score": 0.8311430415844384,
"openwebmath_perplexity": 5816.945202070911,
"openwebmath_score": 0.6154765486717224,
"tags": null,
"url": "https://help.scilab.org/docs/6.1.1/en_US/semilogx.html"
} |
ros, planning-scene, arm-navigation
Title: Error when using real robot data for planning_scene_warehouse_viewer
I want to use the arm_navigation_warehouse with our real robot and I don't get along this error. As the warehouse tutorial states, I start the planning_scene_warehouse_viewer_scitos_haw_schunk.launch from my wizard-created package.
I specify the trajectory action service and check Use Robot Data. Accepting this config loads the planning_scene_warehouse_viewer, so long so usual. But after creating a new.. planning scene, I get the following errors:
[ERROR] [x.300639468, x.297759056]: Setting planning scene state to NULL
[ERROR] [x.300739768, x.297759056]: Setting planning scene state to NULL
[ WARN] [x.301398800, x.297759056]: Incomplete robot state in setPlanningScene
[ERROR] [x.301461209, x.297759056]: Setting planning scene state to NULL
[ERROR] [x.301492785, x.297759056]: Setting planning scene state to NULL
[ERROR] [x.303755538, x.297759056]: Something wrong with planning scene
However, the next window for the planning scene opens, but trying to create a new Motion Plan Request quits the viewer:
[planning_scene_warehouse_viewer-9] process has died [pid 9602, exit code -11].
If I enable debug level for those parts:
/planning_scene_warehouse_viewer:ros.planning_models
/planning_scene_warehouse_viewer:ros.urdf
.. before clicking new.., I also get this five times (for every joint?) before the [ WARN] from above:
[DEBUG] [x.643684884, x.637037992]: Transform angle is 0 axis x 1 axis y 0 axis z 0
Does anyone know what's up or how to investigate further?
"Something wrong with planning scene" code line
"Incomplete robot state in setPlanningScene" code line | {
"domain": "robotics.stackexchange",
"id": 8333,
"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, planning-scene, arm-navigation",
"url": null
} |
electric-fields
If $q>0$ the force $\textbf{F}$ is parallel to the electric field $\textbf{E}$.
If $q<0$ the force $\textbf{F}$ is anti-parallel to the electric field $\textbf{E}$.
Therefore, as Philip wrote, there is no logical contradiction involved: The force and the electric field don't have to point in the same direction.
An other example where this is the case is the magnetic force on a moving charge (the so called Lorentz force). Here the magnetic fields is perpendicular to the force. | {
"domain": "physics.stackexchange",
"id": 42867,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-fields",
"url": null
} |
element of the polynomial is the highest degree. Finally, f(0) is easy to calculate, f(0) = 0. With this information, it's possible to sketch a graph of the function. ... Simplify the polynomial, then reorder it left to right starting with the highest degree term. We want to write a formula for the area covered by the oil slick by combining two functions. Because the power of the leading term is the highest, that term will grow significantly faster than the other terms as x gets very large or very small, so its behavior will dominate the graph. And these are kind of the two prototypes for polynomials. The leading term is $0.2{x}^{3}$, so it is a degree 3 polynomial. Which function is correct for Erin's purpose, and what is the new growth rate? Composing these functions gives a formula for the area in terms of weeks. * * * * * * * * * * Definitions: The Vocabulary of Polynomials Cubic Functions – polynomials of degree 3 Quartic Functions – polynomials of degree 4 Recall that a polynomial function of degree n can be written in the form: Definitions: The Vocabulary of Polynomials Each monomial is this sum is a term of the polynomial. So, the end behavior is, So the graph will be in 2nd and 4th quadrant. End behavior of polynomial functions helps you to find how the graph of a polynomial function f (x) behaves (i.e) whether function approaches a positive infinity or a negative infinity. The leading coefficient is $–1$. Describe the end behavior of the polynomial function in the graph below. Also, be careful when you write fractions: 1/x^2 ln (x) is 1 x 2 ln ( x), and 1/ (x^2 ln (x)) is 1 x 2 ln ( x). Identify the degree of the polynomial and the sign of the leading coefficient So, the end behavior is, So the graph will be in 2nd and 4th quadrant. The definition can be derived from the definition of a polynomial equation. For example in case of y = f (x) = 1 x, as x → ±∞, f (x) → 0. Did you have an idea for improving this content? It has the shape of an even degree power function with a negative coefficient. Describing End Behavior of Polynomial Functions Consider the leading term of each polynomial | {
"domain": "sajonhussain.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759632491111,
"lm_q1q2_score": 0.8337162900655254,
"lm_q2_score": 0.8499711699569787,
"openwebmath_perplexity": 354.81365435966796,
"openwebmath_score": 0.5956211686134338,
"tags": null,
"url": "https://sajonhussain.com/chef-a-ulmk/dca021-what-is-the-end-behavior-of-the-polynomial-function%3F"
} |
These are both uniform random variables if they independent we can write it like this. First $X_{1} \sim U(0,a)$ $X_{2} \sim U(0,b)$ . Also note the proof assumes that $a \leq b$ The pdf of a uniform random variable $X \sim U(a,b)$ is given by
f_{X}(x) =\begin{align}\begin{cases} \frac{1}{b-a} & \textrm{ for } x \in [a,b] \\ \\ 0 & \textrm{ for everywhere else } \end{cases} \end{align} \tag{1}
then the pdf of $X_{1}$ is given by
f_{X_{1}}(x_{1}) =\begin{align}\begin{cases} \frac{1}{a} & \textrm{ for } x \in [0,a] \\ \\ 0 & \textrm{ for everywhere else } \end{cases} \end{align}\tag{2}
so the pdf of $X_{2}$ is f_{X_{2}}(x_{2}) =\begin{align}\begin{cases} \frac{1}{b} & \textrm{ for } x \in [0,b] \\ \\ 0 & \textrm{ for everywhere else } \end{cases} \end{align} \tag{3}
Let the density $S = X_{1} + X_{2}$ be given by
$$f_{S}(s) = \int_{\mathbb{R}} f_{X_{1}}(s-x_{2})f_{X_{2}}(x_{2}) dx_{2} \tag{4}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305307578323,
"lm_q1q2_score": 0.8108721650076838,
"lm_q2_score": 0.8418256472515683,
"openwebmath_perplexity": 1107.9349943961265,
"openwebmath_score": 1.0000091791152954,
"tags": null,
"url": "https://math.stackexchange.com/questions/2889954/distribution-function-of-x-1-x-2-given-probability-distributions-of-x-1-an"
} |
mass, weight
Title: How do you measure mass? I feel like I am missing something fundamental with regards to mass vs. weight.
The weight of an object on the Moon is approximately 16.5% what you would experience on Earth.
In other words, if an object weighs 100kg on Earth, it would weigh only 16.5kg on the Moon.
As I'm led to believe by this statement, weight is variable, and depends on the gravitational force exerted upon it, but it's the same object, with the same constant mass.
I am even more confused by the statement made in the following site: https://www.mathsisfun.com/measure/weight-mass.html
An object has mass (say 100kg). This makes it heavy enough to show a weight of 100kg.
What I am confused about here, is the statement "An object has mass (say 100kg)", surely that is based on its weight on Earth? | {
"domain": "physics.stackexchange",
"id": 94008,
"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": "mass, weight",
"url": null
} |
python, beginner, number-guessing-game
Title: Console guessing game in Python What would make it better?
This is my first Python project. Do help in making it better, for me to learn something new.
secret="12345"
guess=""
count=0
limit=3
limited=False
while guess!=secret and not(limited):
if count<limit:
guess=input("Enter guess: ")
count +=1
else:
limit=True
if limited:
print("Out of guesses, You Lose!")
else:
print("You got it!")
So far, I think your initial approach is good. Your naming is clear and the code is pretty obvious in what it's trying to accomplish. Nice work!
Rethinking while
I think the while loop can actually be reduced to a for/else, because you are looping until a conditional is reached and marking a flag. So I'd do:
# iterate over the range of guesses
for _ in range(limit):
guess = input('Enter guess: ')
if guess == secret:
message = "You got it!"
break
else:
message = "Out of guesses, you lose!"
print(message)
Where the else here will only trigger if the loop didn't exit early:
# breaks early, no else fired
for i in range(3):
break
else:
print('finished')
# loop completes, else fires
for i in range(3):
continue
else:
print('finished')
finished
Style Items
It is good to include whitespace in between operators for assignment and comparison:
# go from this
secret="12345"
guess!=secret
count +=1
# to this
secret = "12345"
guess != secret
count += 1
The not keyword isn't a function and doesn't need parentheses:
not limited
Making code reusable
Right now, you have a hard-coded secret. This is sufficient for getting your program running, but what if you want a new game to have a new secret? Let's create one on the fly using the random module:
import random
from string import digits # imports "0123456789" as a string | {
"domain": "codereview.stackexchange",
"id": 43181,
"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, beginner, number-guessing-game",
"url": null
} |
javascript, integer
Title: Simple function to verify if a number is integer Sometimes, there's the need to verify if a given number is an integer or a decimal. Since JavaScript doesn't distinguish between both, I've made an extremelly basic function.
function isInteger(num){
var numCopy = parseFloat(num);
return !isNaN(numCopy) && numCopy == numCopy.toFixed();
}
As you can see, it relies on checking if the number without decimals is the same as the parsed value. I'm not so confident about this.
Notice that this may return true for some scientific notation values.
Examples of results:
1.0: true (JavaScript treats <n>.0 as an integer)
1e3: true
1.2345e2: false (equivalent to 123.45)
1.2345e5: true (equivalent to 123450)
1e200: true (equivalent to Infinity)
Is there any more reliable way of checking? The results seem to be consistent with the expected results. Regular expressions are an option but they are clunky. In ES6, the next version of Javascript, there will be a function exactly for this purpose called Number.isInteger(). Currently, MDN offers the following polyfill which I assume therefore does the best Javascript can to determine whether something is an integer. There are edge cases of course, but for most everyday use it will do the trick:
Number.isInteger = Number.isInteger || function(value) {
return typeof value === "number" &&
isFinite(value) &&
Math.floor(value) === value;
}; | {
"domain": "codereview.stackexchange",
"id": 15298,
"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, integer",
"url": null
} |
quantum-field-theory, condensed-matter, thermal-field-theory
$$
The first line come from applying Poisson summation to the zero temperature expression
$$
\int_{-\infty}^{\infty} \frac{dk}{2\pi}\frac{e^{ik\tau}} {k^2+M^2}=\frac 1 {2|M|}e^{-|\tau||M|}
$$
and has the physical interpretation as the method-of-images sum over the $n$-fold winding of the particle trajectory around the periodic imaginary time direction.
The passage from the first to second lines is just summing the two geometric series from $n=0$ to $ \infty$ and $n=-\infty$ to $-1$.
You can get the extra factor of $\omega_n=n$ by differentiating wrt $\tau$ | {
"domain": "physics.stackexchange",
"id": 92459,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, condensed-matter, thermal-field-theory",
"url": null
} |
5. Nov 28, 2012
### Ray Vickson
Explanation: you are neglecting the fact that if A draws a red ball the game stops and B does not get to draw a ball at all.
Your conclusion would be correct if B got to select a ball whether or not A got red; that is, even though B would be drawing from an urn now containing 9 balls, he would still have a 3/10 chance of getting red. To see this, number the balls from 1 to 10. There are 10! permutations altogether; A takes the first ball in line, then B takes the second, etc. The number of permutations in which the first ball is red is the same as in which the second ball is red, so A and B have the same probabilities of choosing red. In fact, this argument applies to any position, so if they continually choose balls without replacement (and don't look at the colors), then, when B chooses the very last ball he still has a 3/10 chance of choosing red! The argument is the same: the number of permutations in which a red ball is last is (3/10)*10! Students are often very surprised when they first see this.
RGV
6. Nov 28, 2012
### CAF123
So this means the probability remains the same indep of what has been chosen before as long as we don't know what balls have been picked out before?
I solved this problem by noting down the combinations in which A would win:
R, BBR, BBBBR,BBBBBBR and I attained the right answer. Is there a more elegant approach? e.g say if the number of balls got very large, my method is inefficient.
Last edited: Nov 28, 2012
7. Nov 28, 2012
### haruspex
Set up a recurrence relation. Define P(r, b) = prob that first player gets the first red, given r red and b black available. Consider the possible outcomes of the first player's draw, and thereby obtain an equation relating P(r, b) to P(r, b-1).
8. Nov 28, 2012
### Ray Vickson | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9669140216112959,
"lm_q1q2_score": 0.8119505419483957,
"lm_q2_score": 0.8397339616560072,
"openwebmath_perplexity": 750.5451098797258,
"openwebmath_score": 0.7946617007255554,
"tags": null,
"url": "https://www.physicsforums.com/threads/probability-urn-problem.655423/"
} |
python, python-3.x, file-system, web-scraping, selenium
else:
# acquires the download location by going to the parent tag which is an a tag containing the link for html in its 'href' attribute
download_path = _file.find_element_by_xpath('..').get_attribute('href').replace(r"%5E", "^")
current_file_name = re.search(r'https://coursevania.courses.workers.dev/\[coursevania.com\]%20Udemy%20-%20Master%20the%20Coding%20Interview%20Data%20Structures%20\+%20Algorithms/.+/(.+)', download_path, re.DOTALL).group(1).replace("%20", " ")
time.sleep(2)
current_file_path = "E:\\Utilities_and_Apps\\Python\\MY PROJECTS\\Test data\Downloads\\" + current_file_name
# responsible for downloading it using a path, get allows downloading, by source links
if download:
browser.get(download_path)
# while the file doesn't exist/ it hasn't been downloaded yet, do nothing
while True:
if os.path.exists(current_file_path):
break
time.sleep(1)
# moves the file from the download spot to its own folder
if move:
shutil.move(current_file_path, current_folder_path + "\\" + current_file_name)
print(current_file_name)
# formatter
print("------------------------------", "", sep="\n")
time.sleep(3) | {
"domain": "codereview.stackexchange",
"id": 38170,
"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, file-system, web-scraping, selenium",
"url": null
} |
c++, beginner, math-expression-eval
double return_value = 1;
for(int i = 2; i < argc; i++)
{
return_value *= strtod(argv[i],NULL);
}
return return_value;
}
double mean(int argc,const char* argv[])
{
double summation = sum(argc, argv);
return summation/((double) argc-2);
}
You're using C headers (which end in .h), not the C++ ones. This will also ensure that they're put into the std namespace. Also, you can remove <string.h> since it's not currently in use.
All of your operations rely on command line arguments, yet the program is still allowed to continue even if there aren't any (excluding the filename). You can fix this by terminating the program right away if argc is too low.
if (argc == 1)
{
// print this to the standard error stream
std::cerr << "Additional arguments are required!";
// same as return 1, also used for failure
return EXIT_FAILURE;
}
With this in place, you should also redo the other argc checks. Add this given check first, then have the others. I'd also consider replacing else with an else if that includes a specific number of command line arguments. With the else there, that code block will be executed with any other value not already given in an if.
Consider changing the parameter names of the functions for clarity. Even if you're trying to pass the command line arguments to them, the functions themselves aren't very self-documenting.
You could also assign the various argv[] values to separate variables in main() and passing them to the other functions. This again helps with self-documentation.
There's no need to declare and then initialize:
double operand;
operand = strtod(argv[2], NULL );
If you just need to initialize, then do that only:
double operand = strtod(argv[2], NULL );
The contents of mean():
double summation = sum(argc, argv);
return summation/((double) argc-2); | {
"domain": "codereview.stackexchange",
"id": 9516,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, beginner, math-expression-eval",
"url": null
} |
I briefly tried finding a quadratic function that works but didn't find anything. So my question is: how can I either show that $f$ must be linear or find all other representations?
• This question was from IMO 2015 shortlist, which was supposed to be kept confidential until July 2016. Note that the problems are used in some IMO2016 team selection tests, so it is really important that they are kept secret. – wythagoras Aug 11 '17 at 18:07
• Now that this is public, the official solution can be found here: imo-official.org/problems/IMO2015SL.pdf. – Sil Apr 7 '18 at 7:56 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808690122163,
"lm_q1q2_score": 0.8082042536559106,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 105.06288484850971,
"openwebmath_score": 0.9695606231689453,
"tags": null,
"url": "https://math.stackexchange.com/questions/1568106/find-all-functions-f-such-that-fx-fy-ffx-fy-1"
} |
php, html, sql, mysql, url
$url = $_POST["url"];
$hash = hash("crc32", "$url");
if (!empty($url)) {
if ((substr($url, 0, 7) == "http://") or (substr($url, 0, 8) == "https://")) {
if (!($stmt = $mysqli->prepare("INSERT INTO links(hash, link) VALUES (?,?)"))) {
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
if (!$stmt->bind_param("ss", $hash, $url)) {
echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
}
if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
}
echo "<a href='http://gus.netii.net/?l=".$hash."'>gus.netii.net/?l=".$hash."</a>";
}
else {
echo "Your link needs to start with http:// or https://";
}
} | {
"domain": "codereview.stackexchange",
"id": 8619,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, html, sql, mysql, url",
"url": null
} |
special-relativity, representation-theory, poincare-symmetry
Title: Unitary representations of the Poincare group in $(2+1)$ dimensions I am interested in classifying the unitary irreducible representations (UIR) of the Poincare group in (2+1) dimensions. I have done this in the (3+1) dimensional case but with the guidance of the abundant material available. For obvious reasons, the (2+1)-D case has not received as much attention and full reviews are few and far between.
I have proved that $\text{SO}(2,1)_{_0}\cong\text{SL}(2,\mathbb{R})/\mathbb{Z}_2$ and determined all irreducible finite dimensional representations of $\text{SL}(2,\mathbb{R})$ and of the Lorentz algebra $\mathfrak{so}(2,1)$. The irreps are determined by an integer $n=0,1,2,...$ and are realised on totally symmetric spin-tensors $\psi_{\alpha_1\alpha_2\cdots\alpha_n}=\psi_{(\alpha_1\alpha_2\cdots\alpha_n)}$. I have found the Casimir operator of the Lorentz group and found that it has eigenvalues $-\frac{1}{2}n(n+2)$ in the irrep labelled by $n$.
What are the next steps I should take in order to classify the UIR's of the (2+1) Poincare group?
I think the general procedure should go like | {
"domain": "physics.stackexchange",
"id": 41655,
"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": "special-relativity, representation-theory, poincare-symmetry",
"url": null
} |
for exercise 3 and 4 it is the same and i checked my calculations again and again with the calculator there's no error but yet all of that was marked with 0 for not saying "is equivalent", i didn't use the symbol $\Rightarrow$ All i got was 4 from exercise 5 which had calculation of dot product and of area of triangle where we are given coordinates of two vectors in the plane
• In Exercise 2, your two points do not satisfy $x + y - 1 = 0$. – dfan Dec 19 '14 at 20:28
• You should have edited: math.stackexchange.com/questions/1074894/… instead of making a duplicate post. Also, why did you start a new user account since you must be the same user as the other post? – dustin Dec 19 '14 at 20:36
• this is comment: i made a typo it should be $$(\frac{-1-\sqrt{11}}{2},\frac{3+\sqrt{11}}{2})$$ and $$(\frac{-1+\sqrt{11}}{2},\frac{3-\sqrt{11}}{2})$$ sorry again my computer crashed i made an edit but it should be approved – ecaps ro Dec 19 '14 at 20:42
• This was cross posted at matheducators.stackexchange.com/questions/6056/… – Chris C Dec 19 '14 at 22:03
The posted solutions are correct, below is a possible derivation.
Exercise 1
In this exercise you need to find the center and radius of this circle which depends on $m$.
$$x^2+y^2+(m+2)x-2my+m^2-36=0$$
Notice that $(y-m)^2=y^2+m^2-2my$ and rewrite as
$$x^2+(y-m)^2+(m+2)x-36=0$$
Add $0=1-1+m+\frac{m^2}4-m-\frac{m^2}4$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9481545289551957,
"lm_q1q2_score": 0.8220838710208492,
"lm_q2_score": 0.8670357477770336,
"openwebmath_perplexity": 381.03704787684256,
"openwebmath_score": 0.7801355719566345,
"tags": null,
"url": "https://math.stackexchange.com/questions/1074922/finding-the-points-of-intersection-of-a-circle-and-a-line"
} |
reference-frames, time-evolution, unitarity, two-level-system, rabi-model
Title: Two Level Atom Rotating Frame Introduction
I am trying to work out the Rabi problem. In particular I am trying to work it out from a perspective focusing on the operators rather than the kets. Think Heisenberg picture rather than Schrodinger picture. It's a bit tricky because in either the ket-centric or operator-centric view you must go into the "rotating frame" which is an interaction frame.
This question is very long and involves a section where I explain my understanding of unitary transformations and switching reference frames just so responders know what my understanding is. The main question I'm asking is at the very bottom.
Short Synopsis of Question
I am trying to derive the Hamiltonian shown in the Wikipedia page for the Autler-Townes effect or AC stark shift.
$$
H = -\Delta \lvert e \rangle \langle e \rvert + \frac{\Omega}{2}\left(\lvert e \rangle \langle g \rvert + \lvert g \rangle \langle e \rvert\right)
$$
I am beginning with the Schrodinger picture Hamiltonian for a two-level system coupled to an oscillating driving field
$$
H = \omega_0\lvert e \rangle \langle e \rvert + \frac{\Omega}{2}\left(e^{-i\omega t} \lvert e \rangle \langle g \rvert + e^{+i\omega t}\lvert g \rangle \langle e \rvert\right)
$$
I want to derive the wikipedia Hamiltonian specifically by performing a unitary transformation to get into the rotating frame and simply applying the formulas for effective interaction picture Hamiltonians. In particular, I don't want to have to derive equations of motion and then "notice" what the effective Hamiltonian should be. I'd also like to work in the Heisenberg/operator picture rather than Schrodinger picture as is often done for this problem. | {
"domain": "physics.stackexchange",
"id": 50828,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reference-frames, time-evolution, unitarity, two-level-system, rabi-model",
"url": null
} |
That is equivalent to the two equations ax+ by= p and cx+ dy= q. Multiply the first equation by d to get adx+ bdy= pd and multiply the second equation by b to get bcx+ bdy= bq. The coefficents of y are now the same, bd, so subtracting one equation from the other eliminates y: (ad- bc)x= pd- bq. If ad- bc is not 0, divide both sides by ad- bc to get $\displaystyle x= \frac{pd- bq}{ad- bc}$ as before. If ad- bc= 0 and pd- bq is not 0, there is no x that makes that equation true. If both ad- bc= 0 and pd- bq= 0 then any x works. | {
"domain": "mymathforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534376578004,
"lm_q1q2_score": 0.8113791322429099,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 814.032562742692,
"openwebmath_score": 0.6252420544624329,
"tags": null,
"url": "http://mymathforum.com/linear-algebra/343774-reversing-matrix-print.html"
} |
homework-and-exercises, newtonian-mechanics, kinematics, work
Title: Calculating force required to stop bungee jumper Given that:
bungee jumper weighs 700N
jumps off from a height of 36m
needs to stop safely at 32m (4m above ground)
unstretched length of bungee cord is 25m
Whats the force required to stop the jumper (4m above ground)
First what equation do I use?
$F = ma$? But even if $a = 0$ $v$ may not equals 0 (still moving)
$W = F \Delta x$? Can I say if $\Delta x = 0$ object is not moving? Even then, I don't know the work ...
I tried doing:
$-32 = \frac{1}{2} (-9.8) t^2$
$t = 2.556s$
Then I'm stuck ... I know $t$ but I cant seem to use any other equations... $v_f, v_i =0 $ As others here have pointed out, the force of the bungee cord would vary, increasing as it is stretched.
So your question is not well posed. If this is an actual homework problem I would guess that you misread it and you are actually being asked to find the force constant of the bungee cord (assuming, as I will below, that it obeys Hooke's law). Or perhaps you want the maximum force on the jumper due to the bungee cord (which would be when it is stretched the most). Here is how you would get those... | {
"domain": "physics.stackexchange",
"id": 4959,
"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, kinematics, work",
"url": null
} |
relation, then A/Ris the set of families 2. if A is the set of hash tables, and R is the "has the same entries as" relation, then A/Ris the set of functions with a finite d… Theorem 3.6: Let F be any partition of the set S. Define a relation on S by x R y iff there is a set in F which contains both x and y. Colleagues don't congratulate me or cheer me on, when I do good work? Given a set and an equivalence relation, in this case A and ~, you can partition A into sets called equivalence classes. Equivalence classes let us think of groups of related objects as objects in themselves. Let $A = \{0,1,2,3,4\}$ and define a relation $R$ on $A$ as follows: $$R = \{(0,0),(0,4),(1,1),(1,3),(2,2),(3,1),(3,3),(4,0),(4,4)\}.$$. How do you find the equivalence class of a relation? As an example, the rational numbers $\mathbb{Q}$ are defined such that $a/b=c/d$ if and only if $ad=bc$ and $bd\ne 0$. The equivalence class of an element a is denoted by [a]. Take a closer look at Example 6.3.1. Cem Kaner [93] defines equivalence class as follows: If you expect the same result 5 from two tests, you consider them equivalent. Making statements based on opinion; back them up with references or personal experience. a \sim b a \nsim c e \sim f. Thus the equivalence classes are such as {1/2, 2/4, 3/6, … } {2/3, 4/6, 6/9, … } A rational number is then an equivalence class. Newb Newb. Consider the relation on given by if. Why is 2 special? So you need to answer the question something like [(2,3)] = {(a,b): some criteria having to do with (2,3) that (a,b) must satisfy to be in the equivalence class}. | {
"domain": "981heritage.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877709445759,
"lm_q1q2_score": 0.8211459769333709,
"lm_q2_score": 0.8459424353665381,
"openwebmath_perplexity": 539.7190623407898,
"openwebmath_score": 0.5206097960472107,
"tags": null,
"url": "http://981heritage.com/where-does-gsj/how-to-find-equivalence-class-227e60"
} |
terminology
Title: How to vocalize hexadecimal numbers? When I want to vocalize a hexadecimal number like 0x41, so I say "forty one in hexadecimal", "four, one in hex" or what? Or do you always have to calculate and say "65 in hexadecimal notation"? I feel like that would complicate communication if I just want to tell someone what numbers I see on the paper in fornt of me, so he can write them down for example. The best way is to read out the digits and then say "hex(adecimal)". Don't say "forty-one hex" because "forty" means four times ten, whereas the four in 41h stands for four times sixteen. Don't say "sixty-five in hex" because then the person you're talking to doesn't know if you mean "The decimal number sixty-five, only written out in hex, i.e., four-one-hex" or "The number six-five-hex, i.e., one hundred and five decimal." | {
"domain": "cs.stackexchange",
"id": 3360,
"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": "terminology",
"url": null
} |
fluid-dynamics
We know the height of the fluid (and hence its pressure) at points $x_1$ and $x_2$, but we don't know the velocity of the fluid or its height at any other value for $x$. The top of the fluid is a free surface, i.e. it's determined by the properties of the flow rather than being specified as part of the problem. I've drawn it as slightly concave but I've no idea if that's right.
Let us assume that the velocity profile at $x_1$ is vertical (i.e. velocity does not vary with height above point $x_1$). Because the fluid is inviscid it seems to me that the constant vertical velocity profile should be maintained as the fluid travels to the right. So if we were to dye a vertical line of the fluid a particular colour, it would remain a vertical line as it travelled to the right, because the pressure differential across the line is constant with depth. If this is correct it means we can think of the velocity component in the $x$-direction, $v_x$, as a function of $x$ rather than $x$ and $y$.
Because the flow is incompressible we know that $h(x)v_x(x)$ must constant over space, and this is the value I want to solve for (although it might not have a unique value - in that case I just want to know the function $h(x)$). If we need to we can also assume we know the initial and final velocities, $v_x(x_1)=v_1$ and $v_x(x_2)=v_2$. | {
"domain": "physics.stackexchange",
"id": 2094,
"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",
"url": null
} |
nomenclature, coordination-compounds, oxidation-state
Title: Name the following coordination complex What are the IUPAC rules when naming a coordination complex like:
$$\ce{[Pt(NH3)4][Pt(NH3)Cl3]}$$
Now according to my textbook, it is named as tetraammineplatinum(II) amminetrichloridoplatinate(II). Both the $\ce{Pt}$ atoms have the oxidation state +2 .There are no charges assigned to the two complex ions in the formula, so, my assumption is that the entire complex is neutral and thus the oxidation states for $\ce{Pt}$ should be assigned accordingly. However, on assigning the oxidation states as mentioned in the answer the assumption is proven wrong. I'm confused about the mentioned oxidation numbers.
How do you calculate the oxidation numbers of the metal atoms in such a complex?
Shouldn't the charge on each complex ion be mentioned in the formula if the oxidation states given in the answer are correct? Your textbook contains an error. Either the formula is written incorrectly or the name is. Since according to comments the name is correct, it must be an incorrect formula. Let’s break it down:
If the formula is correct
We have two complex ions that together create a doubly-complex salt. According to the rules of (pseudo-) binary ionic compounds, one ion must be positively charged and the other negatively. By convention, the cation is written first so it is safe to assume that $\ce{[Pt(NH3)4]^{?}}$ be the cation — which fits in well with chemical intuition because $\ce{NH3}$ is a neutral ligand and platinum is a metal.
Therefore, $\ce{[Pt(NH3)Cl3]^{?}}$ must be the anion — very nice, because whe have chlorido ligands that are commonly negative. Since every chlorido ligand adds $-1$ charge to the complex, the anion can be anything from $-1$ to $-3$ with decreasing probability.
The complex needs to be a $1\,:\,1$ binary complex, so the negative charge needs to be equivalent to the positive charge. From here onwards it gets difficult. We have the following possibilities: | {
"domain": "chemistry.stackexchange",
"id": 4030,
"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": "nomenclature, coordination-compounds, oxidation-state",
"url": null
} |
homework-and-exercises, newtonian-mechanics, forces, string, rigid-body-dynamics
For completeness, here's the full solution. There are two tension forces in the string, one for the hanging part and one for the horizontal part, because the rope is not sliding along the pulley but turning it. The net torque (about the center of mass, with positive clockwise rotation sense) on the pulley is
$$
\tau_{\textrm{net}} = \tau_{\textrm{hor. rope}} + \tau_{\textrm{ver. rope}}
= T_{\textrm{hor}}R - T_{\textrm{ver}}R\,
$$
leading to the rotational form of the second law, given by
$$
I \alpha = \tau_{\textrm{net}} = T_{\textrm{hor}}R - T_{\textrm{ver}}R\,.
$$
For the hanging mass, Newton's 2nd law takes the form
$$
ma = T_{\textrm{ver}}-mg\,,
$$
with up being the positive direction. This is now two equations with four unknowns ($a$, $\alpha$, and the two tensions). There is a relationship between $a$ and $\alpha$ due to the rope not slipping along the cylinder, and the tension force $T_{\textrm{hor}}$ in the horizontal part of the rope is just $F_0$, using Newton's 3rd Law. | {
"domain": "physics.stackexchange",
"id": 95492,
"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, string, rigid-body-dynamics",
"url": null
} |
asteroids, hubble-telescope
Title: How close to Earth were the asteroids moving through this Hubble composite image? Recently Hubble saw several asteroids traveling erratically through a deep field perspective.
What region of the sky is this, and how near were these asteroids to the Earth?
The photo is composed of multiple shots and the asteroids have copies because of Hubble's movement through frames as the photo assemblage shifted.
Was Hubble viewing towards the plane of the solar system and the asteroid belt?
How did they explain that there were five in the same narrow frame?
https://astronomynow.com/2017/11/03/hubble-sees-nearby-asteroids-photobombing-distant-galaxies/ I visited the linked article in Astronomy Now and found the URL of the image contained the string STSCI-H-p1733a. STScI stands for Space Telescope Science Institute.
Searching that string leads to
http://hubblesite.org/images/news/release/2017-33 (four images)
http://hubblesite.org/news_release/news/2017-33
http://hubblesite.org/image/4080/gallery
the last two of which identify the location as Abell 370, at about RA: 2h 40m, Dec: -1.6°. At about RA = 0h the ecliptic and equator coincide, but by 2h 40m the ecliptic has a declination of about +16°, so this photo is looking about 18° below the ecliptic.
The first paragraph of the caption contained in both of those links says:
Like rude relatives who jump in front your vacation snapshots of landscapes, some of our solar system's asteroids have photobombed deep images of the universe taken by NASA's Hubble Space Telescope. These asteroids reside, on average, only about 160 million miles from Earth — right around the corner in astronomical terms. Yet they've horned their way into this picture of thousands of galaxies scattered across space and time at inconceivably farther distances. | {
"domain": "astronomy.stackexchange",
"id": 2629,
"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": "asteroids, hubble-telescope",
"url": null
} |
And whatever system is used, complete formal proofs tend to be extremely lengthy. One almost always takes shortcuts. But you have a habit of questioning all possible shortcuts.
Last edited: Nov 10, 2012 | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446463891304,
"lm_q1q2_score": 0.8176024839677362,
"lm_q2_score": 0.8397339696776499,
"openwebmath_perplexity": 812.9211545950267,
"openwebmath_score": 0.7984180450439453,
"tags": null,
"url": "https://www.physicsforums.com/threads/two-empty-sets.649976/"
} |
ros, namespace, rosservice
Title: What is the proper approach to create a dynamic *number* of subscribers/services?
I have n number of robots, and I want to gather each of their positions. Each robot is under a different namespace so I have the topics:
/robot1/pose
/robot2/pose
/robotn/pose
If the namespace follows the same convention, is it better to:
Create a subscriber for each robot?
Create a service-client for each robot?
And given a subscriber or service, what is the proper way to dynamically find the services/topics to subscribe to?
Thoughts:
Use the parameter server with the number of robots. Works for both subscribers and services. Use the same callback for each robot.
Have each robot republish their pose onto a joint /pose_all topic and use one subscriber. Can differentiate between robots using PoseStamped. Simplest seeming solution (no parameters to remember to update...), but is it hacky?
Some better method using service calls?
Originally posted by curranw on ROS Answers with karma: 211 on 2016-07-06
Post score: 0
See if my answer to a similar question is helpful as an alternative. Upon re-reading my answer, I realize I wasn't as clear as I could have been; apologies in advance.
Perhaps you're aware of this already, but a note/warning: be careful with service calls. They block, and may cause a performance hit, especially if you have a proliferating number them (as you seem to be suggesting).
Originally posted by kramer with karma: 1470 on 2016-07-07
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 25165,
"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, namespace, rosservice",
"url": null
} |
• Impressively elegant, zyx: +1 Jul 24 '13 at 8:12
• just a comment: $r$ is sent to $r - a$ since $r^p -r +a =0$
– Ivan
Feb 8 '21 at 19:55
Greg Martin and zyx have given you IMHO very good answers, but they rely on a few basic facts from Galois theory and/or group actions. Here is a more elementary but also a longer approach.
Because we are in a field with $p$ elements, we know that $p$ is the characteristic of our field. Hence, the polynomial $g(x)=x^p-x$ has the property $$g(x_1+x_2)=g(x_1)+g(x_2)$$ whenever $x_1$ and $x_2$ are two elements of an extension field of $\mathbb{F}_p$. By little Fermat we know that $g(k)=k^p-k=0$ for all $k\in \Bbb{F}_p$. Therefore, if $r$ is one of the roots of $f(x)=x^p-x+a$, then $$f(r+k)=g(r+k)+a=g(r)+g(k)+a=f(r)+g(k)=0,$$ so all the elements $r+k$ with $k \in \Bbb{F}_p$ are roots of $f(x)$, and as there are $p$ of them, they must be all the roots. It sounds like you have already shown that $r$ cannot be an element of $\Bbb{F}_p$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517443658749,
"lm_q1q2_score": 0.8085669164544198,
"lm_q2_score": 0.8267117983401363,
"openwebmath_perplexity": 102.31882911541936,
"openwebmath_score": 0.9561370015144348,
"tags": null,
"url": "https://math.stackexchange.com/questions/81583/how-do-i-prove-that-xp-xa-is-irreducible-in-a-field-with-p-elements-when"
} |
lambda-calculus, linear-equations, fixed-points
As commented, this program first defines some numerals in Church encoding, some arithmetic operators on these numerals as well as Y and Z combinators. Then it tries to find a solution to the arithmetic equation x = 2 - x using functional programming. The way it tries to solve this problem is to define F(x) = 2 - x (in Church encoding) then use a combinator to compute its fixed point. If the combinator is clever, it may return one which is a solution. But after running this program, both Y and Z combinators enter an infinite loop (marked as err). So this method doesn't seem to work.
My questions are:
What is a high-level description of the reason why this method fails?
Are there other fixed-point combinators that can solve this equation?
Y and Z combinators work with G but not F. So we know they work with some, but not all functions. How do we characterize the class of functions that work with these combinators?
Edit. work means the combinator terminates on the input and returns a meaningful result. | {
"domain": "cstheory.stackexchange",
"id": 5497,
"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": "lambda-calculus, linear-equations, fixed-points",
"url": null
} |
hilbert-space, operators, mathematical-physics, eigenvalue
My attempt:
Let's suppose that there exists an eigenvalue $\mu \in \sigma(f(T)) \setminus f(\sigma(T))$.
Let it be $|\mu\rangle$ an eigenvector of $f(T)$ associated to $\mu$, namely $f(T)|\mu\rangle=\mu|\mu\rangle$.
So we have that $\langle \lambda_n,d_n \mid \mu \rangle=0$ for every $n,d_n$, being $f(T)$ self-adjoint (then eigenvectors corresponding to different eigenvalues are orthogonal).
So we have that $|\mu\rangle=0$ ($\{|\lambda_n,d_n\rangle\}$ is a Hilbert basis), and this is a contradiction.
Then we have that $f(\sigma(T))=\sigma(f(T))$.
Is my approach correct? Thank you in advance.
is it true in general that (())=(())? | {
"domain": "physics.stackexchange",
"id": 92120,
"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": "hilbert-space, operators, mathematical-physics, eigenvalue",
"url": null
} |
A box contain an unlimited number of balls (mixed) of five different colors. How many ways can a handful of one or more balls be randomly selected
I have a question: A box contain an unlimited number of balls (mixed) of five different colors. How many ways can a handful of one or more balls be randomly selected that has at least one ball and at most 12 balls in total?
I know that every handful is some combination with repetition, however as there is an unlimited number of balls is where I get the confusion.
• You could add up the number of possible colour combinations for 1 through to 12 balls. Or you could find a shortcut and pretend there is a sixth invisible colour (remembering that they cannot all be invisible). This is a combinatorial question, not a probability or statistics question Aug 4, 2021 at 0:33
• Since you can take at most 12 balls, you can take at most 12 balls of any one color. Just treat this as though the box contained exactly 12 balls of each color. Aug 4, 2021 at 0:34
Adding onto Karl's answer, we want to find the number of nonnegative integer solutions to $$x_1+x_2+x_3+x_4+x_5\leq 12$$ To determine this, we will first add a temporary variable, $$c$$, that is a nonnegative integer. We can use this variable to now have the statement $$x_1+x_2+x_3+x_4+x_5+c=12$$ Convince yourself that the number of nonnegative integer solutions to this equation is the same as the number of solutions to the first inequality.
Using stars and bars, we have that the number of nonnegative integer solutions to $$\sum_{i=1}^k a_i=n$$ is $$\binom{n+k-1}{k-1}$$.
We can apply this theorem to see that the number of ways to grab the colored balls is $$\binom{12+6-1}{6-1}=\binom{17}{5}=6188$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9802808759252645,
"lm_q1q2_score": 0.8351530371180685,
"lm_q2_score": 0.8519528000888387,
"openwebmath_perplexity": 184.99852387921737,
"openwebmath_score": 0.8280768990516663,
"tags": null,
"url": "https://math.stackexchange.com/questions/4216200/a-box-contain-an-unlimited-number-of-balls-mixed-of-five-different-colors-how"
} |
quantum-mechanics, photoelectric-effect
Title: Doubt regarding work function and photoelectric current The cathode of a photoelectric cell is changed such that work function changes from W1 to W2.(W2>W1)
If photoelectric current before and after the change are I1 and I2 respectively, then I1 < or = or > I2?. (Given hf>W2) The photoelectric effect has the work function as a limit on the frequency of the light . Here is a table on the work function of various metals. You see that the differences are not very large . Photons have to have at least the energy in the table , ( E=h*nu, nu the frequency)
The effect of changing the lower limit of the frequency that can be accepted to excite a photoelectron depends on the incident light spectrum. It may have no effect on the current , or a small effect from the edge of the spectrum not having enough energy to excite as many photoelectrons as some other material.
In your question, if W2 is larger than W1 then I2 may be a bit smaller than W1 as part of the spectrum will not excite any photoelectrons. | {
"domain": "physics.stackexchange",
"id": 35456,
"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, photoelectric-effect",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.