text stringlengths 1 1.11k | source dict |
|---|---|
homework-and-exercises, electrons, charge, potential-energy, classical-electrodynamics
EDIT: The original problem was written in a confusing way. Thanks to the help of @user7777777 I was able to interpret it the right way and fix the wording. You are absolutely correct for Questions 1 and 2. For Question 3, we can use the result from Question 2, but replacing $\frac{1}{2} m {v_1}^2$ with $2 (\frac{1}{2} m {v_1}^2)$, and comparing the two results in terms of $b$. | {
"domain": "physics.stackexchange",
"id": 52007,
"lm_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, electrons, charge, potential-energy, classical-electrodynamics",
"url": null
} |
matlab, sampling, aliasing
Then you could plot with
plot(t, x_a(t), '-', n/fs, x_a(n/fs), 'o');
since you are ploting x, x_a(x) there is nothing that could go wrong in the sampling, the time values you pass will be replaced automatically in your expression.
If you want the expression you can use symbolic computation, however when I need to do so I use wxmaxima or sympy | {
"domain": "dsp.stackexchange",
"id": 9946,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, sampling, aliasing",
"url": null
} |
special-relativity, vectors, metric-tensor, complex-numbers
Title: Quaternions and 4-vectors I recently realised that quaternions could be used to write intervals or norms of vectors in special relativity:
$$(t,ix,jy,kz)^2 = t^2 + (ix)^2 + (jy)^2 + (kz)^2 = t^2 - x^2 - y^2 - z^2$$ | {
"domain": "physics.stackexchange",
"id": 52167,
"lm_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, vectors, metric-tensor, complex-numbers",
"url": null
} |
organic-chemistry, nomenclature, hydrocarbons
Title: How should I name this branched alkyl substituent? The parent chain is a decane (in black), but for the alkyl substituent (in red) I'm trying to decide between:
5-(1,2-dimethylpropyl)decane
5-(2-methylbutan-3-yl)decane
5-(3-methylbutan-2-yl)decane
Which of these is correct? According to Section P-46 in the current version of Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book), compound acyclic substituents consisting of a principal chain and one or more acyclic substituents can be named in two ways:
by using alkyl substituents according to method (1) of Subsection P-29.2 | {
"domain": "chemistry.stackexchange",
"id": 5368,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature, hydrocarbons",
"url": null
} |
ds.algorithms, np-hardness, tree, optimization, application-of-theory
Title: Bob's Sale (reordering of pairs with constraints to minimize sum of products) I've asked this question on Stack Overflow a while ago: Problem: Bob's sale. Someone suggested posting the question here as well.
Someone has already asked a question related to this problem here - Minimum weight subforest of given cardinality - but as far as I understand it doesn't help me with my problem. The highest-rated answer on StackOverflow is also worth looking at.
Here's the verbatim copy of my StackOverflow question. It's probably inadequately formulated for this site (heck, I feel inadequately uneducated just asking it here), so feel free to edit it: | {
"domain": "cstheory.stackexchange",
"id": 662,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ds.algorithms, np-hardness, tree, optimization, application-of-theory",
"url": null
} |
The general real-valued solution is x = C1 (-2e−t sin(2t) e−t cos(2t) ) + C2 (2e−t cos(2t) e−t sin(2t) ) .
Which is the correct definition of the convolution function?
The term convolution refers to both the result function and to the process of computing it. It is defined as the integral of the product of the two functions after one is reversed and shifted. The integral is evaluated for all values of shift, producing the convolution function.
### Which is the inverse of the convolution operation?
Computing the inverse of the convolution operation is known as deconvolution . The convolution of f and g is written f∗g, denoting the operator with the symbol ∗. It is defined as the integral of the product of the two functions after one is reversed and shifted. As such, it is a particular kind of integral transform :
### Can a discrete convolution be defined on a circle? | {
"domain": "mulloverthing.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9814534316905262,
"lm_q1q2_score": 0.82824374246237,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 403.5159072164426,
"openwebmath_score": 0.8928713202476501,
"tags": null,
"url": "https://mulloverthing.com/what-is-meant-by-real-valued-function/"
} |
special-relativity, particle-physics, kinematics, inertial-frames
Title: Transformation of the Lorentz factor when a relativistic particle partially absorbs energy from a photon? I came across this paper (on arXiv) that says when a particle with high Lorentz factor $\Gamma$ meets a radiation beam and absorbs some energy $\epsilon$, it's Lorentz factor transforms like so (Eq. (1) of the text):
$$\Gamma_1 \approx \frac{\Gamma}{\sqrt{1 + 4\Gamma^2\epsilon/mc^2}}\tag{1}$$
Even though the author states it's "immediate" from energy-momentum conservation and proceeds to give a physical description of what this means for the interaction, it's not at all obvious to me how to derive such a result, nor what kind of approximations went into deriving it.
Could someone help me derive it please? Answers with detailed steps are appreciated. TIA. | {
"domain": "physics.stackexchange",
"id": 85714,
"lm_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, particle-physics, kinematics, inertial-frames",
"url": null
} |
dark-matter, dark-energy
Title: What are dark matter and dark energy? I've recently read about dark matter and dark energy. But unfortunately, there were not enough answers for me. The article I read was more of a hypothesis than a real answer. So I'm asking for all the information that you have and all the things you know about dark matter and dark energy. For example: | {
"domain": "astronomy.stackexchange",
"id": 693,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dark-matter, dark-energy",
"url": null
} |
organic-chemistry, analytical-chemistry, photochemistry
Title: Why is absorbance spectrum continuous and not quantized? 1) In text books, the absorption event is usually described by a figure shown below1: light excites electrons to higher states in atom or molecule. The difference between the ground state and the excited one matches the energy of the absorbed light. But electron states in atoms and molecules should be quantized, so why do we observe absorbance spectra that are smooth and continuous but not spiked and quantized? | {
"domain": "chemistry.stackexchange",
"id": 6716,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, analytical-chemistry, photochemistry",
"url": null
} |
electromagnetism, classical-mechanics, magnetic-fields, electric-fields
$
\begin{align}
\frac{2V}{B^2 r^2} &= \frac{E}{B^{2} r}\\
E &= \frac{2V}{r} = \frac{V}{d}\\
\therefore d \stackrel{?}{=} \frac{r}{2} \tag{1}
\end{align}
$
However, I'm unsure if this last equation (1) is actually true, and if so how can it be proven. You have two different situations here. The electric field is used in different ways in the two situations. Each formula is OK for the specific situation.
In the first case you accelerate the particle in the electric field so the velocity depends only on the electric field (or potential difference).
In the second case you select a specific velocity with cross fields. The velocity you select depends on both E and B values. | {
"domain": "physics.stackexchange",
"id": 86583,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, classical-mechanics, magnetic-fields, electric-fields",
"url": null
} |
4) Stronium-90 loses 2.5% of its mass each year. What is its half life? Estimate the rate at which he mass is decreasing after 5 years.
Now I'm not sure how to solve this one because I feel like its missing some values and I don't know how to work with the formulas then.
2. ## Re: Solving Exponential Functions/Applications
Hey misiaizeska.
Hint Problem 1: Try and factor out the 3^x term and get a quadratic. For problem 3^(2x) -5(3^[x])=-6 use a substitution y = 3^x and you obtain y^2 - 5y + 6 = 0 and you can use the
quadratic equation to find a solution.
Hint Problem 2: Consider differentiating the function with respect to time.
Hint Problem 3: You used the sum of a geometric series and in R I got the following output:
> 2300*(1+0.0035)^10
[1] 2381.78 | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9871787879966233,
"lm_q1q2_score": 0.80008758449848,
"lm_q2_score": 0.8104789063814617,
"openwebmath_perplexity": 452.9015280885927,
"openwebmath_score": 0.8510716557502747,
"tags": null,
"url": "http://mathhelpforum.com/algebra/208250-solving-exponential-functions-applications.html"
} |
But I'm having some struggle in understanding this $\mathbb{N}\times\mathbb{N}$.
I'll be grateful for any help.
Thank you.
• Its just the set of natural numbers – Archis Welankar Apr 7 '17 at 13:06
• Might be good to specify that (apparently) you intend $0\notin \mathbb N$, or else everything would be related to $(0,0)$. In that case, the equivalence classes are just a copy of the positive rational numbers ($(a,b)=\frac{a}{b}$) – rschwieb Apr 7 '17 at 13:16
• @rschwieb Good point. If we consider $0 \in \mathbb{N}$, then the relation can still work on $\mathbb{N} \times( \mathbb{N} \setminus \{0\})$ though. – benguin Apr 7 '17 at 13:20
• @benguin and then the set of classes is the canonical construction of the rational numbers. – lhf Apr 7 '17 at 13:24
• @benguin Equally effective, although necessitating change in notation :) – rschwieb Apr 7 '17 at 13:25 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9825575183283514,
"lm_q1q2_score": 0.8250869193911928,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 229.05687972775806,
"openwebmath_score": 0.875322163105011,
"tags": null,
"url": "https://math.stackexchange.com/questions/2222337/equivalence-relation"
} |
quantum-mechanics, special-relativity, speed-of-light
The interesting result of this question and line of inquiry is the realization that for the one-way speed of light to differ in different directions would require the equations governing light (the Maxwell equations) to be different than the ones we usually assume. | {
"domain": "physics.stackexchange",
"id": 81879,
"lm_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, special-relativity, speed-of-light",
"url": null
} |
graph-theory, graph-isomorphism
This graph is a bit too large to check an explicit mapping. But we can easily fix this by removing the paths at the bottom of each graph, keeping only the pink and green points. Here’s the resulting link graphs, with labels as a visual aid. (Most of the labels match with their color names, except for blue). Again, note that we could replace each other by vertex degree without changing the main results. | {
"domain": "cstheory.stackexchange",
"id": 5794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "graph-theory, graph-isomorphism",
"url": null
} |
### Poincare Section¶
Simply choose points for output of numerical integration (in the 'linspace()' function) that are integer multiples of the drive period:
$$t_n = n\ \frac{2\pi}{\omega_d}.$$
In [10]:
th0 = 0.1 # Initial theta
om0 = 0 # Initial angular velocity
u0 = sp.array([th0,om0])# Combine initial conditions in array
b = 0.5 # Damping parameter
g = 1.15 # Driving amplitude
om_d = 2./3 # Driving frequency
t_d = 2*sp.pi/om_d
t = sp.linspace(0,1000*t_d, 1001) # NOTE: The points selected
# for plotting are not the
# points used for the numerical evalution.
th, om = sp.integrate.odeint(eqs,u0,t,args=(b,g,om_d)).T
In [11]:
plt.figure(5)
plt.xlabel("$\\theta$")
plt.ylabel("$\omega$")
plt.title("Poincare section",fontsize=14)
plt.scatter(th%(2*sp.pi),om,s=0.1);
### Version Information¶ | {
"domain": "bucknell.edu",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9773707999669627,
"lm_q1q2_score": 0.8227758004691692,
"lm_q2_score": 0.8418256412990657,
"openwebmath_perplexity": 7279.597287968548,
"openwebmath_score": 0.6641075611114502,
"tags": null,
"url": "http://www.eg.bucknell.edu/~phys310/jupyter/chaotic_pendulum.html"
} |
asymptotics
$$
\log \log x, \frac{1}{x\log x}, -\frac{\log x + 1}{x^2\log^2 x}, \frac{2\log^2 x + 3\log x + 2}{x^3\log^3 x}.
$$
The third derivative has constant sign (for $x$ larger than some constant), and so when $s=1$, the growth rate of the remainder term can be bounded by the second derivative evaluated at $n$, which is $o(1)$. So it suffices to choose $s=1$. We obtain
$$
\begin{align*}
S(n) &= \int_2^n \log\log x \, dx + \frac{\log\log 2 + \log\log n}{2} + \frac{\frac{1}{n\log n} - \frac{1}{2\log 2}}{12} + o(1) \\ &=
x\log\log x - Ei(\log x) \bigr|_2^n + \frac{\log \log n}{2} + O(1) \\ &=
n\log\log n - Ei(\log n) + \frac{\log \log n}{2} + O(1),
\end{align*}
$$
where $Ei(x)$ is the exponential integral. The exponential integral doesn't really reduce to any known function, but it is known that $E_i(x) = (e^x/x)(1 + O(1/x))$. Therefore
$$
S(n) = n\log\log n - \frac{n}{\log n} + O\left(\frac{n}{\log^2 n}\right).
$$ | {
"domain": "cs.stackexchange",
"id": 8703,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "asymptotics",
"url": null
} |
c++, template, c++17, variadic
TEST(Variadic_templatesTest, SetElement) {
std::string id{ "ID123" };
EnableValve enableValve{ "TRUE" };
Variadic_datablock<EnableValve> t{
id,
enableValve,
};
EXPECT_EQ(t.get_element<EnableValve>().m, enableValve.m);
enableValve.m = "FALSE";
t.set_element(enableValve);
EXPECT_EQ(t.get_element<EnableValve>().m, enableValve.m);
}
TEST(Variadic_templatesTest, TestIOstream) {
std::string input = {
R"( ID123.EnableValve := FALSE;
ID123.Position1 := 0;
ID123.Position2 := 2;
ID123.Position3 := 9;
)"
};
std::istringstream ist{ input };
Variadic_datablock<EnableValve, Position1, Position2, Position3> t;
ist >> t;
EXPECT_EQ(t.get_id(), "ID123");
EXPECT_EQ(t.get_element<EnableValve>().m, "FALSE");
EXPECT_EQ(t.get_element<Position1>().m, "0");
EXPECT_EQ(t.get_element<Position2>().m, "2");
EXPECT_EQ(t.get_element<Position3>().m, "9");
std::ostringstream ost;
ost << t; | {
"domain": "codereview.stackexchange",
"id": 33467,
"lm_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++, template, c++17, variadic",
"url": null
} |
the-sun, hydrogen, elemental-abundances, helium
I have never used stellar elemental abundances in this way, so I want to check a few things.
First of all, is the logarithm used by this paper log$_{10}$ or log$_e$ (often written ln)? My guess is log$_e$ because of what follows.
Let's say I want to calculate the elemental abundance of He relative to H. I believe the correct math would be to do the following
$$\frac{\textrm{N}_{He}}{\textrm{N}_H} = \textrm{exp}(\textrm{A}_{He} - 12.0)$$
Is this the correct way to calculate the relative abundances? This equation gives a value of 0.343 for the helium abundance relative to hydrogen, which seems to be the correct value for the sun (the sun is usually quotes as being about 70% H and about 25% He, which gives a relative abundance of 0.357). This correct value is what leads me to believe that the log is log$_e$. First of all, your first question.
This source clearly state that Values are given in the usual logarithmic (dex) scale, for the same formula that you quoted (similar job). | {
"domain": "astronomy.stackexchange",
"id": 569,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "the-sun, hydrogen, elemental-abundances, helium",
"url": null
} |
positional-astronomy, the-moon
Title: Is this a real picture of the moon? I found this picture and I am really wondering if it is possible for the moon to get as close to the earth as this picture shows?
( Super moon above Rio De Janeiro) I don't know whether this picture is a fake, but you could get this sort of image without cheating, if it were taken a long way away from Rio, and the magnification cranked up. In other words, get far enough away from Rio that its angular diameter is about 1 minute, and take the picture from there. | {
"domain": "astronomy.stackexchange",
"id": 3570,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "positional-astronomy, the-moon",
"url": null
} |
correctness-proof, loop-invariants, hoare-logic, software-verification
In this way, you should be able to check all of your invariants step-by-step. The only two things you need to know how to do are: (1) check whether one logical formula implies another, and (2) verify invariants for straight-line code. Everything else reduces to those operations.
With practice, you'll find that this becomes pretty mechanical. And with practice, you'll find that many of these invariants can be omitted (if it's straightforward for a reader to re-derive them), but when you start out, it's best to be verbose and include them all, without trying to omit stuff. | {
"domain": "cs.stackexchange",
"id": 5683,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "correctness-proof, loop-invariants, hoare-logic, software-verification",
"url": null
} |
ros2, c++, colcon, service, ros-crystal
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
And the CMakeLists.txt accordingly:
cmake_minimum_required(VERSION 3.5)
project(test)
#Load required packages
find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(rcutils REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
#Build Messages/Services 1
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"srv/TestService.srv"
)
#Define the search space for the headers
include_directories(include)
#Build project library
add_library(${PROJECT_NAME}_lib SHARED src/lib.cpp)
ament_target_dependencies(${PROJECT_NAME}_lib rclcpp std_msgs rcutils class_loader)
rosidl_target_interfaces(${PROJECT_NAME}_lib ${PROJECT_NAME} "rosidl_typesupport_cpp") #Install srv hpp
install(TARGETS
${PROJECT_NAME}_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin) | {
"domain": "robotics.stackexchange",
"id": 32879,
"lm_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, c++, colcon, service, ros-crystal",
"url": null
} |
observational-astronomy, amateur-observing, light-curve, time-domain-astronomy, nova
How long do I have to see the Recurrent Nova RS Ophiuchi before it fades substantially?
If I miss it this time, how long do I have to wait for it to "recur"? RS Ophiuchi is "Currently" Shining at a apparent magnitude of 5.12 (initially 4.6.) . It is fading at a rate of 0.01 and continues this progress for the next 43-47 days. Then it will fade at a rate of 0.02 and reaches its pre-burst luminosity with apparent magnitude of 10 to 12. Usually binoculars (take 8x42) will be able to spot this with magnitude less than 6.7 (with respect to class 3 light pollution at 24 degree Celsius and low air pollution {Rural-scale}). So You have roughly 56 days left to see it clearly, in best case scenario, Sooner you catch it, bigger the quality of the image. Recurrence of RS Ophiuchi's nova averages at 10-15 years (min - 7, max - 33). | {
"domain": "astronomy.stackexchange",
"id": 5769,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, amateur-observing, light-curve, time-domain-astronomy, nova",
"url": null
} |
DEFINITION. Meaning of Transpose. All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. See more. Synonyms: tr. transpose: To reverse or transfer the order or place of; interchange. Solution: It is an order of 2*3. Transpose definition, to change the relative position, order, or sequence of; cause to change places; interchange: to transpose the third and fourth letters of a word. The number $$4$$ was in the first row and the second column and it ended up in the second row and first column. A new matrix is obtained the following way: each [i, j] element of the new matrix gets the value of the [j, i] element of the original one. So if X is a 3x2 matrix, X' will be a 2x3 matrix. We said that our matrix C is equal to the matrix product A and B. Do the transpose of matrix. transpose (plural transposes) (adjective, linear algebra) The resulting matrix, derived from performing a transpose operation on | {
"domain": "ikiwago.info",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9658995752693051,
"lm_q1q2_score": 0.8459222754304697,
"lm_q2_score": 0.8757869835428965,
"openwebmath_perplexity": 681.1274730658739,
"openwebmath_score": 0.6436394453048706,
"tags": null,
"url": "http://forum.ikiwago.info/87616fru/5om3q4q.php?1c5f9e=transpose-matrix-definition"
} |
c++, c++11, ai
Title: Follow-up: C++ 'evolutionary AI' implementation Based on the advice provided in my previous question, I would like to post the other source file that actually implements all the combat mechanics and also the actual evolution process.
As with the previous question, I am interested in all kinds of feedback — regarding design, implementation, algorithms, presentation, style, cleanliness, correct C++11 usage, or anything that you think that could make this work better as an impressive code sample submitted to support a job application.
The entire code as well as the rules can be seen at http://www.mz1net.com/code-sample — that is also where the 'MechArena.h' that declares the classes and describes them a little better is available.
#include <algorithm>
#include <exception>
#include "MechArena.h"
// COMPONENT SET ========================================================================
// ====================================================================================== | {
"domain": "codereview.stackexchange",
"id": 5643,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, c++11, ai",
"url": null
} |
be able to write out all the steps by hand, and count the number of times you compared two elements. • Number of data moves: copy/swap the DATA RECORDS • Later on: non-comparison sorting 6. Perform an insertion sort on the array 4. Also try practice problems to test & improve your skill level. In that case, the number of comparisons will be n - 1 = 8 - 1 = 7. This sort works on the principle of inserting an. Sorting is an important category of computing, as having sorted data to work with can simplify problems. Insertion Swaps Counting Number Of. One note about shifting versus exchanging is also important. the first approach that is brute force approach gives the O (n^2) complexity. I need to count the number of comparisons for an insertion sort I've figured out how to sort the array correctly but I can't get it to count the number of comparisons correctly. In addition for all the algorithms the number of comparisons and number of swaps was obtained fully sorted lists as. Evaluating | {
"domain": "recht-sozial-in-muenchen.de",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.96036116089903,
"lm_q1q2_score": 0.820064646301533,
"lm_q2_score": 0.8539127566694178,
"openwebmath_perplexity": 638.2732590261587,
"openwebmath_score": 0.31739869713783264,
"tags": null,
"url": "https://recht-sozial-in-muenchen.de/count-number-of-swaps-and-comparisons-in-insertion-sort.html"
} |
python, beginner, dynamic-programming, change-making-problem, knapsack-problem
In the example above, we know that the solution has to include at least 3×1, 2×2 and 1×5, so we start by subtracting 12 from the amount, getting 8.
Now, whenever we add a coin of some denomination to the solution we're building up, we have to add coins of all smaller denominations too, to maintain the restriction that number of coins of a small denomination must be greater than the number of coins of a large denomination. So if we add a coin of denomination 2, then we have to add a coin of denomination 1 too. And if we add a 5, we have to add 2 and 1 too. | {
"domain": "codereview.stackexchange",
"id": 21508,
"lm_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, dynamic-programming, change-making-problem, knapsack-problem",
"url": null
} |
measurements, geophysics, geomagnetism
I'm particularly surprised at the existence of "modelled" data, showing a lot of detail, about the NMP's location for centuries before anyone went there. Neither that Wikipedia article nor this one on the Earth's magnetic field, which include the image, mention where the modelled data come from.
I get the impression from sources like this that the model is derived from historical measurements of magnetic declination. If that is the case I would be disinclined to trust the model much: the Earth's magnetic field has a complex enough structure that the magnetic north and south are not antipodal, with nontrivial spatial variations in magnetic declination at any given time.
Has anyone seen references that explain this model and what measurements they are based on? Here is the home page for the GUFM model website. It also includes a link to a freely available pdf of the modern reference. Also of interest is the NOAA WEBSITE.
GUFM MODEL HOMEPAGE
NOAA PAGE | {
"domain": "physics.stackexchange",
"id": 7686,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "measurements, geophysics, geomagnetism",
"url": null
} |
Remark: This is called Heron's or the Babylonian method.
• Hi, this is all really interesting and already more is starting to make sense, I had to chuckle at Hagen von Eitzen comment "From the ridiculously bad a=1" I am sorry I left school at 14 because I couldn't grasp any of the work. Thanks I am going to need some more understanding of algebra etc before I full y get this and I am sure I will. I will keep referring back to this to aid my learning. Perhaps i should stick to learning the layers of the pyramid in the correct order before trying to jump up levels. Its hard teaching yourself. Thanks again. – Maths Fail Jul 9 '14 at 22:38 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357195106375,
"lm_q1q2_score": 0.8264503114028827,
"lm_q2_score": 0.8418256512199033,
"openwebmath_perplexity": 294.60638415794153,
"openwebmath_score": 0.7540609240531921,
"tags": null,
"url": "https://math.stackexchange.com/questions/861509/what-is-the-sum-that-the-square-root-button-on-calculator-does-so-i-can-do-it-wi"
} |
ros, can, ros-canopen
Comment by Mathias Lüdtke on 2016-12-30:
Looks like your PDO mapping was not applied correctly.
Please fix doubled object in https://github.com/Linkeway/BIRL_modular_robot/blob/master/birl_module_canopen/config/manipulator5d_motors.yaml#L28
And all other doubled configs.
Comment by Mathias Lüdtke on 2016-12-30:
In addition your DCF is wrong: https://github.com/Linkeway/BIRL_modular_robot/blob/master/birl_module_canopen/config/birl_copley.dcf#L31
It even misses the 140x entries.
Please use CANeds
And: using the Schunk DCF as a template might be error prone, too!
Comment by Craig on 2016-12-31:
You are right. I used the Schunk DCF because the Copley eds was faulty. I use a modified Copley eds now, and initialization produces:
[ERROR]:canopen_master/src/pdo.cpp(372): Throw in function void canopen::PDOMapper::Buffer::write(const canopen::ObjectDict::Entry&, const canopen::String&) | {
"domain": "robotics.stackexchange",
"id": 26603,
"lm_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, can, ros-canopen",
"url": null
} |
big-o-notation
Title: Help understanding the proof of the definition of Big-Theta based on limits I was reading Kleinberg's and Tardo's book (especifically, this one) and, on page 38, these authors define the Big-Theta notation the following way:
Let $f$ and $g$ be two functions that $\lim_{n\to\infty}f(n)/g(n)$ exists and is equal to some number $c>0$. Then $f=\Theta(g)$.
Then, they provide a proof that connects the classic defition based on sets of functions to this definition based on the limit of the ratio of two functions. This proof goes as: | {
"domain": "cs.stackexchange",
"id": 20686,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "big-o-notation",
"url": null
} |
diffraction, wavelength, quantum-tunneling, microscopy
This same principle of breaking the resolution limit is used in near-field scanning optical microscopy, which operates on photons instead of electrons. | {
"domain": "physics.stackexchange",
"id": 86612,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "diffraction, wavelength, quantum-tunneling, microscopy",
"url": null
} |
dna, homework, dna-sequencing, pcr, primer
Title: Which pair of primers should be used to amplify the ORF in PCR? So I want to choose the correct set of pair of primers to amplify the ORF of the gene that corresponds to amino acids in a protein. The start and stop codons are underlined. (I know that these need to be synthesised by the primer also for correct PCR technique) | {
"domain": "biology.stackexchange",
"id": 4165,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dna, homework, dna-sequencing, pcr, primer",
"url": null
} |
stellar-evolution, white-dwarf
Title: How long does it take for a white dwarf to cool to a black dwarf? I was reading on white dwarfs, and I came across this sentence—
Without energy sources, the white dwarf cools to a black dwarf in a few billion years.[1]
However, when I looked into the Wikipedia page on White dwarf, it says
Because the length of time it takes for a white dwarf to reach this state is calculated to be longer than the current age of the universe (approximately 13.8 billion years), it is thought that no black dwarfs yet exist.
So which is true?
And what is the proper definition of a black dwarf? | {
"domain": "astronomy.stackexchange",
"id": 3384,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "stellar-evolution, white-dwarf",
"url": null
} |
computational-chemistry, density-functional-theory, dispersion-correction
Title: Can density functional approximations including dispersion correction perform worse than without it? I am trying correlate some experimental properties of a molecule to its calculated equilibrium geometry. To do so, I calculated the geometry and energy of some conformers.
Now, I obtain mixed results when performing the same energetic calculation with dispersion-corrected (D3) and not corrected functional (B3LYP): when no correction is applied, a conformer has lower energy, while with D3 correction another conformer has lower energy.
The idea of using D3 looked reasonable, as the molecule has two aromatic and two aliphatic wings, which from the D3-uncorrected geometry seemed to promote to some degree an aliphatic-aromatic stacking interaction. | {
"domain": "chemistry.stackexchange",
"id": 13271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computational-chemistry, density-functional-theory, dispersion-correction",
"url": null
} |
kinematics, acceleration, vectors, differentiation, mathematics
$$
a = \frac{dv}{dt} = \frac{dv}{dx} \frac{dx}{dt} = \frac{dv}{dx} v.
$$
If you're doing 2-D or 3-D motion, you can still do something similar, but you have to let $\vec{v}$ be a function of $x$, $y$, and $z$, since $\vec{v}$ can change as each of these quantities changes. This means that you need to use multi-variable calculus to write out an equivalent statement. For example, we have
$$
a_x = \frac{dv_x}{dt} = \frac{\partial v_x}{\partial x} \frac{dx}{dt} + \frac{\partial v_x}{\partial y} \frac{dy}{dt} + \frac{\partial v_x}{\partial z} \frac{dz}{dt} \\= \frac{\partial v_x}{\partial x} v_x + \frac{\partial v_x}{\partial y} v_y + \frac{\partial v_x}{\partial z} v_z.
$$
As you can see, we're never "dividing by" the entire vector $\vec{x}$ when we take these derivatives; we only ever "divide by" its components $x$, $y$, or $z$, which is a valid mathematical operation. | {
"domain": "physics.stackexchange",
"id": 55357,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinematics, acceleration, vectors, differentiation, mathematics",
"url": null
} |
r
| Zach | DR | Phone |
| Ron | DR | Phone |
| Michael | TL | Store |
| Michael | DR | Store |
| Ron | DR | Store |
| Sean | TL | Email |
| Sean | DR | Email |
| Ron | DR | Email |
| Ben | DR | Email |
| Evan | TL | Repair |
| Evan | DR | Repair |
| Tim | DR | Repair |
| Jim | DR | Repair |
+---------+------+----------+ | {
"domain": "codereview.stackexchange",
"id": 32530,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "r",
"url": null
} |
gazebo, exploration, turtlebot, explore, package
<!-- Fake Laser (narrow one, for localization -->
<node pkg="nodelet" type="nodelet" name="kinect_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
<param name="output_frame_id" value="/camera_depth_frame"/>
<!-- heights are in the (optical?) frame of the kinect -->
<param name="min_height" value="-0.025"/>
<param name="max_height" value="0.025"/>
<remap from="cloud" to="/cloud_throttled"/>
<remap from="scan" to="/narrow_scan"/>
</node>
<!--- Run explore -->
<include file="$(find explore_gazebo)/move.xml" />
<include file="$(find explore_gazebo)/explore_slam.xml" />
<!--- Run gmapping -->
<include file="$(find turtlebot_navigation)/config/gmapping_turtlebot.launch" />
</launch> | {
"domain": "robotics.stackexchange",
"id": 14319,
"lm_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, exploration, turtlebot, explore, package",
"url": null
} |
observational-astronomy, coordinate, mathematics
Declination can be gotten from latitude, elevation, and azimuth:
$ \sin{\delta} = \sin{\theta_{el}} \sin{ \theta_{lat} } + \cos{ \theta_{el} } \cos{ \theta_{lat} } \cos{\theta_{az}} $,
Thus indeed, given an alt-az (or az-el depending on your preferred terminology) position and the latitude of the observing station, it is unnecessary to use RA or an independently determined hour angle in a calculation of parallactic angle. I say "independently determined hour angle" meaning that although hour angle is used in the calculation, it can be determined entirely from az/el and latitude, so one does not need to provide an hour angle for this calculation to work. | {
"domain": "astronomy.stackexchange",
"id": 4084,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "observational-astronomy, coordinate, mathematics",
"url": null
} |
newtonian-mechanics, reference-frames, acceleration, inertial-frames, equivalence-principle
So if it is assumed that the Earth is a non-inertial frame, and forms an action-reaction pair with the free-falling elevator, why wouldn't a person at rest in outer space say that the elevator is a non-inertial frame if is it being accelerated by gravitational force? Is it possible to extend this situation to a general case where if whenever a frame of reference configures Newton's third law, then it is a non-inertial frame? Unfortunately, this is a question of terminology where the terminology has changed over time and become a little inconsistent. When Newton first formulated his laws, little care was taken about things like reference frames. And his personal views were based on absolute time and space, which were quickly discarded by the scientific community. | {
"domain": "physics.stackexchange",
"id": 84905,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, reference-frames, acceleration, inertial-frames, equivalence-principle",
"url": null
} |
electromagnetism, vector-fields
$$ \langle k \rangle = \frac{\mathbf{k}_1 \| E_1(\mathbf{r}) \|^2 + \mathbf{k}_2\| E_2(\mathbf{r}) \|^2}{\| E_1(\mathbf{r}) \|^2 + \| E_2(\mathbf{r}) \|^2} . $$
Hope this explanation is clear enough. | {
"domain": "physics.stackexchange",
"id": 68986,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, vector-fields",
"url": null
} |
general-relativity, gravity, speed-of-light, gravitational-waves, gravitational-wave-detectors
Is it correct to say that experimental verification that the gravity propagates at the speed of light came around 2017 once LIGO and VIRGO detectors observed the gravitational wave?
I assume that the curvature of space-time and gravitational wave are the same thing. I take space-time curvature as something static and gravitational wave as a dynamic and travelling curvature of space-time. Please correct me if I'm wrong. General relativity tells us that gravitational waves move at the speed of light, and there is lots of experimental evidence to support general relativity. So before 2017 there was already a lot of indirect evidence that gravitational waves travelled at the speed of light. So much so that no physicist I know thought otherwise. | {
"domain": "physics.stackexchange",
"id": 99730,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, gravity, speed-of-light, gravitational-waves, gravitational-wave-detectors",
"url": null
} |
classical-mechanics, lagrangian-formalism, symmetry, definition, noethers-theorem
Title: Intuition behind the definition of Continuous Symmetry of a Lagrangian (Proof of Noether's Theorem) Suppose there is a one-parameter family of continuous transformations that maps co-ordinates $q(t)\rightarrow Q(s,t)$ where the $s$ is the continuous parameter. Also, for when $s=0$ the transformation is the identity, i.e. $Q(0,t)=q(t)$.
Then if we have a Lagrangian, $L$ which is invariant under the replacement of $q\rightarrow Q$, then why is it intuitively true that:
$$ \frac{d}{ds}L|_{s=0}=0$$
In other words, why is the derivative taken at $s=0$? Let there be a transformation $q(t) \rightarrow Q(s,t)$ such that $L$ remains invariant. There exists an identity point $s_{0}$ where:
\begin{equation}
Q(s_{0},t) = q(t)
\end{equation}
$L$ is initially a functional of $q$, $\dot{q}$ and $t$, but after the transformation it becomes a functional of $Q(s,t)$ and $\dot{Q}(s,t)$. Furthermore, this is the only way that $L$ depends on $s$, so:
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 90393,
"lm_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, lagrangian-formalism, symmetry, definition, noethers-theorem",
"url": null
} |
general-relativity, cosmology, gravity, spacetime, curvature
How do spatial curvature and temporal curvature differ?
Now, this is where it gets a little confusing. Our universe has no spatial curvature. But our spacetime does. So the curvature must be in the temporal dimension? But this says we cannot find a coordinate system where the curvature is only in the temporal dimension. So the connection between the statement that our universe and our spacetime is curved, and that there is no spatial curvature, is not trivial.
Our spacetime has intrinsic curvature. But it is not in the spatial dimensions (there is no spatial curvature), so it has to manifest in the temporal dimension?
Just to clarify, one of the answers specifically says our universe does not have spatial curvature (talks about spatial curvature separately), and the other answer talks about possible existing temporal curvature (mentioning that you have to be cautious to treat spatial and temporal curvature separately), but then they both talk about spacetime curvature. | {
"domain": "physics.stackexchange",
"id": 70262,
"lm_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, cosmology, gravity, spacetime, curvature",
"url": null
} |
machine-learning, classification
Title: How will Occam's Razor principle work in Machine learning The following question displayed in the image was asked during one of the exams recently. I am not sure if I have correctly understood the Occam's Razor principle or not. According to the distributions and decision boundaries given in the question and following the Occam's Razor the decision boundary B in both the cases should be the answer. Because as per Occam's Razor, choose the simpler classifier which does a decent job rather than the complex one.
Can someone please testify if my understanding is correct and the answer chosen is appropriate or not?
Please help as I am just a beginner in machine learning Occam’s razor principle:
Having two hypotheses (here, decision boundaries) that has the same empirical risk (here, training error), a short explanation (here, a boundary with fewer parameters) tends to be more valid than a long explanation. | {
"domain": "datascience.stackexchange",
"id": 4925,
"lm_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, classification",
"url": null
} |
python, python-3.x, game, dice
class Game:
There's no docstring here, so I have no idea what the class is used for. The purpose of using classes is to group together related data and/or functions. Your Game class doesn't seem to store any data (the __init__() is never called, and the member it stores into is never used anywhere). A Game class should store data about the overall state of the game, for instance a list of players and whose turn it is, and have methods that use and manipulate the state of the whole game. A player list would be one of its members.
def __init__(self, player_list):
self.player_list = player_list
This function is never called, and the member variable it assigns is never used. Why does it exist?
def set_player(self, player_list=[]):
The player list is an aspect of the game so it should be a member variable (accessed via self.), not a parameter.
'''Sets number of players and player names.'''
players = int(input('How many humans are playing?''\n', )) | {
"domain": "codereview.stackexchange",
"id": 29472,
"lm_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, game, dice",
"url": null
} |
c#, random
private static ElementMetadata[] InitializeMetadata(IReadOnlyDictionary<TElement, int> elementWeights, int weightMultiplier, int heightPerRectangle) {
var count = elementWeights.Count;
var elementMetadata = new ElementMetadata[count];
var index = 0;
var stackLarge = new Stack<KeyValuePair<int, int>>();
var stackSmall = new Stack<KeyValuePair<int, int>>();
foreach (var kvp in elementWeights) {
var newWeight = (kvp.Value * weightMultiplier);
if (newWeight > heightPerRectangle) {
stackLarge.Push(new KeyValuePair<int, int>(index++, newWeight));
}
else {
stackSmall.Push(new KeyValuePair<int, int>(index++, newWeight));
}
}
while (0 < stackLarge.Count) {
var largeItem = stackLarge.Pop();
var smallItem = stackSmall.Pop(); | {
"domain": "codereview.stackexchange",
"id": 34251,
"lm_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#, random",
"url": null
} |
Proof of Fact E.2
Let $X$ be a compact space. Let $U_1,U_2,U_3,\cdots$ be open subsets of $X$ such that each $U_i$ is also a dense subset of $X$. Let $V$ a non-empty open subset of $X$. We wish to show that $V$ contains a point that belongs to each $U_i$. Since $U_1$ is dense in $X$, $O_1=V \cap U_1$ is non-empty. Since $U_2$ is dense in $X$, choose non-empty open $O_2$ such that $\overline{O_2} \subset O_1$ and $O_2 \subset U_2$. Since $U_3$ is dense in $X$, choose non-empty open $O_3$ such that $\overline{O_3} \subset O_2$ and $O_3 \subset U_3$. Continue inductively in this manner and we have a sequence of open sets $O_1,O_2,O_3,\cdots$ just like in Fact E.1. Then the intersection of the open sets $O_n$ is non-empty. Points in the intersection are in $V$ and in all the $U_n$. This completes the proof of Fact E.2. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765557865637,
"lm_q1q2_score": 0.8057260766037354,
"lm_q2_score": 0.822189134878876,
"openwebmath_perplexity": 320.3856639252461,
"openwebmath_score": 0.9999508857727051,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/product-space/"
} |
and..., Ok, how about the distance from a point a method for the. Will assume that the line to the line segment that is perpendicular each. Or another find the distance d between a point to a line ( diagram! A, and snippets using two line equations Let 's pick something easy: 'll! Certainty and Uncertainty: Statistics and Probability in Five Units with notes on Historical Origins and Illustrative Numerical Examples perpendicular! Whose nearest distance we seek by the line segment joining the points online calculator find... And b ≠ 0, the line by dragging points a and b 0. Book I, Definition 6 ] a plane we know what the normal vector is line in geometry. The normal vector is shortest distance of a triangle § using coordinates is a surface are.. And P2, y = −c/b given a point to one of perpendicular... Can find the distance from a point a line in coordinate geometry ) method:! Can modify the line through these two points is the component of a.! Will assume that the line -3, -3, -3, -3, | {
"domain": "psdeg-psoe.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611563610179,
"lm_q1q2_score": 0.8273878276441885,
"lm_q2_score": 0.8615382058759129,
"openwebmath_perplexity": 588.8990444251505,
"openwebmath_score": 0.8071962594985962,
"tags": null,
"url": "http://neda.psdeg-psoe.org/9jv2ji/d1fd03-distance-from-a-point-to-a-line-using-projections"
} |
clustering
Title: Grouping by similarity I would like to find a way/algorithm to group people into, say, four groups by their answer similarity to yes/no questions.
So, each pair of people in one group would have given the same answers for a big part of the questions – (mostly) bigger than compared to people from the other three groups.
Would appreciate any pointers to the right direction. I would start with the simple option: represent every person as a boolean vector in which every position represents the answer to a particular question (the length is the total number of questions). Then you can apply any standard clustering algorithm, such as K-means (hierarchical clustering would probably also work with data like this). | {
"domain": "datascience.stackexchange",
"id": 8859,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "clustering",
"url": null
} |
quantum-field-theory, general-relativity, cosmology, renormalization, quantum-gravity
$\;\;{}^{\underline{1}}$ The number of dimensions, i.e. $4$.
$\;\;{}^{\underline{2}}$ I'm using Natural units. | {
"domain": "physics.stackexchange",
"id": 90120,
"lm_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, general-relativity, cosmology, renormalization, quantum-gravity",
"url": null
} |
equations is a group of two or more linear equations that all contain the same set of variables. A large pizza at Palanzio’s Pizzeria costs $6.80 plus$0.90 for each topping. Updated June 08, 2018 In mathematics, a linear equation is one that contains two variables and can be plotted on a graph as a straight line. If you're seeing this message, it means we're having trouble loading external resources on our website. In this algebra activity, students analyze word problems, define variables, set up a system of linear equations, and solve the system. 1. At the first store, he bought some t-shirts and spent half of his money. A system of three equations in three variables can be solved by using a series of steps that forces a variable to be eliminated. So far, we’ve basically just played around with the equation for a line, which is . A solution of the system (*) is a sequence of numbers $s_1, s_2, \dots, s_n$ such that the substitution $x_1=s_1, x_2=s_2, \dots, x_n=s_n$ satisfies all the | {
"domain": "lotusmc.org",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9869795091201805,
"lm_q1q2_score": 0.8993157094542055,
"lm_q2_score": 0.9111797166446537,
"openwebmath_perplexity": 474.14805537072425,
"openwebmath_score": 0.4137629270553589,
"tags": null,
"url": "https://lotusmc.org/ii5sh61n/archive.php?id=6a0ed8-system-of-linear-equations-problems"
} |
c, tower-of-hanoi
int main (void)
{
int numberOfDisks, i, smallestDir, moveCount = 0;
bool everyOtherMove = false;
int rodFrom, rodTo, disk;
int topDisk[4];
int temp;
printf ("\nTower of Hanoi puzzle\n");
printf ("\nnumber of disks? ");
scanf ("%i", &numberOfDisks);
int rod[numberOfDisks + 1];
// all disks start on rod 1
for ( i = 1; i <= numberOfDisks; ++i )
rod[i] = 1;
// set direction to move smallest disk
if ( (numberOfDisks & 1) == 0 )
smallestDir = 1;
else
smallestDir = -1;
printf("\nsolution\n\n");
do {
++moveCount;
if ( ! everyOtherMove ) {
// move smallest disk
rodFrom = rod[1];
rodTo = rodFrom + smallestDir;
if ( rodTo > 3 )
rodTo = 1;
if ( rodTo < 1 )
rodTo = 3; | {
"domain": "codereview.stackexchange",
"id": 43941,
"lm_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, tower-of-hanoi",
"url": null
} |
optimization, game, objective-c, sprite-kit
Now when I am assigning a texture to a sprite in the scene, I have to keep track of the number of images that I have for each different tile. Also, the way I have this set up, they have to have the same number of images:
-(SKTexture *) textureForType:(BlockType)type damageLevel:(int)damageLevel {
int numImagesEach = 4;
switch (type) {
case BlockTypeDirt:
{
int amount = (type * numImagesEach) + damageLevel;
return _tilesFromAtlas[amount];
}
case BlockTypeRock:
{
int amount = (type * numImagesEach) + damageLevel;
return _tilesFromAtlas[amount];
}
default:
break;
}
return nil;
} | {
"domain": "codereview.stackexchange",
"id": 10171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optimization, game, objective-c, sprite-kit",
"url": null
} |
fl.formal-languages, automata-theory, lower-bounds, communication-complexity, nfa
Is there an $L$ for which $NFA(L)>COV(M)+COV(N)?$
By what function of $COV(M)$ and $COV(N)$ can we upper bound $NFA(L)?$ The bounds...
We have in fact $NFA(L) \ge Cov(M) + Cov(N)$, see Theorem 4 in (Gruber & Holzer 2006). For an upper bound, we have $2^{Cov(M)+Cov(N)} \ge DFA(L) \ge NFA(L)$, see Theorem 11 in the same paper.
...cannot be substantially improved
There can be a subexponential gap between $Cov(M)+Cov(N)$ and $NFA(L)$. The following example, and the proof of the gap, is an adaptation of a similar example illustrating the limitations of 2-party protocols for proving lower bounds on nondeterministic state complexity from (Hromkovič et al. 2009):
We use the alphabet $[n]= \{\,1,2,\ldots,n\,\}$. Let $L=\{\,xyz\in [n]^3 \mid x=y \vee x\neq z \,\}$.
We first take care of $Cov(M)$. Observe that if $w=xyz$ with $y=z$, then
$w \in L$: in case $x=y$, $w\in L$ and in case $x\neq y$, we also have
$x\neq z$ and thus $w\in L$. Also, if $w$ is of the form $xyz$ with | {
"domain": "cstheory.stackexchange",
"id": 2623,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fl.formal-languages, automata-theory, lower-bounds, communication-complexity, nfa",
"url": null
} |
classical-mechanics, kinematics, reference-frames, coordinate-systems
\end{bmatrix}$$
Taking the axes off the reference frame, and it works.
My question is therefore: do rotation matrices rotate about BODY axes of the geometry rotated, or INERTIAL axes? The former case would mean I have an error in my code, but simplifying it to the edge of being just the mathematics presented and thoroughly debugging it step by step hasn't revealed any error. The columns of a 3×3 rotation matrix contain the coordinates of the local xyz axes (expressed in world coordinates). With Euler angles (321) you apply the elementary rotations $R_Z$, $R_Y$, $R_X$ in sequence to form the local → world rotation matrix. That is
$$ E = R_Z(\varphi) R_Y(\psi) R_X(\theta) $$ | {
"domain": "physics.stackexchange",
"id": 20526,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "classical-mechanics, kinematics, reference-frames, coordinate-systems",
"url": null
} |
signal-analysis, continuous-signals, derivative
Furthermore, also the fact that the (generalized) derivative of the step function equals the Dirac delta impulse can be shown in a rigorous way. So even if we use notation that seems appalling to most mathematicians, we engineers tread on pretty safe ground when it comes to the use of distributions as given in your example.
A very good introduction to distributions and singularity functions that is rigorous yet accessible for engineers can be found in The Fourier Integral and Its Applications by A. Papoulis. | {
"domain": "dsp.stackexchange",
"id": 4861,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "signal-analysis, continuous-signals, derivative",
"url": null
} |
general-relativity, spacetime, string-theory, metric-tensor, sigma-models
$$Z=\int DX Dg \, e^{-S_{\mathrm{poly}}-V}$$
where
$$V\sim \int d^2\sigma \sqrt{h}h^{\alpha\beta}\partial_\alpha X^\mu \partial_\beta X^\nu f_{\mu\nu}.$$
If we now choose $f_{\mu\nu} \sim c_{\mu\nu}e^{ip\cdot X}$ then the expression agrees with the vertex operator of a graviton in string theory, and adding $e^V$ to the path integral shifts the metric by $f_{\mu\nu}$.
Thus, to recap: a massless spin 2 gauge boson arises in the spectrum of the string upon quantisation, and the background curved metric is comprised of such gravitons, in the sense described above.
Caveat: We are not directly trying to quantise the metric in string theory, or in the description above. That approach is canonically quantised gravity. However, we can from string theory derive effective actions and these include the graviton as the metric. To obtain amplitudes from these effective actions we would quantise in the usual way. | {
"domain": "physics.stackexchange",
"id": 43556,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, spacetime, string-theory, metric-tensor, sigma-models",
"url": null
} |
research-level, quantum-information, quantum-entanglement
Bit of a short answer but that is my opinion on the matter! | {
"domain": "physics.stackexchange",
"id": 3376,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "research-level, quantum-information, quantum-entanglement",
"url": null
} |
c#, strings, parsing, .net
is only helpful/needed for the very first iteration and could be removed if the loop would start at 1 like so
currentString.Append(input[0]);
for (var i = 1; i < input.Length; i++)
{
Parameter validation is missing for this public method but you wouldn't do that in production code like I know. Because of that I omitted the validation as well.
My take on this is a little bit longer but a little bit faster as well
public List<string> Split(string input)
{
var results = new List<string>();
char[] result = new char[4];
int j = 0;
bool hasLetter = false;
for (int i = 0; i < input.Length - 1; i++)
{
char c = input[i];
if (char.IsLetter(c))
{
if (j > 0)
{
results.Add(new string(result));
result = new char[4];
j = 0;
}
result[j++] = c;
hasLetter = true;
continue;
} | {
"domain": "codereview.stackexchange",
"id": 24825,
"lm_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#, strings, parsing, .net",
"url": null
} |
electromagnetism, general-relativity, black-holes, charge, reissner-nordstrom-metric
The current status of the Wikipedia page on black holes claims that you can theoretically avoid the singularity of a charged black hole. It also describes there that there is a theoretical upper bound on the charge/mass ratio of a black hole: that any would-be black hole exceeding it (which is generally thought to be impossible — see this related question on trying to force saturation of the charge/mass ratio or black holes) would lack an event horizon (and therefore presumably not be a black hole). Why should that be? Furthermore: from this other related question on repulsion of pairs of charged black holes (and from Willie Wong's comment, below), ir seems that the size of the event horizon may change depending on how close it is to being extremal! Why would the event horizon of a highly charged black hole be different than the event horizon of a neutral black hole, of similar mass? | {
"domain": "physics.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": "electromagnetism, general-relativity, black-holes, charge, reissner-nordstrom-metric",
"url": null
} |
“Share” and “no share” measure between two vectors
Given two $n-$dimensional vector, namely $U = [u_1,u_2 \cdots u_n]$ and $V=[v_1,v_2 \cdots v_n]$ such that $\sum_i u_i = \sum_i v_i = 1$ and $u_i \in [0,1]$ and $v_i \in [0,1]$, i would like to derive a $\text{Share_coefficient}$ and $\text{NoShare_coefficient}$ measure which satisfies the below constraint.
1. $\text{Share_coefficient} + \text{NoShare_coefficient} = 1$
2. $\text{Share_coefficient}\geq 0$ and $\text{NoShare_coefficient}\geq 0$
3. When the vector $U$ and $V$ are identical then $\text{Share_coefficient}=1$
4. When the vector $U$ and $V$ are disjoint (e.g., $U=[1\;\; 0\;\; 0]$ and $V = [ 0\;\; 0.5 \;\; 0.5]$) then $\text{NoShare_coefficient}=1$
5. For other combination of vector $U$ and $V$, the coefficients are assigned accordingly; i.e. when the overlap between the vectors is more, then $\text{Share_coefficient}$ should be greater than $\text{NoShare_coefficient}$ and vice versa. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018362008347,
"lm_q1q2_score": 0.8168485302340762,
"lm_q2_score": 0.8376199673867852,
"openwebmath_perplexity": 154.79803057707912,
"openwebmath_score": 0.8944640159606934,
"tags": null,
"url": "http://math.stackexchange.com/questions/92979/share-and-no-share-measure-between-two-vectors"
} |
general-relativity, differential-geometry, anti-de-sitter-spacetime
For a general 4D spacetime Cartan–Karlhede algorithm requires evaluation of a lot of curvature invariants, however depending on what is known about the spacetime significant simplifications are possible. Also, one should keep in mind that the Lorentzian manifolds present additional subtleties absent in case of Euclidean metric signature since it is possible to have nontrivial “null” curvature for which all scalar curvature invariants are zero.
References
Stephani, H.; Kramer, D.; MacCallum, M.; Hoenselaers, C.; Herlt, E. (2003). Exact Solutions of Einstein's Field Equations (2nd edn.). Cambridge: Cambridge University Press. ISBN 0-521-46136-7, sec. 9.2.
Nozawa, M., & Tomoda, K. (2019). Counting the number of Killing vectors in a 3D spacetime. Classical and Quantum Gravity, 36(15), 155005, doi:10.1088/1361-6382/ab2da7, arXiv:1902.07899. | {
"domain": "physics.stackexchange",
"id": 74881,
"lm_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, differential-geometry, anti-de-sitter-spacetime",
"url": null
} |
# Can all groups be thought of as the symmetries of a geometrical object?
It is often said that we can think of groups as the symmetries of some mathematical object. Usual examples involve geometrical objects, for instance we can think of $$\mathbb{S}_3$$ as the collection of all reflections and rotation symmetries of an equilateral triangle, similarly we can think of $$D_8$$ as the symmetry group of a square.
Cayley's Theorem along with the fact that the symmetry group of a regular $$n$$-simplex is isomorphic to $$\mathbb{S}_{n+1}$$ allows us to think of any finite group as a subset of the symmetry group of some geometrical object. Which brings me to the following questions:
1. Can every finite group be represented as the collection of all symmetries of a geometrical object? That is, are all finite groups isomorphic to some Symmetry group? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357604052423,
"lm_q1q2_score": 0.807177715349312,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 176.70135874447323,
"openwebmath_score": 0.7871153354644775,
"tags": null,
"url": "https://math.stackexchange.com/questions/3254492/can-all-groups-be-thought-of-as-the-symmetries-of-a-geometrical-object"
} |
ruby, ruby-on-rails, rspec, tdd
context "when an admin" do
subject {
@ability.can :manage, Station
render
rendered
}
it { should have_link 'Edit' }
it { should have_link 'Delete' }
end
end There are no unintended consequences, but it is a little unusual and may surprise the reader. However, it is a small surprise.
It usually communicates intent well to use subject to declare the subject, and before to setup preconditions unrelated to the subject. For preconditions that involve the subject, those are often better in a before block as well, but it's not too surprising to find them in the subject block.
So, instead of this:
subject {
@ability.can :manage, Station
render
rendered
}
this:
before(:each) do
@ability.can :manage, Station
render
end
subject {rendered}
I used do...end for the multi line block and {} for the single line block; this is a common (although not ubiquitous) practice. | {
"domain": "codereview.stackexchange",
"id": 5590,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ruby, ruby-on-rails, rspec, tdd",
"url": null
} |
rospy
Originally posted by Murph on ROS Answers with karma: 1033 on 2012-04-29
Post score: 5
This is normal (also... I assume you have a rospy.spin() after you publish, or else things are getting destructed too early). See http://answers.ros.org/question/9665/test-for-when-a-rospy-publisher-become-available?answer=14125#post-id-14125
Basically, there is a nonzero amount of time where a subscriber actually subscribes to a publisher. If a publisher publishes a message during that time, the subscriber will not receive it, as it was not yet subscribed when the message was sent. If you want any subscriber to get the last message the publisher sent when it connects, you should use a latched topic.
When you do rospy.sleep(1) before publishing, you are allowing some time for the subscribers to connect before you actually publish the message. Therefore, the subscriber does receive the message. | {
"domain": "robotics.stackexchange",
"id": 9186,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "rospy",
"url": null
} |
approximations of autonomous SPDEs are thoroughly investigated in the literature, while the non-autonomous case is not yet understood. Finite Difference Method for Heat Equation Simple method to derive and implement Hardest part for implicit schemes is solution of resulting linear system of equations Explicit schemes typically have stability restrictions or can always be unstable Convergence rates tend not to be great – to get an. We present qualitative and numerical results on a partial differential equation (PDE) system which models a certain fluid-structure dynamics. •• Introduction to Finite Differences. Replace continuous problem domain by finite difference mesh or grid u(x,y) replaced by u i, j = u(x,y) u i+1, j+1 = u(x+h,y+k) Methods of obtaining Finite Difference Equations - Taylor. Finally the numerical solutions obtained by FDM, FEM and MCM are compared with exact solution to check the accuracy of the developed scheme Keywords - Dirichlet Conditions, Finite difference Method, | {
"domain": "saltotech.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992654173860152,
"lm_q1q2_score": 0.8417387384664312,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 471.75897534643485,
"openwebmath_score": 0.42150694131851196,
"tags": null,
"url": "http://imwt.saltotech.it/numerical-solution-of-partial-differential-equations-finite-difference-methods.html"
} |
Yes, induction is the natural choice here.
Base Step: $a_1 = 1/1 = F_2 / F_1$
Inductive Step: Suppose $a_n = F_{n+1}/F_n$ for an arbitrary $n \in \mathbb{N}$. Then $$a_{n+1} = 1 + \frac{1}{a_n} = 1 + \frac{F_n}{F_{n+1}} = \frac{F_{n+1}}{F_{n+1}} + \frac{F_n}{F_{n+1}} = \frac{F_{n+2}}{F_{n+1}}$$
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9783846672373524,
"lm_q1q2_score": 0.8410818342375069,
"lm_q2_score": 0.8596637523076225,
"openwebmath_perplexity": 534.7687984177421,
"openwebmath_score": 0.8985628485679626,
"tags": null,
"url": "http://math.stackexchange.com/questions/246284/induction-problem-ratio-of-consecutive-fibonacci-numbers"
} |
organic-chemistry, spectroscopy, nmr-spectroscopy, ir-spectroscopy
~3420 is clearly an -OH stretch. Probably too high to consider a N-H group of any sort. So, it could be an alcohol or an acid.
1682 a C=O group. Probably in the acid region, likely aromatic acid, conjugated or intramolecular H-bonded. Possibly amide, but not convincing based on other peaks.
There are lots of other peaks, most of which could mean many things, but I do see 749 and 708 which support the NMR notion of a monosubstituted benzene. I usually think that IR is only useful to corroborate peaks of a known structure, but then I'm an NMR advocate.
NMR
Again, the first and second spectra are very different; the obvious concern is that they are of different batches of sample - were the first and second analyses taken from the same sample, or from a different batch. In any case, let us look at the second, which is only a partial spectrum, and omits some possibly very significant information, especially in the region above 10ppm, where I would like to see a broad acid peak. | {
"domain": "chemistry.stackexchange",
"id": 1494,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, spectroscopy, nmr-spectroscopy, ir-spectroscopy",
"url": null
} |
python, smach
# Add a state to the container
smach.StateMachine.add('PTP1',
smach_ros.SimpleActionState('SiliaAction_TrajServer',
FollowJointTrajectoryAction,
goal = goal1
),
transitions={'succeeded':'NextState'})
The problem is this created goal1 does not have an entry called "positions" under goal1.trajectory.points. To be more precise, goal1.trajectory.points is an empty array, which looks like this if I print it out:
trajectory:
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
joint_names: []
points: [] # here it is
path_tolerance: []
goal_tolerance: []
goal_time_tolerance:
secs: 0
nsecs: 0
Is there any method to fill in this goal and pass it on, for example by the time when calling the constructor FollowJointTrajectoryGoal() and fill my desired positions here?
Thank you for your answers! | {
"domain": "robotics.stackexchange",
"id": 12741,
"lm_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, smach",
"url": null
} |
undecidability, halting-problem, finite-sets
Thanks in advance!! You don't define $H_0$. Presumably it's an undecidable set.
First, $f : \mathbb{N} \to H_0$ only means that all the values of $f(x)$ are in $H_0$, i.e. the image of $f$ is a subset of $H_0$: $f(\mathbb{N}) \subseteq H_0$. The proof of the counterexample involves a stronger property: it constructs a function $f$ whose image is exactly $H_0$, that is, $f(\mathbb{N}) = H_0$. | {
"domain": "cs.stackexchange",
"id": 16723,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "undecidability, halting-problem, finite-sets",
"url": null
} |
c#, design-patterns, search, interface
That is, for every different search source I need to implement 3 classes whose responsibilities are very well defined and very very simple. This is the most convenient way that I could achieve supporting modularity and testability.
Here is the source code for the interfaces:
public interface ISearchClient<SourceResponseType>
{
SourceResponseType ExecuteRemoteSearch(string query);
}
public interface ISearchResponseParser<SourceResponseType, SourceItemType>
{
IEnumerable<SourceItemType> ParseResponse(SourceResponseType searchResponse);
}
public interface ISearchItemConverter<SourceItemType, FinalItemType>
{
FinalItemType Convert(SourceItemType sourceItem);
} | {
"domain": "codereview.stackexchange",
"id": 17533,
"lm_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#, design-patterns, search, interface",
"url": null
} |
The answer and method seems plausible to me.
However, I remember seeing somewhere in the book where in order to solve this kind of problem, we need to find the equation of the plane that contains the first line. Then, find the equation of another plane and the intersection of this 2 planes is the equation of the line 2. This is done by using the cross product of 2 normal lines.
Thanks. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9770226267447513,
"lm_q1q2_score": 0.8141769890870327,
"lm_q2_score": 0.8333245994514084,
"openwebmath_perplexity": 1069.0698882704053,
"openwebmath_score": 0.8202084302902222,
"tags": null,
"url": "https://www.physicsforums.com/threads/finding-equations-of-vector-line-perpendicular-to-another-vector-line.250844/"
} |
Definition: Sample mean and sample standard deviation . … Example of Confidence Interval for a Population Variance, Example of Two Sample T Test and Confidence Interval, Confidence Interval for the Difference of Two Population Proportions, Examples of Confidence Intervals for Means, B.A., Mathematics, Physics, and Chemistry, Anderson University. We will see how these two types of standard deviations are different from one another numerically. The population standard deviation measures the variability of data in a population. This is approximately 2.4495. When we used the whole population we got: Mean = 7, Standard Deviation = 2.983...When we used the sample we got: Sample Mean = 6.5, Sample Standard Deviation = 3.619...Our Sample Mean was wrong by 7%, and our Sample Standard Deviation was wrong by 21%. Standard deviation of Population vs Sample. Thus the standard deviation of the sample is greater than that of the population. In this section, you will learn about when to use standard | {
"domain": "tokocase.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.975576914916509,
"lm_q1q2_score": 0.8043260247044693,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 390.95259407910424,
"openwebmath_score": 0.8247133493423462,
"tags": null,
"url": "https://tokocase.com/61s0qt8/population-standard-deviation-9f9839"
} |
• I am sure there are continuum many divergent sequences. Take your favorite divergent one, mark off pairs of elements, and swap the pairs according to the binary expansion of any real. All those sequences will also be divergent. That is why I don't see what the measure space needs to be to measure "most sequences converge to 1/2". May 28, 2016 at 20:45
• But are there continuum-many converging sequences and continuum-many converging to $\frac12$. I suspect affirmative all around, but that's way out of my comfort zone! Or is it greater than continuum? $\mathfrak c=n^\mathbb{N}$, is $\mathbb{N}^\mathbb{N}>\mathfrak c$? May 28, 2016 at 21:13
• Yes, so cardinality is not sufficient to show that almost none diverge (or converge somewhere else than 1/2). May 28, 2016 at 21:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.976310525254243,
"lm_q1q2_score": 0.8093016751042338,
"lm_q2_score": 0.8289387998695209,
"openwebmath_perplexity": 253.72222548050166,
"openwebmath_score": 0.8188491463661194,
"tags": null,
"url": "https://math.stackexchange.com/questions/1803446/what-is-the-average-rational-number"
} |
pcl, ros-hydro, pcl-1.7
Originally posted by RosBiscuit on ROS Answers with karma: 13 on 2013-10-09
Post score: 0
Change this line
pcl::fromROSMsg(pc2_raw,*pcl_cloud);
to
pcl::fromROSMsg(pc2_raw, pcl_cloud);
See the API of pcl::fromROSMsg, for details. It needs a pointer and you already have that.
Originally posted by makokal with karma: 1295 on 2013-10-10
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 15813,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "pcl, ros-hydro, pcl-1.7",
"url": null
} |
orbit, solstice
To clarify things,
So, there is no particular reason in orbital mechanics; it just happens that we live in an era when they are close together?
Exactly.
Or maybe not. The end of the last glaciation, which occurred about 12000 years ago, massively spurred human development. The cycle then was almost exactly opposite what it is now. It took about 10000 years for humanity to develop to a somewhat advanced level (e.g., Roman Empire level), and then only another couple of thousand to develop to the stage where we are now. Whether humanity can survive for another 13000 years without wiping itself out will determine whether this was happenstance. | {
"domain": "astronomy.stackexchange",
"id": 3810,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "orbit, solstice",
"url": null
} |
programming, error-correction, stabilizer-code, stim
# measure stabilizer
MPP X1*Z2*Y3
# and claim it's supposed to have a deterministic result
DETECTOR rec[-1]
If you now sample the detectors of the circuit via circuit.compile_detector_sampler().sample(shots=10) you should get back a numpy array filled with 0s, indicating the system has been prepared into an eigenstate of the stabilizer. If you instead see a 50/50 mix of 0s and 1s, something is wrong.
The next step would be to do that for each stabilizer, and then add noise and confirm that you see the stabilizers flipping:
# [... encoding circuit ... ]
# phase damp qubit 3, potentially flipping the stabilizer
Z_ERROR(0.1) 3
# measure stabilizer
MPP X1*Z2*Y3
# and claim it's supposed to have a deterministic result
DETECTOR rec[-1] | {
"domain": "quantumcomputing.stackexchange",
"id": 3192,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming, error-correction, stabilizer-code, stim",
"url": null
} |
angular-momentum, quantum-spin, representation-theory, spin-models, loop-quantum-gravity
This has to do with representation theory of $\mathfrak{su}_2$. A spin-$j$ irrep can be thought of as the totally symmetric part of a tensor product of $2j$ fundamental (spin-$1/2$) irreps.
You can also implement intertwiners between $V_{\{1,2,3\}}$ as tensors acting on the tensor product $V_{1/2}^{\otimes 2 j_1} \otimes V_{1/2}^{\otimes 2 j_2} \otimes V_{1/2}^{\otimes 2 j_3}$, and later taking only the projection of these tensors on the symmetric subspace. This is convenient, because there exists a very simple graphical calculation model for these – see Penrose's binor calculus.
Clebsh-Gordan coefficients are essentially the ratios between the normalization of intertwiners in Penrose's binor calculus, and the renormalization of intertwiners in LQG (given by the spin network inner product). | {
"domain": "physics.stackexchange",
"id": 71804,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "angular-momentum, quantum-spin, representation-theory, spin-models, loop-quantum-gravity",
"url": null
} |
python, database, git, sqlalchemy
__table_args__ = (
UniqueConstraint('name', 'repository_id', name='unique_branch_per_repo'),
)
class Repository(Base):
__tablename__ = "repositories"
id = Column(Integer, primary_key=True, autoincrement= True)
name = Column(String)
head_oid = Column(String, nullable= True, default= None)
current_branch_id = Column(Integer, ForeignKey("branches.id"), nullable=True)
current_branch = relationship("Branch", uselist=False, foreign_keys=[current_branch_id])
creator_id = Column(Integer, ForeignKey('users.id'), nullable= False)
creator = relationship("User", back_populates="repositories")
commits = relationship("Commit", back_populates="repository")
branches = relationship("Branch", back_populates="repository", foreign_keys="Branch.repository_id")
__table_args__ = (
UniqueConstraint('name', 'creator_id', name='unique_repo_per_user'),
)
class User(Base):
__tablename__ = "users" | {
"domain": "codereview.stackexchange",
"id": 45427,
"lm_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, database, git, sqlalchemy",
"url": null
} |
## Look-and-say sequence implementation
This thread goes over a possible Python implementation for the look-and-say sequence.
• 1
• 11
• 21
• 1211
• 111221
• 312211
• ???
I challenged you with this sequence earlier.
Now I'll explain the answer.
I will also show you a nice Python 🐍 implementation for this sequence.
Here we go 🚀
First, how does the sequence work?
This sequence is called the look-and-say sequence.
Why?
Because the next term is created by looking at the previous one and saying what you are seeing.
We start with 1. What do you see?
You see “one 1” → 11.
Now you have 11. What do you see?
You see “two 1s” → 21.
Now you have 21. What do you see?
You see “one 2 and one 1” → 1211.
Keep doing this until you reach 312211. What do you see?
You see “one 3, one 1, two 2s, and two 1s” → 13112221.
Thus, the next term in the sequence would be 13112221.
Trivia fact: all terms in this sequence have even length!
(Well, except the starting 1 🤪)
Another cute fact: | {
"domain": "mathspp.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429595026213,
"lm_q1q2_score": 0.8172986685639421,
"lm_q2_score": 0.8311430520409023,
"openwebmath_perplexity": 3557.7042997969506,
"openwebmath_score": 0.3141944408416748,
"tags": null,
"url": "https://mathspp.com/blog/twitter-threads/look-and-say-sequence-implementation"
} |
php, mysql, array
Title: Looking For a More Efficient/Elegant Way To Write a MySQL Query I'm querying a MySQL database and displaying the info in order of timestamp (DESC). Essentially, I'm grabbing the last record in the database, displaying it's date and year as the header of it's section and then going backwards from there. I've put together these if and else if statements to display the appropriate month name according to the timestamp. It works fine but I know I could probably do this with an array or some sort of other loop. I'm still learning this type of coding so I was wondering if someone could help me find a way to make this code more efficient. Thanks!
$sql = "SELECT * FROM user ORDER BY timestamp DESC LIMIT 1";
$result = $mysqli->query($sql);
$row_lastone = mysqli_fetch_array($result);
$timestamp_lastone = date_parse($row_lastone['timestamp']);
$month_lastone = $timestamp_lastone['month'];
$year_lastone = $timestamp_lastone['year'];
if ($month_lastone==1){
$lastone_month = "January";
} | {
"domain": "codereview.stackexchange",
"id": 3256,
"lm_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, mysql, array",
"url": null
} |
python, game, dice
(Any other comment, criticism, suggestion is most welcome.) Style review of current code
Reading up on PEP8 is never a bad thing. Mostly your code is clean, but there are several enhancements which can be made. | {
"domain": "codereview.stackexchange",
"id": 16790,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, game, dice",
"url": null
} |
newtonian-mechanics, forces, free-body-diagram, string
Title: Understanding tension based on assumptions of pulley system If we consider a simple pulley system with two masses hanging on each end of a MASSLESS and INEXTENSIBLE string around a MASSLESS and FRICTIONLESS pulley, how then can one reason that the tension at each end of the string must be the same?
My own reasoning:
MASSLESS ROPE means that for any segment of the rope with tension $T_1$ and $T_2$ we have that $\sum F = T_ 2 - T_1 = 0$ (since $m = 0$) and thus the tensions must be the same, on a non curved rope at least!
INEXTENSIBLE means that no energy can be stored in the string, however I fail to see how this is a neccesary condition (for equal tension)
MASSLESS PULLEY means that no rotational inertia exists, and thus no force can alter the tension of the string (?)
FRICTIONLESS PULLEY is hard for me to figure. | {
"domain": "physics.stackexchange",
"id": 33794,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, forces, free-body-diagram, string",
"url": null
} |
general-relativity, forces, spacetime, vector-fields, interactions
If this field can be constructed from the geodesic equation, what would the acceleration field look like as a four-vector?
If we assume a Schwarzschild metric:
$$ds^2 = - (1-\frac{r_s}{r})c^2 dt^2 + \frac{1}{1-\frac{r_s}{r}} + r^2 d\Omega^2, $$
And substitute the metric into the geodesic equation:
$$
{d^2 x^\mu \over d\tau^2} =- \Gamma^\mu {}_{\alpha \beta}{d x^\alpha \over d\tau}{d x^\beta \over d\tau},
$$
Is it possible to get into the form:
$$ {d^2 x^\mu \over d\tau^2} = F(x^\mu)~? $$ Yes. This is the meaning of the equivalence principle, and it is recognised in the weak field limit. We take space as flat, and the result of small variations in time is that gravity appears as an inertial force causing acceleration to appear in the geodesic equation. The Newtonian approximation then shows a Newtonian potential as an approximate solution to Einstein's equation for gravity.
Consider a Schwarzschild geometry. Then you can write the equations of motion | {
"domain": "physics.stackexchange",
"id": 66026,
"lm_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, spacetime, vector-fields, interactions",
"url": null
} |
quantum-mechanics, physical-chemistry, density-functional-theory
Title: Definition of electron density in DFT I read that the electron density used for density functional theory in a system of $N$ electrons with wavefunction $\psi$ is defined as
$$\rho(r)=N\int d^3r_2\dots d^3r_N \psi^*(r,r_2,\dots r_N)\psi(r,r_2,\dots r_N) $$
this definition seems weirdly asymmetrical to me. Why is the first coordinate special? How can I interpret this definition physically? The total density is the sum of each particle's density $\rho(r) = \sum_i^N \rho_i(r)$ with
$$
\rho_i (r) = \int d^3r_1...d^3r_{i-1}d^3r_{i+1}...d^3r_n |\psi(r_1, ... r_{i-1}, r, r_{i+1}, ..., r_n)|^2.
$$
In DFT, the wave function is a Slater determinant and is thus antisymmetrized, reflecting the indiscernibility of fermions as $\rho_i(r) = \rho_1(r)$. We find
$$
\rho(r) = N\rho_1(r)
$$
which is another form for your equation of $\rho(r)$. | {
"domain": "physics.stackexchange",
"id": 64283,
"lm_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, physical-chemistry, density-functional-theory",
"url": null
} |
cc.complexity-theory, reference-request, graph-algorithms, machine-learning, st.statistics
Title: Theoretical guarantees for running times of belief propagation methods? Belief propagation has been shown to be a very powerful method through research in probabilistic graphical models.
However, I don't know anything about BP that's comparable to MCMC methods where we can have fully polynomial randomized approximation schemes (FPRAS) for #P-complete problems.
Could someone point me to some references? Here's a paper where the authors used BP to obtain a fully polynomial-time randomized approximation scheme for the the capacitated minimum-cost network flow problem. | {
"domain": "cstheory.stackexchange",
"id": 2326,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cc.complexity-theory, reference-request, graph-algorithms, machine-learning, st.statistics",
"url": null
} |
general-relativity, differential-geometry
Edit
if you have Mathematica available, here is a notebook with the detailed calculation, with explanations:
https://github.com/CharlesJQuarra/GravitationCalcs/blob/master/GravWaveAnalysis.nb
If someone wants to improve on it or propose changes, please, send me a pull request The problem here is that in general case, a metric with some given coordinate dependence, will contain a priori both TT (Traceless-Traverse) fields that correspond to propagating fields, and "non-TT" fields that demand sources to be distributed on the spacetime
When one does the process of collapsing a metric to the TT "gauge" (notice the very intentional double quotes) one is essentially killing all matter sources from the metric coordinates, and just keeping the propagating transverse degrees of freedom.
Once one does this collapse operation, then it becomes easy to verify that the Ricci tensor (and by implication, the Einstein tensor as well) will vanish. | {
"domain": "physics.stackexchange",
"id": 27683,
"lm_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, differential-geometry",
"url": null
} |
P.S. @user17762 has provided a genius way to handle this kind of series and his approach could simplify the calculation of $\sum_{n=1}^{\infty}n q^{n-1}$ too. Just watch the first two steps he used.
-
Welcome to Math.SE! Please, consider updating your question to include what you have tried / where you are getting stuck. You will find that people on this site will be significantly faster to help you if you do that; that way, we know exactly what help you need. – Did Sep 14 '13 at 16:13
Do you mean $n^2(q^n-1)$ or $(n^2q^n) - 1$? Notationally, the latter is more usual, but I suspect you meant the former. Also, notice that when $q = 10$ the sum is obviously infinite, so make sure you aren't missing out any important details. – Ben Millwood Sep 14 '13 at 16:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513905984457,
"lm_q1q2_score": 0.8362245784236473,
"lm_q2_score": 0.8479677526147223,
"openwebmath_perplexity": 188.97920009645338,
"openwebmath_score": 0.9291566610336304,
"tags": null,
"url": "http://math.stackexchange.com/questions/493519/calculate-sum-n-1-inftyn2qn-1/493558"
} |
6. Alright, now I got it for sure, thanks.
Not sure if you want to help with another problem, but I was also confused with this one, which deals with similar solving techniques, I think...
6. Consider a \$1000 investment that is compounded annually at three different interest rates: 5%, 5.5%, and 6%.
a. Write and graph a function for each interest rate over a time period from 0 to 60 years.
b. Compare the graphs of the three functions.
c. Compare the shapes of the graphs for the first 10 years with the shapes of the graphs between 50 and 60 years.
I think the functions are (for problem 'a'):
y = 1000(1 + .05)^60
y = 1000(1 + .055)^60
y = 1000(1 + .06)^60
Does that look correct?
Now for problem 'b', if I'm not mistaken, just look like horizontal lines waaay up on the y-axis.
One of the graphs, for the first equation I gave, looks like this: http://www.wolframalpha.com/input/?i=graph:+y+%3D+1000(1+%2B+.05)^60 | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474872757474,
"lm_q1q2_score": 0.8950137286781206,
"lm_q2_score": 0.9046505299595162,
"openwebmath_perplexity": 1187.416238672969,
"openwebmath_score": 0.6640046238899231,
"tags": null,
"url": "http://mathhelpforum.com/algebra/134779-compounding-interest-problem-help.html"
} |
quantum-mechanics, thermodynamics, statistical-mechanics, condensed-matter
I know the ground state is supposed to have $T = 0 K$, but that's all I could think of. The Internet is not giving me much more information.
Edit: Ofcourse I am talking about a certain many-body system with a corresponding Hamiltonian, which should be non-integrable and chaotic. This way the system will thermalize (in most cases) following the Eigenstate Thermalization Hypothesis. You could take the 1D spin chain non-integrable Ising model as example. The same question could be asked in classical physics: What is the temperature of a specific microstate of an ideal gas? Conceptually, the answer to the quantum version is essentially the same as the answer to the classical version. | {
"domain": "physics.stackexchange",
"id": 65914,
"lm_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, thermodynamics, statistical-mechanics, condensed-matter",
"url": null
} |
c#, strings, interview-questions
In your solution, you have used two HashSets (of TreeNodes and chars). I don't understand what the Index set is for, as you didn't include your code for adding nodes. The bigger problem I see here is the type HashSet itself: They describe unordered lists of stuff ("sets"), and you are trying to access them using an indexer (e.g. root.Nodes[str[currentIndex]]). This will not only give unpredicted results, it won't even compile. There is no indexer on HashSet.
What you actually want to use here is a Dictionary. Looking at the graph above, we seem to be navigating along using characters. That means, in every node, having one character we can determine the next node to go to. A dictionary can do that for us.
The whole thing | {
"domain": "codereview.stackexchange",
"id": 11427,
"lm_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#, strings, interview-questions",
"url": null
} |
ros2, ros-bouncy
Comment by lucasw on 2019-01-17:
Updated answer with crystal specific launch file including and argument setting.
Comment by William on 2019-01-17:
Let me see if I can put together a simple example. It's possible there's a feature missing somewhere that prevent this, though my recollection is that it should be possible.
Comment by M@t on 2021-04-28:
I don't quite understand this example. What is ThisLaunchFileDir()?
Comment by morten on 2021-09-30:
Were you ever able to get the value of the argument during the execution of the launch file?
Comment by 130s on 2023-04-07:
Marked as answer. Years later I found a tutorial that essentially explains the same as this answer. To honor the answer I added a link to the body of the answer instead of adding a new answer. | {
"domain": "robotics.stackexchange",
"id": 31971,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros2, ros-bouncy",
"url": null
} |
How to compute the decimal digits of irrational number(non-transcendental) with an arbitrary precision?
eg. Expansion of $\sqrt{ 2}$ with a precision of 500.
-
Some irrational numbers are easier to compute than other irrational numbers. Do you really want to talk about all irrational numbers, or just certain types of them (like the roots of polynomials, for example?) – Thomas Andrews Apr 23 '12 at 14:50
There are a few methods: find an approximate sequence, use continued fraction expansion. And after that you need to program the algorithm in a good programming language. I think that the easiest one for this purpose is Pari/GP, which will give you the result for free. – Beni Bogosel Apr 23 '12 at 14:50
Non-trancendental numbers. – Guru Prasad Apr 23 '12 at 14:50
@GuruPrasad: i.e. roots of polynomials. – Beni Bogosel Apr 23 '12 at 14:53
@BeniBogosel: Can you explain how to do using continued fraction expansion? I'm at a loss here. – Guru Prasad Apr 23 '12 at 14:53 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924810166349,
"lm_q1q2_score": 0.8242182890222393,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 396.5831681402098,
"openwebmath_score": 0.8971530795097351,
"tags": null,
"url": "http://math.stackexchange.com/questions/135827/computing-decimal-digits-of-irrational-numbers"
} |
fft, analytic-signal, conversion
So what way i would be able to get the best approximation of my original signal?
Thanks in advance!!
PS: Hope this format is way better than before. First answer deleted since I completely misunderstood the question.
The problem here is that apparently you are missing one frequency point. From the question it's not clear what is missing. You say you have the points from 0 to N/2. That's actually N/2+1 (if 0 and N/2 are included) and all you need. If that's not the case, there are gew possibilities | {
"domain": "dsp.stackexchange",
"id": 1108,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, analytic-signal, conversion",
"url": null
} |
algorithms, arrays
Title: Should check all $2^n$ possibilities in array? Suppose I have an array of numbers, and a function boolean isPrime(int n) that I'm allowed to use.
Boolean isPrime(int n) receives a number n and return true if the received number is a prime and false otherwise.
I need to write a function int foo(int[] a) that receives the given array and return the biggest prime number that I can "create" by adding values from the given array.
For example: for the array 8,11,8,2 the function foo should return 19
It's not a homework or something, I noticed that in a lot of job exams there is this type of question. It looks simple and naïve, but it's not.
There are a lot of possibles, for array with size $n$ the are $2^n$ possible combinations.
In the given example the possibilities are:$\{8,11,2,8+11,8+8,8+2,8+11+8,\dots\}$ | {
"domain": "cs.stackexchange",
"id": 10417,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, arrays",
"url": null
} |
homework-and-exercises, electromagnetism, magnetic-fields
Title: How does magnatic flux conservation work for semi-infinite solenoid? From the equation of $\Phi_B$ for a region
$$\Phi_B=\int_Vd^3r \nabla\cdot B=0$$
, it gave a sense of magnetic flux conservation, just like electric flux in a region of space without charge.
However, consider an infinite solenoid cut in half. It's easy to see that the magnetic flux at the cutted open surface was only half of that inside.
How's that possible? where did the magnetic flux go in at the open of semi-infinite solenoid? "where did the magnetic flux go in at the open of semi-infinite solenoid?"
It escaped through the curved surface of the solenoid near the geometrical "North pole" end of the solenoid. Roughly half the flux that enters the half-solenoid from the other half leaves the half-solenoid through its open end, the other half leaves through the curved surface. | {
"domain": "physics.stackexchange",
"id": 63019,
"lm_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, electromagnetism, magnetic-fields",
"url": null
} |
Last edited: Sep 14, 2014
2. Sep 14, 2014
### pasmith
The least upper bound axiom states that if $A \subset \mathbb{R}$ is bounded above then it has a supremum $M$. If it happens that $M \in A$ then $M$ is the maximum of $A$, but it may be that $M \notin A$ in which case $A$ has no maximum.
To your example: try summing the geometric series $$a_N = \sum_{n=1}^N \frac{2}{10^n} = 2 \sum_{n=1}^N \frac{1}{10^n}$$ for fixed $N$. Then consider what happens if you make $N$ arbitrarily large.
3. Sep 14, 2014
### HallsofIvy
Let x= 0.2222....., never ending.
Then 10x= 2.222...., still never ending.
Subtracting, 9x= 2.
4. Sep 14, 2014
### Ray Vickson
Of course there IS a sup in this case; I don't know why you think otherwise. In fact, it is a property of real numbers that any bounded set of real numbers has a supremum. However, maximum and supremum need not be the same thing. In this case the set has no maximum, but that does not matter for the problem at hand. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232945094719,
"lm_q1q2_score": 0.8035312423837735,
"lm_q2_score": 0.817574478416099,
"openwebmath_perplexity": 317.83577188213843,
"openwebmath_score": 0.8352879881858826,
"tags": null,
"url": "https://www.physicsforums.com/threads/supremum-of-set.770733/"
} |
c, unit-conversion
int main(int argc, char *argv[]) {
if(argc == 1) {
HELP;
exit(argc);
}
else {
char arg = '\0';
while((arg = getopt(argc, argv, OPTS)) != -1)
{
switch(arg) {
case 'c':
if(optarg == NULL)
{
HELP;
exit(1);
}
else {
printc(FLOATARG);
}
break;
case 'f':
if(optarg == NULL)
{
HELP;
exit(1);
}
else {
printfahr(FLOATARG);
}
break;
case 'h':
HELP;
break; | {
"domain": "codereview.stackexchange",
"id": 26930,
"lm_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, unit-conversion",
"url": null
} |
• (+1), and I certainly don't mind. It's a nice answer. – user296602 Apr 17 '18 at 3:42
• @user296602: Thank you my friend. It's hard not to duplicate your words, word-for-word, when the logic is so simple. Cheers! – Robert Lewis Apr 17 '18 at 3:47
• I see. I really am an overthinker. Thank you and everyone who answered – ElMenduko Apr 17 '18 at 11:04
Recall
$$det(AB) = det(A)det(B)$$ $$AA^{-1}=I \iff \text{ A is invertible.}$$ Suppose $A$ is an invertible matrix. Note that if $A$ is invertible, then it follows that $A \neq 0$. So
$$det(A)det(A^{-1}) = 1.$$ Suppose $det(A) = 0$. Then $$0 = 1$$ Which is a contradiction. Then $det(A) \neq 0$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.981735721648143,
"lm_q1q2_score": 0.8202240352341537,
"lm_q2_score": 0.8354835391516133,
"openwebmath_perplexity": 194.33921469355943,
"openwebmath_score": 0.9169889688491821,
"tags": null,
"url": "https://math.stackexchange.com/questions/2740808/simpler-proof-that-det-a-neq-0-if-a-is-invertible"
} |
python, performance, numpy
Next up on the list is the expectation step. Again, funny mix-up of Python and numpy/scipy code here. And although I have the strong feeling that there has to be a better solution, the following is the best I could come up with at the moment:
sigma_initial = np.sqrt(initial_parameters[1, :])
# ... other code ...
# Expectation step
indicator_normalized = np.empty((range_of_i, no_distributions, range_of_m))
for i in range(range_of_i):
indicator = np.array([
pi_initial[l] * norm.pdf(alphas[i], mu_initial[l], sigma_initial[l])
for l in range(no_distributions)
])
indicator_normalized[i, ...] = indicator / indicator.sum(axis=0)
indicator_normalized = indicator_normalized.transpose(0, 2, 1)
# summing over multiple axis needs numpy >= 1.7
indicator_sum = indicator_normalized.sum(axis=(0, 1)) | {
"domain": "codereview.stackexchange",
"id": 35189,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, numpy",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.