text
stringlengths
49
10.4k
source
dict
dimensional-analysis $$\frac{8.1 \lambda 10^{19}}{1.99} s^{-1} cm^{-2} eV$$ which is much closer but again the $eV$ are killing me. Help, please! Let's start from the beginning. On the one hand, you can get the power per unit area between two wavelengths $\lambda_1$ and $\lambda_2$ by integrating power per unit area per unit wavelength against wavelength: $$ \frac{P}{A} = \int_{\lambda_1}^{\lambda_2} \underbrace{F_\lambda}_{(\mathrm{kW}/\mathrm{m}^2)/\mu\mathrm{m}} \ \underbrace{\mathrm{d}\lambda}_{\mu\mathrm{m}}. $$ Now what rate $R$ of photons would you see in this band, per unit area? The answer is you have to divide the integrand by the energy per photon before integrating: $$ \frac{R}{A} = \int_{\lambda_1}^{\lambda_2} \frac{F_\lambda}{E} \ \mathrm{d}\lambda. \tag{1} $$ On the other hand, you have another way of thinking about the rate. In this case you can bin based on energy (in $\mathrm{eV}$) rather than wavelength. I'll call the measure of counts per unit area per unit time per energy bin by the symbol $G_E$ in analogy with $F_\lambda$.1 Then $$ \frac{R}{A} = \int_{E_2}^{E_1} \underbrace{G_E}_{(1/(\mathrm{cm}^2\cdot\mathrm{s}))/\mathrm{eV}} \ \underbrace{\mathrm{d}E}_{\mathrm{eV}}. $$
{ "domain": "physics.stackexchange", "id": 6108, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dimensional-analysis", "url": null }
quantum-mechanics &=\left|\phi_{\text{orbital}}\right\rangle\otimes\left(S_z\left|s,m\right\rangle\right)\\ &=m\hbar\left|\phi_{\text{orbital}}\right\rangle\otimes\left|s,m\right\rangle\\ \end{align} I don't know all of the details of the exact calculations of Helium ground and excited states, or the energies however.
{ "domain": "physics.stackexchange", "id": 35655, "lm_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", "url": null }
quantum-mechanics, wavefunction, hilbert-space, complex-numbers $$ satisfying $JJ=-I$ and $J^*=-J$ (like the imaginary unit). Given that, there is another idea concerning real quantum mechanics. I mean a formulation where pure states are vectors up to signs (the phases of real numbers). Observables are here every self-adjoint operator. This is a deeply different formulation which does not match with the previous one and is permitted by famous Solér's theorem. (A third formulation concerns Hilbert spaces constructed using quaternions in place of real or complex numbers.) All fundamental theorems (as Stone's, Gleason's, Kadison's and Wigner's theorem) hold true also with a completely real formulation of this sort. A difficult problem with this intrinsically real formulation is that the relation between continuous symmetries and constants of motion is no longer automatic, since continuous symmetries $\{U_t\}_{t\in \mathbb R}$ are generated (Stone's theorem) by anti self-adjoint operators $A$ $$U_t= e^{tA}$$ exactly as in the complex case, but there we can re-define $$A= iA'$$ and $A'$ is self-adjoint. With the real formulation $i$ does not exist, but can be replaced for an antiself-adjoint operator satisfying $JJ=-I$, commuting with time evolution and all the relevant observables. This operator (if any) must be provided by physics. The overall physical problem is: if the intrinsic real formulation is mathematically permitted, why no known physical system is described by it? This is a long standing issue which can be traced back to Stueckelberg who referred to Heisenberg principle (where $i$ explicitly shows up) to rule out real formulations. In my view this approach is not satisfactory because Heisenberg principle is not nowadays so fundamental tackling the problem form a fundamental viewpoint, and also Heisenberg principle holds for massive particles only.
{ "domain": "physics.stackexchange", "id": 46907, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, hilbert-space, complex-numbers", "url": null }
c++, c++11, reinventing-the-wheel, queue // element access: reference operator[](size_type n); const_reference operator[](size_type n) const; reference at(size_type n); const_reference at(size_type n) const; reference front(); const_reference front() const; reference back(); const_reference back() const; // modifiers: template <class... Args> void emplace_front(Args&&... args); template <class... Args> void emplace_back(Args&&... args); template <class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x); void push_front(T&& x); void push_back(const T& x); void push_back(T&& x); iterator insert(const_iterator position, const T& x); iterator insert(const_iterator position, T&& x); iterator insert(const_iterator position, size_type n, const T& x); template <class InputIterator> iterator insert (const_iterator position, InputIterator first, InputIterator last); iterator insert(const_iterator position, initializer_list<T>); void pop_front(); void pop_back();
{ "domain": "codereview.stackexchange", "id": 15224, "lm_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, reinventing-the-wheel, queue", "url": null }
algorithms, optimization, np-hard Title: Complexity of special instance of Knapsack Consider the following algorithmic task: Given: primes $p_1,\dots,p_k$, and positive integers $e_1,\dots,e_k$, and a positive integer $M$ Find: integers $d_1,\dots,d_k$ that maximize $\prod_i p_i^{d_i}$, subject to the requirements that $0 \le d_i \le e_i$ and $\prod_i p_i^{d_i} \le M$. What is the complexity of this problem? Is it NP-hard? This problem is equivalent to the following: Given: primes $p_1,\dots,p_k$, and positive integers $e_1,\dots,e_k$, and a positive integer $M$ Find: integers $d_1,\dots,d_k$ that maximize $\sum_i d_i \log p_i$, subject to $0 \le d_i \le e_i$ and $\sum_i d_i \log p_i \le \log M$. This can be seen to be an instance of bounded knapsack with $k$ items, where the $i$th item has weight $\log p_i$ and value $\log p_i$ and can be used at most $e_i$ times, and where the capacity of the knapsack is $\log M$. (See the footnote below for a more careful statement.) Thus, my problem is a special case of bounded knapsack. It follows that my problem is in NP. But is my problem NP-hard? For instance, is there a way to reduce from bounded knapsack to my problem? It's not clear, because my problem limits the weights and values to be something specific related to the log of primes, rather than arbitrary values.
{ "domain": "cs.stackexchange", "id": 5279, "lm_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, optimization, np-hard", "url": null }
ds.algorithms, graph-algorithms, ds.data-structures, partial-order Title: Verifying consistency of strict and non-strict partial orders constraints I am building a set of constraints of the kind $x < y$ and $x \leq y$, where $<$ is a strict order and $\leq$ is a non-strict order on the same set, and $x$ and $y$ are abstract variables representing elements of the set. The laws that relate the two orderings are the same as $<$ and $\leq$ for integers. I need to make sure that each constraint that I add does not make the set inconsistent (e.g. adding $x < y$ and then $y < x$ I'd get an error). Now, if I had only the $<$ constraints I could get away with generating a graph and then doing a topological sort, or with disjoint-sets. The problem is that I'm not sure how to handle the additional $\leq$ constraints. One idea is to express $x \leq y$ as $\neg (x > y)$, and to keep two graphs: one for the actual $<$ relations and one for the negated ones. Then we'd need to check, at each new constraints, whether there are overlapping paths between the two graphs, in which case we'd have a problem. However this seems rather costly since it seems to me that we'd need to analyze all the pairs each time. Another idea would be to 'collapse' $\leq$ relations to equalities or $<$ when needed, but again I'm quite uncertain on the details. Is this problem described somewhere? As a bonus, I'd like the data structures involved to be purely functional. You may find it helpful to think of your problem in terms of equalities and strict inequalities. In the case of the constraints being equalities or disequalities there is a simple saturation procedure based on transitivity of equality. Strict inequalities can be represented by directed edges in a graph. You can then compute strongly connected components to reason about dependencies between sets of variables. If you have uninterpreted functions, you can use congruence closure.
{ "domain": "cstheory.stackexchange", "id": 2007, "lm_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, graph-algorithms, ds.data-structures, partial-order", "url": null }
ros2 Title: ROS2 or ROS alternative or evolution ROS2 will replace ROS or will the two platforms exist? Originally posted by mag.rod on ROS Answers with karma: 58 on 2018-02-13 Post score: 0 It is likely that ROS 1 and ROS 2 will coexist for a very long time. Ultimately ROS 2 is supposed to "replace" ROS 1 but there is currently no plan to discontinue ROS 1. That being said at least in the ROS 1 base packages not much feature development is being done (especially by OSRF) in favor of focusing the resources on ROS 2. Originally posted by Dirk Thomas with karma: 16276 on 2018-02-13 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by mag.rod on 2018-02-14: I think that the change to ROS 2 should be a very substantial change in the base, otherwise it would be logical to remodel ROS 1. This means that the knowledge about ROS 1 will not be useful for ROS 2? Comment by Dirk Thomas on 2018-02-14: I don't think this is a valid conclusion. ROS 2 shares a lot of concepts with ROS 1 and those are valuable knowledge across the different versions. For details on the rational why changes were not applied to ROS 1 please see the design doc. Comment by mag.rod on 2018-02-15: Ok, Thank you
{ "domain": "robotics.stackexchange", "id": 30031, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2", "url": null }
newtonian-mechanics, variational-calculus, statics Title: Mass Distribution to turn Hanging Chain into Parabola I've learned recently about how a uniform chain hanging between two points will form a catenary curve (of the form $a \cdot \cosh (\frac{x}{a})$), and I reflected on the fact that this is only because of the fact that the chain has a uniform mass density. I then reasoned that a chain with a non-uniform mass density would have another shape when hung between two poles. Specifically, there must exist some mass distribution such that the hanging chain would form a parabola. However, I am unsure how to find this mass distribution. Does anyone know what this mass distribution is, or how I would go in the right direction of finding it? As discussed here, for example, one obtains a parabolic shape from a hanging chain if the vertical load is constant regardless of the slope of the chain. The reason is that a horizontal force balance anywhere gives $T\cos\theta=T_0$, where $T$ is the tension, $\theta$ is the angle with the horizontal, and $T_0$ is the tension at the (symmetric) center at the origin. A vertical force balance anywhere gives $T\sin\theta=wx$, where $w$ is the weight per horizontal distance. Dividing the latter by the former, we obtain $\tan\theta=\frac{dy}{dx}=\frac{wx}{T_0}$, which we can integrate to obtain a parabola $y\sim x^2$.
{ "domain": "physics.stackexchange", "id": 85150, "lm_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, variational-calculus, statics", "url": null }
c#, casting, polymorphism Title: Changing the type of an object inside a method? First off, this is not my code. I'm curious what everyone thinks about changing the type of an object inside of a method then modifying the properties of the cast type. I wanted to use composition to build up a patient, but this is the recommend path. I'm probably wrong which is why I wanted 3rd party feedback. Or maybe we just have different coding styles... // Person/Patient Builder public static void BuildUpPersonOrPatient(Person person, Dictionary<string, string> row) { person.FirstName = row["FirstName"]; person.LastName = row["LastName"]; Patient patient = person as Patient; if (patient != null) { patient.PatientID = row["PatientID"]; } } for reference public class Person { public string FirstName { get; set; } public string LastName { get; set; } } public class Patient : Person { public string PatientID { get; set; } } // // It stead of having a static method the basically does what polymorphism could do for you use polymorphism. public class Person { public string FirstName { get; private set; } public string LastName { get; private set; } public virtual void InitializeFromDictionary(Dictionary<string, string> row) { FirstName = row["FirstName"]; LastName = row["LastName"]; } } public class Patient : Person { public string PatientID { get; private set; } public override void InitializeFromDictionary(Dictionary<string, string> row) { base.InitializeFromDictionary(row) PatientID = row["PatientID"]; } } and then where ever you call BuildUpPersonOrPatient(p,row); do this instead p.InitialieFromDictionary(row); I've added an access modifier to the setters because unless you have a reason to be able to change those fields from outside the object you should encapsulate the possibility of chaning the state of an object. (It's surprising how seldom you have a modeling reason for that and not just a "for conviniece" reason)
{ "domain": "codereview.stackexchange", "id": 8442, "lm_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#, casting, polymorphism", "url": null }
python, exception-handling, mongodb """ method description: return application consumer key input: None output: String """ def getApplicationConsumerKey(self): return self.getConfig().application_consumer_key """ method description: return application consumer secret input: None output: String """ def getApplicationConsumerSecret(self): return self.getConfig().application_consumer_secret """ method description: confirms if 6 argumets are sent input: None output: Boolean """ def checkArgumentsLength(self): if len(sys.argv) == 7: return True else: return False """ method description: returns keyword input: None output: String """ def getKeywordsIds(self): return sys.argv[3].split('%') """ method description: returns environment of execution input: None output: String """ def getEnvironment(self): return sys.argv[1] """ method description: returns debugger object input: None output: importlib object: debugger """ def getDebugger(self): return importlib.import_module('config_files.debugger') """ method description: returns keyword from keyword ids input: None output: List of Strings """ def getKeywords(self): keywords = [] obj = MongodbConnections(self.getEnvironment()) for keyid in self.getKeywordsIds(): try: word = obj.getKeywordIndexCol().find_one({'keyid':keyid})['keyword'] self.getDebugger().info([keyid, word], self.getConfig().debug) keywords.append(word) except: return False
{ "domain": "codereview.stackexchange", "id": 6864, "lm_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, exception-handling, mongodb", "url": null }
Some interesting example hands: Among the hands that have solutions, I've chosen to highlight a few particularly interesting ones: [13,11,10,6], [13,6,1,1], [13,12,10,8], [11,11,5,5], [11,11,5,1], [9,7,7,7], and [5,1,1,1] If you want to challenge yourself, see if you can solve these before looking at the solutions. [13,11,10,6] This is the only hand that requires a factorial of a number bigger than 10: $$24 = \left(\frac{13 + \frac{11!}{10!}}{6}\right)!$$ [13,6,1,1] This and [9,8,1,1] are the only ones that require use of exponentiation: $$\begin{eqnarray} 24&=&\left(\frac8{1+1^9}\right)!\\24&=&\left(6 - 1^{13} - 1\right)! \end{eqnarray}$$ [9,7,7,7] This hand has only one possible solution, and is an interesting example of one which requires factorials but doesn't use $$4!=24$$. $$24 = \frac{9!}{7!+7!+7!}$$ If you disallow factorials, there are fully 430 unsolvable hands (not counting suits). Some of my favorite solutions without factorials include [11,11,1,5], [13,12,10,8], [11,11,5,5] and [5,1,1,1], which have the following unique non-factorial solutions: [13,12,10,8] $$24=\frac{10\cdot 12}{13-8}$$ [11,11,5,5] $$24=5\cdot5-\frac{11}{11}$$ [11,11,5,1]
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9697854146791214, "lm_q1q2_score": 0.8223467697819382, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 1026.5713177308312, "openwebmath_score": 0.6786034107208252, "tags": null, "url": "https://math.stackexchange.com/questions/2785407/proof-of-solutions-to-24-operations-game/2785838" }
quantum-mechanics, wavelength Title: What is the physical significance of Compton wavelength? Wikipedia says, The Compton wavelength represents the quantum response of mass to local geometry. What does it actually mean? Another, better way, (because imo, the wiki line you quote is a bit obscure) of dealing with your question is based on John Baez's Notes: The Compton wavelength of a particle, roughly speaking, is the length scale at which relativistic quantum field theory becomes crucial for its accurate description. A simple way to think of it is this. Trying to localize an electron to within less than its Compton wavelength makes its momentum so uncertain that it can have an energy large enough to make an extra electron-positron pair! This is the length scale at which quantum field theory, which describes particle creation, becomes REALLY important for describing electrons. The Compton wavelength of the electron is the characteristic length scale of QED (quantum electrodynamics). It's easy to guess how big the Compton wavelength is using the knowledge that it depends only on the mass of the electron, relativity and quantum mechanics. Mass has dimension M. Length has dimension L. Time has dimension T. In relativity we have a constant, the speed of light, with dimensions L/T, and in quantum mechanics we have a constant, Planck's constant, with dimensions ML2/T = energy times time = momentum times position. These two constants enable us to express units of mass in terms of dimensions of inverse length. In this case, the Compton wavelength is about 4 × 10$^{-13}$ meters. In fact, this is usually called the "reduced" Compton wavelength. What people usually call the Compton wavelength is 2π times as big, about 2 × 10$^{-12}$ meters. That's because the wavelength of a wave is really not the reciprocal of its frequency: it's 2π divided by the frequency.
{ "domain": "physics.stackexchange", "id": 95299, "lm_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, wavelength", "url": null }
glaciology, antarctic, ice, sea-ice, ice-shelf Title: Is this 70km crack in an ice shelf of Antarctica remarkable, or a regular occurrence? I've just seen the LiveScience article 70-Mile-Long Crack Opens Up in Anatarctica. I'm not sure if the title is a bit sensational or not, the crack is in an ice shelf, not the continent of Antarctica. An ominous crack in an Antarctic ice shelf as wide as a football field is long takes on an otherworldly beauty in a new aerial image. Snapped by scientists on NASA's IceBridge mission, the shot shows a rift in Larsen C, an ice shelf that is floating off the Antarctic Peninsula. When the crack eventually spreads across the entire ice shelf, it will create an iceberg the size of the state of Delaware, according to IceBridge. That's around 2,491 square miles (6,451 square kilometers). As of Nov. 10, when the IceBridge scientists observed this crack, it was 70 miles (112 km) long and more than 300 feet (91 meters) wide. The dark depths of the crack plunge down about a third of a mile (0.5 km), all the way through the ice to the ocean below. [...] Larsen C is Antarctica's fourth-largest ice shelf, and it holds back the land-based glaciers just behind it: Once the ice shelf goes, those slow-flowing glaciers have one less barrier in their journey toward the sea. My primary question: is this a remarkable event, or something that over time happens regularly? Isn't this just a natural part of "those slow-flowing glaciers... journey toward the sea." ? I'm also wondering 1) Is an iceberg the size of Delaware actually remarkable, or something that just happens from time-to-time? And 2) how they (actually) know the crack goes all the way to the ocean - can they actually see the water in images, or is this a hypothesis based on understanding of cracks of this length and width? I can ask as a separate questions if it's too much to ask here. above: Image from here. "A huge crack can be seen in the Antarctic Peninsula's Larsen C ice shelf in this aerial image snapped on Nov. 10, 2016, as part of NASA's IceBridge mission. Credit: NASA/John Sonntag"
{ "domain": "earthscience.stackexchange", "id": 981, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "glaciology, antarctic, ice, sea-ice, ice-shelf", "url": null }
the vertices, where the weights are the lengths of the corresponding sides. This point of concurrency is called the incenter of the triangle. Find ,nLADC. Then, as , it follows that and consequently pentagon is cyclic. The centroid is _____ in the triangle. The incenter is deonoted by I. The altitudes of a triangle are concurrent. The perpendicular bisectors of a triangle are concurrent. It's well-known that , , and (verifiable by angle chasing). If. The incenter point always lies inside for right, acute, obtuse or any triangle types. This point is another point of concurrency. 2. Use the following figure and the given information to solve the problems. The incenter of a triangle is the intersection point of the _____ bisectors. 26 degrees. It is also the interior point for which distances to the sides of the triangle are equal. The incenter is always located within the triangle. a triangle ; meet at a point that is equally distant from the three side ; of the triangle. AD and CD are angle bisectors of AABC and ,nLABC = 1000. If your answer is yes, that means the manufacturer of clock has used concept of incenter to make sure center of clock coincides exactly with the incenter of the triangle inside which the clock is inscribed. Added 5 minutes 54 seconds ago|1/22/2021 7:06:36 AM Answers and Explanations. One of the problems gives a triangle and asks you to construct the incenter, or as it is put, "the intersection of angle bisectors." Centroid Circumcenter Incenter Orthocenter properties example question. A bisector of a triangle converges at a point called triangle incenter that is equally distant from the triangle sides. It's been noted above that the incenter is the intersection of the three angle bisectors. Read and complete the proof . If. Incenter-Incircle. Incenter of a Triangle . Remark Suppose r is the distance from the incenter to a side of a triangle. Incenter: Where a triangle’s three angle bisectors intersect (an angle bisector is a ray that cuts an angle in half); the incenter is the center of a circle inscribed in (drawn inside) the triangle. A right triangle has one
{ "domain": "com.br", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924802053235, "lm_q1q2_score": 0.8479150963784783, "lm_q2_score": 0.8723473829749844, "openwebmath_perplexity": 794.3205136913356, "openwebmath_score": 0.57602858543396, "tags": null, "url": "http://jacomo.com.br/68jn2db/89c8c6-incenter-of-a-triangle-problems" }
$$\displaystyle \frac{1}{z}-\frac{1}{x}=\frac{1}{yz}-\frac{1}{xy}$$ $$\displaystyle \frac{1}{z}-\frac{1}{x}=\frac{1}{y}\left(\frac{1}{z}-\frac{1}{x} \right)$$ Case [1] $$\displaystyle \frac{1}{x}-\frac{1}{z}=0$$ So $$\displaystyle x=y=z$$, Hence $$\displaystyle x^2+x=6$$ and we have the solutions $$\displaystyle (2,2,2),(-3,-3,-3)$$. Case [2] $$\displaystyle \frac{1}{x}-\frac{1}{z}\neq 0$$ Then $$\displaystyle y=1$$ so we have $$\displaystyle \frac{1}{x}+\frac{1}{z}=1+\frac{1}{xz}$$ or $x(1-z)=1-z$ then it is immediate that either $$\displaystyle x=1$$ or $$\displaystyle z=1$$ By symmetry of solutions we have $$\displaystyle (1,1,5),(1,5,1),(5,1,1)$$ #### anemone ##### MHB POTW Director Staff member Hello. $$z=6-xy$$ $$6y-xy^2+x=6 \rightarrow{}6(y-1)=x(y^2-1)$$ $$6=x(y+1)$$(*) $$6x-x^2y+y=6 \rightarrow{}6(x-1)=y(x^2-1)$$ $$6=y(x+1)$$(**)
{ "domain": "mathhelpboards.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811641488385, "lm_q1q2_score": 0.8335020026429172, "lm_q2_score": 0.8633916152464016, "openwebmath_perplexity": 1275.2611353928746, "openwebmath_score": 0.7787613868713379, "tags": null, "url": "https://mathhelpboards.com/threads/solving-system-of-equations.8521/" }
homework-and-exercises, fluid-dynamics, acoustics, shock-waves $$ Next we set Equation 2 equal to the altered version of Equation 0b and solve for $\gamma$. There are two solutions but only one of them is physically meaningful for a shock, i.e., a compressive sound wave where $\delta$ > 1. That solution is given by: $$ \gamma = \frac{ 1 - \delta }{ 2 \ \delta \ M_{2}^{2} - \left( 1 + \delta \right) } \tag{3} $$ If I use $\delta$ = 10.6 and $M_{2}$ = 0.495, then I get $\gamma$ ~ 1.499 or nearly 3/2. The typical monatomic gas approximation is $\gamma$ = 5/3 ~ 1.67 and for diatomic it goes as $\gamma$ = 7/5 ~ 1.4 (i.e., typical assumption for Earth's atmosphere). You can also look at some other variations on these expressions at https://physics.stackexchange.com/a/349724/59023 and https://physics.stackexchange.com/a/302879/59023.
{ "domain": "physics.stackexchange", "id": 63644, "lm_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, fluid-dynamics, acoustics, shock-waves", "url": null }
programming-languages, logic, type-theory, type-inference Computing the abstract interpretation of your program Computing loop invariants in an imperative language. With this in mind, here are a few disorganized references on the inference of refinement types. Note that there are many differing flavors of refinement types: I tend to be more interested in refinements of inductive datatypes, so this list may be skewed in that direction. Start with the classics: Relational Abstract Interpretation of Higher-Order Functional Programs by Cousot & Cousot. This explains how to extend abstract interpretation to higher-order programs using relational semantics. Liquid Types by Rhondon, Kawaguchi and Jhala. This is very evolved work, that combines HM and a type of predicate refinement to infer security annotations (array bound checks for instance) for ML style programs. The inference proceeds in 2 steps; the first is HM inference of type annotations, which guide the choice of refinements to perform. I should probably also mention the work by Fournet, Swarmy, Chen, Strub... on $F^*$, an extension of $F^\#$ which seems similar to the liquid types approach, but with the goal of verifying cryptographic protocols and algorithms for distributed computing. I'm not sure how much published work there is on the inference of annotations in this case. There is a nice paper by Chin and Khoo on inference of a specific kind of refinement types: types with size annotations. The ATS programming language is a system which allows various refinements and provides facilities for writing programs with them. However the annotations may be arbitrarily complex (and thus undecidable) and therefore may require user interaction. I believe that there is a form of inference for these types, I'm not sure which article to recommend however. Last, but not least The Cartesian Product Algorithm, by Ole Agesen. While not mentioning refinement types explicitly, this seems to be the work closest to solving the problem you seem to have. Don't be fooled by the mention of parametric polymorphism in the abstract: they look to infer concrete types, which are just tuples of possible atomic types. Emphasis is given on efficiency. I recommend reading this article first to see if it solves your problem.
{ "domain": "cs.stackexchange", "id": 392, "lm_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-languages, logic, type-theory, type-inference", "url": null }
c, beginner, parsing, pointers *w = '\0'; return word[0]; } There are 3 main cases: case 1: comments, if the first two characters are / and *. In this case the function should return when the corresponding * and / are met. case 2: string constants, if the first character is a ", then the function should return when the closing " is met. case 3: words that begin with #, _ and letters. In this case, the program should return when a character different that _ or an alphanumeric character is met. First, the program analyzes which case is. Based on that, "it knows" when to stop, then it returns the first character of that word. I don't didn't immediately see a bug in it and you're doing a lot of things well; so some minor comments. while(isspace((c = getch()))) ; This will often cause a compiler warning "possible missing or empty statement". If you use a compound statement instead that may suppress that warning: while(isspace((c = getch()))) { } int ordinaryKeyWord = 0; int comment = 0; int stringConstant = 0; These are mutually exclusive, so a 3-valued enum might be better. for(; --lim; w++) I don't think your lim testing is strict enough: for example if lim is 8 then /*this*/ would overrun (write past the end of) the input buffer; even an ordinaryKeyWord will write its last '\0' past the end of the buffer. return *--w; That's a bit tricky. It would be clearer to return word[0]; everywhere consistently. if(ordinaryKeyWord && (!isValidKeyWord(*w))) { ungetch(*w); break; } That's compact (few lines) but could be expanded to make the logic clearer for a tired reviewer: if(ordinaryKeyWord) { if (isValidKeyWord(*w)) { continue; } ungetch(*w); break; } if (stringConstant) { ... break or continue ...
{ "domain": "codereview.stackexchange", "id": 6585, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, beginner, parsing, pointers", "url": null }
Reference 1. Alster, K., The product of a Lindelof space with the space of irrationals under Martin’s Axiom, Proc. Amer. Math. Soc., 110 (1990) 543-547. 2. Engelking, R., General Topology, Revised and Completed edition, Heldermann Verlag, Berlin, 1989. 3. Hart, K. P., Nagata J. I., Vaughan, J. E., editors, Encyclopedia of General Topology, First Edition, Elsevier Science Publishers B. V, Amsterdam, 2003. 4. Miller, A. W., Handbook of Set-Theoretic Topology (K. Kunen and J. E. Vaughan, eds), Elsevier Science Publishers B. V., Amsterdam, 201-233, 1984. 5. Michael, E., Paracompactness and the Lindelof property in Finite and Countable Cartesian Products, Compositio Math. 23 (1971) 199-214. 6. Michael, E., The product of a normal space and a metric space need not be normal, Bull. Amer. Math. Soc., 69 (1963) 375-376. 7. Willard, S., General Topology, Addison-Wesley Publishing Company, 1970. ___________________________________________________________________________________ $\copyright \ \ 2012$ # Michael Line Basics
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429619433693, "lm_q1q2_score": 0.8278033273593683, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 239.6477656412658, "openwebmath_score": 0.995428204536438, "tags": null, "url": "https://dantopology.wordpress.com/tag/baire-category-theorem/" }
gazebo-4 Comment by K. Zeng on 2014-10-29: Any luck so far? Comment by scpeters on 2014-10-29: I can confirm that the meshes load in meshlab, but not in gazebo4. I'm going to add this to the gazebo issue tracker. Comment by K. Zeng on 2014-10-29: Would it be a good idea for me to downgrade to Gazebo 3 for the time being? Comment by scpeters on 2014-10-29: I didn't test gazebo3, since I didn't have it on my system, but gazebo3 is worth a shot, since I think most of the Collada changes happened in gazebo4. I've posted this as an issue on the gazebo issue tracker.
{ "domain": "robotics.stackexchange", "id": 3657, "lm_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-4", "url": null }
homework-and-exercises, thermodynamics Title: Is there a generic relationship between internal energy and entropy? For instance, I would like to compute the entropy $S$, given that the internal energy is expressed as: $$ E(V, T)=\sigma V T^{\frac{\alpha+1}{\alpha}} $$ I feel like there has to be a relationship between these two properties but I am unable to find it. It probably isn't possible to find the function $S(T,V)$, because entropy is integral of $dQ/T$ and from the given function $E(T,V)$ it isn't possible to find out how $dQ$ depends on $dV$ and $dT$. In other words, the given function $E$ isn't enough information about the system. It is possible to express function $S(T,V)$ by integrating $dQ/T$ for a process where $V$ is constant: $$ S(T,V) = S(T_0,V) + \int_{T_0}^T\frac{dE}{T} $$ The integral is a known function of $T,T_0,V$, but the term $S(T_0,V)$ is unknown function of $V$ and not findable from the given information. Some standard scenarios which allow computing entropy function of other variables are: energy depends only on temperature, not volume (ideal gas), plus we assumed entropy $S(kU,kV,kN) = kS(U,V,N)$; then one can express $dQ$ as function of $dT$ and calculate $S(T,V,N)$ and then $S(U,V,N)$; we have microscopic model of the system detailed enough that we can define $S(E,V)$ by $k_B\log W(E,V)$, where $W$ is measure of number of microscopic states that can realize macroscopic state $E,V$;
{ "domain": "physics.stackexchange", "id": 72911, "lm_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, thermodynamics", "url": null }
beginner, c, calculator } if (N == 2) { printf("[1] 0\n"); Sleep(75); printf("[2] 1\n"); Sleep(1075); } if (N == 3) { printf("[1] 0\n"); Sleep(75); printf("[2] 1\n"); Sleep(75); printf("[3] 1\n"); Sleep(1075); } if (N > 3) { printf("[1] 0\n"); Sleep(75); printf("[2] 1\n"); Sleep(75); } while (N > 3 && F <= N) { xy = x + y; printf("[%.0d] %.5g\n", Numbering, xy); Sleep(75); x = y; y = xy; F++; Numbering++; while (kbhit()) { system("COLOR B4"); printf("\n\n[+] Interrupted\n\nE to exit\nC to continue printing\n\nOption: "); scanf(" %c", & H); if (H == 'E') { printf("Exiting to main menu, in 2 seconds."); Sleep(2000); system("COLOR F1"); goto Start; } else if (H == 'C') { system("COLOR F1"); continue; } } } Sleep(1000); } else if (Opt == '4') { srand(time(NULL)); Choice = rand() % 3; if (Choice == 0) { a = rand() % 5001; b = rand() % 5001; c = a + b; printf("What is %d + %d?\nYour answer: ", a, b); scanf("%d", & d); if (d == c) { system("COLOR 2F"); printf("Yes. You are right; Congratulations\n\n"); system("pause");
{ "domain": "codereview.stackexchange", "id": 38878, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, c, calculator", "url": null }
c++, beginner, algorithm, programming-challenge, c++17 ","oidvllkv","dollikvv","kvillovd","odvlivkl","olkvdivl","voilldvk","lldokvvi","lvvikold","ivvloldk","ovdivlkl","idvvlokl","kvioldvl","vvkidlol","lvdkovli","oillvvkd","lodvlvki","vodllkvi","dvovlkil","kliovvld","dvlvloik","vklodilv","vlolidkv","vlidklvo","ivvodlkl","okivdllv","lodklvvi","kviolvdl","ovkivldl","ldkvlvoi","kdlvlvoi","ikovvldl","vvldloki","vlkvolid","ikvvoldl","divkllov","villvdko","diovkvll","vvdoilkl","vlidvlko","vvklldio","lkvidolv","ldivlvko","idkvlolv","odlikvvl","idovklvl","dl
{ "domain": "codereview.stackexchange", "id": 38967, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, algorithm, programming-challenge, c++17", "url": null }
c++, enum, qt, unit-conversion Is there any better way to tie values to each enum value in C++? In Java it is easy, because you can specify a constructor that requires certain parameters so you can be sure each enum value has an appropriate String and double value. Is there a way to do this in Qt/C++? Even if Java and C++ display some similarities, particularly in the syntax, they are widely different languages and translating one into the other isn't automatic. Java is chiefly object-oriented, while C++ is more of a multi-paradigm language; one could even argue that it's drifting away from the object-oriented model towards a more functional approach designed to take advantage of compile-time customization and calculations. So, it's best to take a step back and think again about your objectives and the means you have to achieve them when you transition from one to the other. What you seem to need is a mapping between a unit, a textual representation and a floating precision proportion. Java allows for float based enums, which are thus a good candidate -even if the textual representation needs to be addressed somewhere else- but C++ doesn't. On the other hand, in the most recent version of the C++ standard, you can create and manipulate arrays at compile-time: constexpr std::pair<std::string_view, float> weight_units[] { { "kg", 1. }, { "lb", 0.45359237 }, { "oz", 0.028349523125 }, }; constexpr auto weight_unit_value(std::string_view unit) { return std::find_if(std::begin(weight_units), std::end(weight_units), [unit](auto uv) { return uv.first == unit; })->second; }
{ "domain": "codereview.stackexchange", "id": 33729, "lm_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++, enum, qt, unit-conversion", "url": null }
quantum-mechanics, lagrangian-formalism, schroedinger-equation, variational-principle, ground-state Title: Understanding the Schrodinger's equation by variational principle I reviewed part of my notes in the quantum mechanics class, and still have a few questions about the variational derivation of the Schrodinger's equation: The variational principle says that the expectation value of $H$ in any state $⟨\psi|H|\psi⟩$ is greater or equal to the ground state energy $E_{min}$. Given the arbitrary state is normalized: $\int\psi(\vec{r})^*\psi(\vec{r}) d\vec{r} = 1$, the claim is that the Schrodinger's equation could be derived from the minimum of the integral: $\int\psi^*(\vec{r})H\psi(\vec{r}) d\vec{r}$. (My paraphrase might not be accurate.) How can I understand that? How's the derivation relevant to the Lagrangian in classical mechanics? Why do we care about that integral, and how's the integral relevant to the expression of expectation value? Thanks!! The spirit of the variational method in QM of the functional $S=\frac{\langle \psi| H-E |\psi\rangle}{\langle \psi|\psi\rangle}$ to find the groundstate wavefunction and groundstate energy, and the principle of stationary action in Lagrangian mechanics
{ "domain": "physics.stackexchange", "id": 95965, "lm_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, lagrangian-formalism, schroedinger-equation, variational-principle, ground-state", "url": null }
algorithms, data-structures, runtime-analysis Title: Running time of selection sort I wrote pseudocode for Selection Sort, but I'm not sure what is the running time of my algorithm, can you help me with that? My Pseudocode: Selection Sort(int a[], int n) Input: array of length $n$ Output: sorted array for r=1 to n min=a[r] for i=r to n if (a[i]<min) min=a[i] k=i a[k]=a[r] a[r]=min The external for takes $\Theta (n)$ but I'm not sure about the internal for because it depends on $r$. If the body of the outer loop gets executed $A$ times and the body of the inner loop gets executed $B$ times, then your algorithm runs in time $\Theta(A+B)$. After calculating $A$ and $B$, you will discover that $B$ grows faster than $A$, and so the running time of your algorithm is dominated by the number of times the body of the inner loop gets executed. It remains to calculate (or estimate) $A$ and $B$. You already mentioned that $A = n$. So all you need to complete the exercise is to calculate $B$, a task which I leave to you.
{ "domain": "cs.stackexchange", "id": 6299, "lm_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, data-structures, runtime-analysis", "url": null }
design, hydraulics Title: possibility for hydraulic accumulator with no moving parts? Some background for context only I am in the process of designing a pressure system where my pressurized fluid needs to be kept incredibly clean, with typical contaminants at the ppt or below level. The fluid in question is more compressible than a typical hydraulic fluid, so I need to build in an expansion volume for when I cycle to lower pressure. This expansion volume is going to look very much like a hydraulic accumulator. The most common hydraulic accumulators are pneumatic, and the gas charge is separated from the fluid by a bladder, diaphragm, piston, or metal bellows. All of these are problems for my cleanliness requirements, as the moving parts will tend to shed metal shavings, etc. The question My question is, why is the separation of the two volumes necessary? In my case, this is for a fixed piece of equipment, so I can guarantee that the accumulator will always be vertical. Can I just have a nitrogen-filled cylinder with the fluid connected at the bottom and rely on the fluid to act as my piston? If this does work, why isn't it more common? Edit to address some of the comments: I'm not asking for advice on how to design a clean accumulator; I only want to know the fairly general question of whether it is possible to not separate the charge gas from the fluid. gases are soluble in oils. this means that as your oil enters the gas-filled accumulator and the pressure in it builds up, gas will probably dissolve into the oil. Then, when you release the pressure on the system, the gas will boil out of solution and cause the oil to foam up vigorously. the foamy oil then enters your plumbing and creates big problems, especially if it is ingested by a pump.
{ "domain": "engineering.stackexchange", "id": 1758, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "design, hydraulics", "url": null }
# Spectrum of the right-shift operator on $\ell ^2 (\mathbb{C})$, and a general spectrum question Actually my question is about calculating the spectrum of any bounded operator. I know that if we have Banach spaces $\mathbb{E}$ and $\mathbb{F}$ over the field $\mathbb{K} = \mathbb{R}$ or $\mathbb{C}$, and a bounded operator $T: \mathbb{E} \rightarrow \mathbb{F}$, then the spectrum of $T$ is the set $$\sigma (T) = \{\lambda \in \mathbb{K}: \lambda I - T \text{ is not invertible}\}.$$ Also, I know the theorem stating that $\sigma (T) \subseteq B[0;||T||]$. I've seen similar questions here referencing things like point or residual spectrums, but I'm just thinking of the ordinary spectrum defined above. It's clear that all eigenvalues of $T$ are in its spectrum, because if $\lambda$ is an eigenvalue of $T$, $\lambda I - T$ is going to have a kernel that is not $\{0\}$. But otherwise I've got no idea how to calculate the rest of the spectrum. My particular question is probably quite easy: finding the spectrum of the operator $R: \ell^2 (\mathbb{C}) \rightarrow \ell^2 (\mathbb{C})$ given by $$R(z_1, z_2, z_3, \dots) = (0, z_1, z_2, \dots).$$ $R$ has no eigenvalues and $-R = 0T-R$ is invertible so $0 \notin \sigma(R)$. And $||R||=1$, so if $\lambda \in \sigma(R)$ we must have $|\lambda| \leq 1$, but otherwise I don't think I can say more.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9852713878802045, "lm_q1q2_score": 0.8100794192902494, "lm_q2_score": 0.8221891239865619, "openwebmath_perplexity": 243.91649550898705, "openwebmath_score": 0.8137758374214172, "tags": null, "url": "https://math.stackexchange.com/questions/2773473/spectrum-of-the-right-shift-operator-on-ell-2-mathbbc-and-a-general-sp" }
general-relativity, differential-geometry Title: Vanishing of Weyl Tensor Contraction Within the context of Einstein space-times, we know that the contraction of the Weyl tensor across a set of indices always vanishes, like so : $$C{^{\alpha }}_{\mu \alpha \nu }=0$$ From a purely mathematical standpoint this should be straightforward ( but perhaps tedious ) enough to prove from the definition of the conformal tensor in terms of the Riemann tensor and its contractions. However, I am wondering what the physical and/or geometric meaning and significance - if any - of this vanishing contraction really is ? I am a very visual person and learner, so an intuitive geometric understanding of this would be very helpful to me. If you choose a local inertial frame at a specific point of space-time, the metric tensor, around this point, is : $g_{ij}= \delta_{ij} - \frac{1}{3} R_{ikjl} x^k x^l + O(x^3) \tag{1}$ And the space-time volume element (corresponding to the square root of the determinant of the metric) is : $ d\mu_g = (1 - \frac{1}{6} R_{jk} x^j x^k + O(x^3)) ~d\mu_{Euclidean}\tag{2}$ The fact that the contraction of the Weyl tensor is zero, that is $C_{jk}=0$, looking at equation $(2)$, means that the $C_{jk}$ part of $R_{jk}$ is zero, so the Weyl tensor does not contribute to modifications of (infinitesimal) space-time volume. However, equation $(1)$ indicates you, that the Weyl tensor is participating to the modification of the metrics, because the $C_{ikjl}x^kx^l$ part of $R_{ikjl} x^k x^l$ is not zero.
{ "domain": "physics.stackexchange", "id": 11425, "lm_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 }
java } return list; } public List<Mother> mothersWithTwins() { List<Mother> list = new ArrayList<>(); for (Mother mother : mothers) { if (motherHasTwins(mother)) { list.add(mother); } } return list; } public boolean motherHasTwins(Mother mother) { Set<LocalDate> set = new TreeSet<>(); for (Newborn newborn : mother.getList()) { set.add(newborn.getBirthday()); } return set.size() < mother.getList() .size(); } public static void main(String[] args) { App app = new App(); app.buildRelation("src\\motherFile.txt", "src\\\\NewbornFile.txt"); System.out.println("Tallest daughter:"); System.out.println(app.getTallestNewborn(false)); System.out.println("\nTallest son:"); System.out.println(app.getTallestNewborn(true)); System.out.println("\nMost common date:"); System.out.println(app.mostCommonDate()); System.out.println("\nMothers over 25 Years old with childer heavier than 4000g;"); app.motherMoreThan() .forEach(System.out::println); System.out.println("\nDaughters that inherits their mother's name: "); app.newbornWithMotherName() .forEach(System.out::println); System.out.println("\nMother that has twins:"); app.mothersWithTwins() .forEach(System.out::println); } } Is it the fastest way? Probably not, though there's a lot to work on before performance considerations necessarily factor in. Can it be minimized? Yes! Is the approach correct?
{ "domain": "codereview.stackexchange", "id": 43110, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
quantum-mechanics, quantum-states, schroedingers-cat $$\tag4\left[ e^{i(\theta_1+\varphi_1)}\left|\psi_1\right>\otimes\left|\chi_1^\prime\right>+ e^{i(\theta_2+\varphi_2)}\left|\psi_2\right>\otimes\left|\chi_2^\prime\right> \right]\otimes\left|\phi_c\right>$$ that is not manifestly entangled if you trace out the irrelevant degrees of freedom. Note carefully that there is a whole list of stuff that is being covered here. First of all, the control of the quantum noise converts both $\left|\phi_1\right>$ and $\left|\phi_2\right>$ into $\left|\phi_c\right>$ by converting $\left|\chi_1\right>$ to $\left|\chi_1^\prime\right>$ and $\left|\chi_2\right>$ to $\left|\chi_2^\prime\right>$ and phase factors. This is basically completely general and so this part should be tolerable. It is kind of like in thermodynamics, you have some heat reservoir to absorb the unwanted entropy. It is also important to note that we have not actually identified what degrees of freedom are relevant and what are irrelevant, only assumed their existence and partition. This is a big assumption, but one that is operationally shown to exist: What we do is to just try things out experimentally, until some sufficiently good control of quantum noise restores the interference pattern, and if there is no such thing as irrelevant degrees of freedom, then one has to seriously wonder why there can ever be interference patterns at all, because this is really always happening if we want to do experiments, especially when you consider an experiment whereby the interference pattern is obtained by waiting and repeating data acquisition.
{ "domain": "physics.stackexchange", "id": 95367, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-states, schroedingers-cat", "url": null }
complex is! Show you the work process and the origin to compute for the complex conjugate is implemented the. Describing the same as this number -- or I should be a little bit more particular a third section there. Without j '' to denote imaginary and compute other common values such as 2i+5 real and parts... Trying to get rid of the imaginary part differs in the sign of the of! Cartesian form and ( b ) are two different ways of describing the same point real and imaginary of... In context, with same coefficient numerical manipulation same point of trying to get rid of the bits. Z gives the complex number is shockingly easy 're asked to find in this is! Sign on the complex number is a pair of complex numbers and compute other common values such as 2i+5 complete... Have the exact same real part is going to have the exact same real.! Get rid of the imaginary part differs in the form z a k, the equation of passing... These conjugate complex numbers mathematica » the # 1 tool for calculating the value of the conjugate... Complex_Modulus function allows to perform calculations with I ) describing the same point, with examples of … this calculator. * Algebra: R Nave: Go Back: complex conjugate is in.
{ "domain": "maenarua.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.957277806109987, "lm_q1q2_score": 0.803858690289316, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 948.2984653784146, "openwebmath_score": 0.7989453673362732, "tags": null, "url": "http://maenarua.com/flavorganics-almond-llzh/87042b-complex-conjugate-calculator" }
php, mysql echo" <h3>Mai 2013</h3> <div><br>"; while($runrows = mysql_fetch_assoc($runmai)) { $Luna = $runrows ['Luna']; $Ziua = $runrows ['Ziua']; $Mesaj = $runrows ['Mesaj']; $Anul = $runrows ['Anul']; echo " <table class='noutatitabel'> <tr> <td class='faramargini'> <div class='data'> <div class='luna'>$Luna $Anul</div> <div class='ziua'>$Ziua</div> </div> </td> <td class='albastru'>$Mesaj </td> </tr> </table><br>"; } echo" <br><hr><br></div>"; } if(mysql_num_rows($runapr) > 0 ) {
{ "domain": "codereview.stackexchange", "id": 4419, "lm_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", "url": null }
Veritas Prep Reviews Manager Status: On... Joined: 16 Jan 2011 Posts: 189 Followers: 3 Kudos [?]: 35 [4] , given: 62 Re: Inequalities trick [#permalink]  10 Aug 2011, 16:01 4 KUDOS 2 This post was BOOKMARKED WoW - This is a cool thread with so many thing on inequalities....I have compiled it together with some of my own ideas...It should help. 1) CORE CONCEPT @gurpreetsingh - Suppose you have the inequality f(x) = (x-a)(x-b)(x-c)(x-d) < 0 Arrange the NUMBERS in ascending order from left to right. a<b<c<d Draw curve starting from + from right. now if f(x) < 0 consider curve having "-" inside and if f(x) > 0 consider curve having "+" and combined solution will be the final solution. I m sure I have recalled it fully but if you guys find any issue on that do let me know, this is very helpful. So for f(x) < 0 consider "-" curves and the ans is : (a < x < b) , (c < x < d) and for f(x) > 0 consider "+" curves and the ans is : (x < a), (b < x < c) , (d < x) If f(x) has three factors then the graph will have - + - + If f(x) has four factors then the graph will have + - + - + If you can not figure out how and why, just remember it. Try to analyze that the function will have number of roots = number of factors and every time the graph will touch the x axis. For the highest factor d if x>d then the whole f(x) > 0 and after every interval of the roots the signs will change alternatively. Note: Make sure that the factors are of the form (ax - b), not (b - ax)... example - (x+2)(x-1)(7 - x)<0
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9597620619801096, "lm_q1q2_score": 0.860188072580374, "lm_q2_score": 0.8962513800615312, "openwebmath_perplexity": 2813.2556971947556, "openwebmath_score": 0.5333693623542786, "tags": null, "url": "http://gmatclub.com/forum/inequalities-trick-91482.html?kudos=1" }
c++, boost additive = multiplicative[qi::_val = qi::_1] >> *( ((qi::lit("+") > multiplicative[qi::_val += qi::_1]) | (qi::lit("-") > multiplicative[qi::_val -= qi::_1])) ); multiplicative = factor[qi::_val = qi::_1] >> *( ((qi::lit("*") > factor[qi::_val *= qi::_1]) | (qi::lit("/") > factor[qi::_val /= qi::_1])) ); factor = primary[qi::_val = qi::_1] >> *((qi::lit("**")) > primary[op(qi::_val, qi::_1, ast::operators::factor{})]); primary = qi::double_[qi::_val = qi::_1] | ('(' > expression[qi::_val = qi::_1] > ')') >> *(qi::char_('.') > variable[qi::_val = op(qi::_val, qi::_1, ast::operators::dot{})]) | variable[qi::_val = qi::_1] >> *(qi::char_('.') > variable[qi::_val = op(qi::_val, qi::_1, ast::operators::dot{})]); qi::on_error<qi::fail>( expression, boost::phoenix::bind(boost::phoenix::ref(err_handler), qi::_3, qi::_2, qi::_4)); }
{ "domain": "codereview.stackexchange", "id": 38663, "lm_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++, boost", "url": null }
r, bioconductor Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] tools stats graphics grDevices [5] utils datasets methods base other attached packages: [1] CNTools_1.34.0 genefilter_1.60.0 loaded via a namespace (and not attached): [1] Rcpp_0.12.17 AnnotationDbi_1.40.0 [3] BiocGenerics_0.24.0 splines_3.4.0 [5] IRanges_2.12.0 bit_1.1-14 [7] lattice_0.20-35 xtable_1.8-2 [9] blob_1.1.1 parallel_3.4.0 [11] grid_3.4.0 Biobase_2.38.0 [13] DBI_1.0.0 survival_2.41-3 [15] bit64_0.9-7 digest_0.6.15 [17] Matrix_1.2-9 S4Vectors_0.16.0 [19] bitops_1.0-6 RCurl_1.95-4.10 [21] memoise_1.1.0 RSQLite_2.1.1 [23] compiler_3.4.0 stats4_3.4.0 [25] XML_3.98-1.11 annotate_1.56.2 I was not able to get the CNSeg clustering method to work, but the work-around was to export the data and cluster it independently of the CNTools package (thanks to Llopis's answer below). I'll post the analysis below. require(CNTools) segData <- read.csv("result_cnv.csv", stringsAsFactors = FALSE) head(segData)
{ "domain": "bioinformatics.stackexchange", "id": 607, "lm_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, bioconductor", "url": null }
dimensional-analysis, differential-equations Title: Is separation of variables in the heat equation dimensionally consistent? This may be a trivial question but is about the statement that the function $U(x,t) $ in the heat equation may be expressed in the form $X(x)\cdot T(t)$. It's that $X$ and $T$ both are functions which have outputs of dimension temperature. So does $U$. Are the two sides of the equation dimensionally consistent? The 2D heat equation $$ \alpha \frac{\partial^2 U}{\partial x^2} = \frac{\partial U}{\partial t} $$ and the equations that result from separation of variables, $$ T' = - \lambda \alpha T \qquad X'' = -\lambda X $$ are all linear in the functions to be solved for. This means that it is dimensionally consistent to assign them any units we please; all that is required for dimensional consistency is that $[\lambda] = \text{m}^{-2}$ and $[\alpha] = \text{m}^2/\text{s}$. In particular, there is no requirement that either $T$ or $X$ have units of temperature. All that is required is that $U = TX$ has units of temperature—and even then, that's only on physical grounds. The first equation would be perfectly consistent if $U$ had dimensions of kilograms or coulombs.
{ "domain": "physics.stackexchange", "id": 60940, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dimensional-analysis, differential-equations", "url": null }
motors, torque, stepper-motor Title: Stepper motor skipping steps I'm using two stepper motors (datasheet below) to pan and tilt a platform. The bottom motor spins fine without the breadboard glued to the top platform. However, it behaves unpredictably and skips steps when the breadboard is glued in place (shown below). My question is why does this happen? Is it related to rotor inertia? I assume the bottom stepper shaft is affixed directly to the clear plastic platform that supports the top motor and the breadboard, is this correct? If so, there are two possible causes of your problem. first, the rotary inertia of the assembly consisting of the top motor and the PC board on its lever arm may be too much for the bottom stepper to rotate at the speed with which you are sending it pulses. try slowing down the pulse rate. second, the combination of board + support arm + top motor may have a torsional resonance close to the step signal frequency. trying to rotate the assembly with a string of discrete pulses may then excite the resonance and kick the torque impulses back to the bottom motor, causing it to jump between cog positions and lose steps. try hitting the bottom motor with one, two, three, ... pulses in a string and watch the assembly closely to see if it has been set into vibration by the end of the pulse string.
{ "domain": "engineering.stackexchange", "id": 2147, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "motors, torque, stepper-motor", "url": null }
unless P = NP. approximation algorithm, i. A algorithm can produce some spanning trees, and they are not MSTs, but their total weights are always smaller than 25. since these edges don’t touch, these are k different vertices. approximation algorithms as well. Proof: Suppose to the contrary that there exists a polynomial-time algorithm A for p≥1. While the LPT algorithm obtains a better approximation ratio, it does not have this on-line property. In undirected. Approximation Classes 4. • Works on greedy strategy. Approximation -- to produce low polynomial complexity algorithms to solve NP-hard problems. Therefore, for trust-region problems a different approach is needed. This post is an introductory tutorial on Variational Methods. Introduction to the techniques: Set cover. An approximation scheme for an optimization problem is an approximation algorithm that takes as input not only an instance of the problem, but also a value >0 such that for any xed , the scheme is a (1 + )-approximation. Note: We are interested in 3 questions when we find an approximation: Can the guarantee for this approximation be improved? → find a tight example Can the same algorithm give a better guarantee?. 2 The 98% approximation algorithm revisited The same insensitivity result can also be improved to a 98% guarantee, if one allows the base period TL to vary, i. The General TSP. To deal with these problems, two approaches are commonly adopted: (a) approximation algorithms, (b) random-ized algorithms. Approximation algorithms, Part I How efficiently can you pack objects into a minimum number of boxes? How well can you cluster nodes so as to cheaply separate a network into components around a few centers? These are examples of NP-hard combinatorial optimization problems. t weights w, returned by either Kruskal's algorithm or Prim's algorithm. Therefore, improving the 2-approximation for SUB-MP is. • Works on greedy strategy. Have a variable xi for each vertex with constraint 0 ≤ xi ≤ 1. A 2-Approximation Algorithm for Finding an Optimum 3-Vertex-Connected Spanning Subgraph. Bezier curve approximation algorithm with biarcs. algorithm with absolute approximation ratio of 3/2. While we still need to know how to solve the quadratic program e ciently, for now we focus on analyzing Algorithm (1). Czygrinow, A, Hanćkowiak,
{ "domain": "intelligentcontainer.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9869795118010989, "lm_q1q2_score": 0.8308646683043296, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 972.1502875536687, "openwebmath_score": 0.7901697754859924, "tags": null, "url": "http://jsiv.intelligentcontainer.de/2-approximation-algorithm.html" }
quantum-field-theory, hamiltonian-formalism, fourier-transform, quantization, klein-gordon-equation This is a standard awful physicist convention. Clearly the functional forms of the two "phis" are different, but the symbol being used is the same. This really is an awful abuse of notation, it relies on the convention that we "know" that "p" is a letter conventionally used for momenta and "x" is a letter conventionally used for position. In truth it is better to write (note the tilde over the second phi): $$\phi(\mathbf{x},t)=\int \frac{d^3p}{(2\pi)^3}e^{i\mathbf{p}.\mathbf{x}} \tilde \phi(\mathbf{p},t)$$ and, indeed, you will see this notation sometimes. My second question is that why we use p here, we could label it something else. Below we call it a 3-momentum. This is in anticipation of its subsequent interpretation as a momentum. There's no reason this interpretation should be clear until you have further studied the implications of the equation. My third question is that why we have $e^{-i\mathbf{p}.\mathbf{x}}$. Shouldn't it be $e^{i\mathbf{p}.\mathbf{x}}$ instead. Since $\omega$ only depends on the magnitude of the momentum you can change variables from $\vec p$ to $-\vec p$ if you want. This just will change your definition of $a^\dagger_{\vec p}$. This is the conventional definition. [My fourth and fifth questions...] Isn't it true that we just need to replace $\Phi$ with $q$ in the second equation above? And where is $t$?
{ "domain": "physics.stackexchange", "id": 20113, "lm_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, hamiltonian-formalism, fourier-transform, quantization, klein-gordon-equation", "url": null }
# Imposing periodic boundary condition for linear advection equation - Node problem I've spent the whole day trying to figure out what is the correct way to impose (and implement) periodic boundary conditions $$u(0,t)=u(1,t)$$ for all $$t>0$$ for the simple advection equation $$u_t + v u_x=0$$, given an initial data $$u_0(x)$$, but I'm not sure if I'm correct. I need to understand what am I missing in order to implement it in the right way. Say I discretize $$[0,1]$$ with $$N+1$$ points, i.e. I have \begin{align}0=x_0, \ldots, x_N=1 \end{align} In the lecture we say that for periodic boundary conditions we identify with $$x_N$$ with $$x_0$$. Let's consider the FTCS scheme: \begin{align} u_{i}^{n+1}=u_i^n-\frac{v dt}{2 dx} (u_{i+1}^{n}-u_{i-1}^{n}) \end{align} Question: should I do the update for $$i=0$$ to $$i=N$$, or should I just do the update for $$i=0$$ to $$i=N-1$$ and then update manually $$u_N=u_0$$? The problems arise when $$i=0$$, in this case I have \begin{align} u_0^n=u_0^n - \frac{v dt}{2 dx} (u_1-u_{-1}) \end{align} Now I've seen so many things on this site and on the internet that I'm really confused on what is the right value to give to $$u_{-1}$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9674102571131692, "lm_q1q2_score": 0.8203327034391132, "lm_q2_score": 0.8479677545357568, "openwebmath_perplexity": 397.8263904332674, "openwebmath_score": 0.7450817823410034, "tags": null, "url": "https://scicomp.stackexchange.com/questions/33639/imposing-periodic-boundary-condition-for-linear-advection-equation-node-proble" }
c++, memory-management struct test { int i_; test(int i) : i_(i) { std::cout << i << " created at: " << this << std::endl; } ~test() { std::cout << i_ << " destroyed" << std::endl; } }; int main() { simpleobj::Arena<test> arena(12); int i = 0; auto a = arena.create(i++); auto b = arena.create(i++); auto c = arena.create(i++); auto d = arena.create(i++); arena.destroy(b); arena.destroy(c); auto e = arena.create(i++); arena.destroy(a); auto f = arena.create(i++); auto g = arena.create(i++); try { for (int i = 0; i < 100; ++i) { arena.create(i++); } } catch (std::exception& e) { std::cout << e.what() << std::endl; } return 0; } Looks pretty good, and compiles cleanly under g++-7 -std=c++17 -Wall -Wextra -Wwrite-strings -Wno-parentheses -Wpedantic -Warray-bounds -Weffc++. I can't answer all of the questions, but I'll review what I can:
{ "domain": "codereview.stackexchange", "id": 27310, "lm_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++, memory-management", "url": null }
c++, c++11 TEST( Test_AnyValueSet, any_kind_of_values ) { static const auto BLAH = std::string{ "Blah" }; AnyValueSet value_set; test_all_operations( value_set, 42 ); test_all_operations( value_set, 3.14 ); test_all_operations( value_set, 0.5f ); test_all_operations( value_set, Foo{ 42, 5 } ); test_all_operations( value_set, Id{ 1234 } ); test_all_operations( value_set, Entity{ Id{ 5678 }, "A" } ); test_all_operations( value_set, BLAH ); ASSERT_FALSE( value_set.empty() ); ASSERT_EQ( 7, value_set.size() ); AnyValueSet values_to_remove; values_to_remove.add( BLAH ); values_to_remove.add( 0 ); values_to_remove.add( 2.5 ); value_set.remove( values_to_remove ); ASSERT_FALSE( value_set.contains( BLAH ) ); ASSERT_FALSE( value_set.empty() ); ASSERT_EQ( 6, value_set.size() ); value_set.clear<int>(); ASSERT_FALSE( value_set.empty() ); ASSERT_EQ( 5, value_set.size() ); value_set.clear(); ASSERT_TRUE( value_set.empty() ); } TEST( Test_AnyValueSet, add_unique_simple_values ) { AnyValueSet value_set; value_set.add( 42 ); value_set.add( 42 ); value_set.add( 42 ); value_set.add( 42 ); value_set.add( 42 ); ASSERT_EQ( 1, value_set.size() ); }
{ "domain": "codereview.stackexchange", "id": 7122, "lm_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", "url": null }
r, ggplot2 Title: Visualizing the difference among three groups I have 3 data frames for three groups of patients and in each of them I have the number of mutation types like insertion, deletion, SNP and total of mutations for each patients. In each group I have different number of patients like below > head(dat1) patient DEL INS SNP total 1: LP6008337-DNA_H06 927 773 40756 42456 2: LP6008334-DNA_D02 1049 799 31009 32857 > dim(dat1) [1] 21 6 > head(dat2) Patient DEL INS SNP total 1: LP6008031-DNA_E01 13552 3374 62105 79031 2: LP6005500-DNA_G01 539 500 43451 44490 > dim(dat2) [1] 33 6 > > head(dat3) Patient DEL INS SNP total 1: LP6005935-DNA_F03 39168 16739 58095 114002 2: LP6008269-DNA_D08 849 910 103501 105271 > dim(dat3) [1] 106 6 I want to show if the number of each mutational category and total is different between these three groups by chi-square test Actual question is if total number of mutations, SNP, DEL and INS are statistically significant among groups. I used pairwise t test but I afraid this test is not a suitable test for the distribution of data moreover I don't know how to visualize the p-value Imagining the comparison of total number of mutations between three groups, this picture is a good example Or in this plot they compare several features but only two groups Can you help ? Thanks Here a way to do it is to start first by creating a dataset containing your three different group, based on the few lines you display: dat1$Condition = "dat1" dat2$Condition = "dat2" dat3$Condition = "dat3" colnames(dat1)[1] = "Patient" DF <- rbind(dat1,dat2,dat3)
{ "domain": "bioinformatics.stackexchange", "id": 1251, "lm_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, ggplot2", "url": null }
php, classes Create a config class that handles config parsing and setting Or, at minimum, load the config file somewhere else In both cases you will need to pass the parts that matter to the Database constructor. This reduces Coupling which, in turn, reduces the amount of rewrite needed during refactoring. There is little more I can offer except questions. For example, what is Security doing? Is there only the one function? What else is declared in it? The same goes for Misc. Both of these classes sound like they don't really belong and are classes for the sake of being classes. EDIT ... the config class sounds interesting. Do you have any good places where I should start looking for a decent way? The Zend_Config documentation, part of the Zend Framework, would probably be a good place to see how people are using something like this. This is my Misc class: You could keep this I suppose, but Misc is a poor name for it. Calling some thing Misc is just asking for disorganization. If you really want this to be a function, and you can support PHP 5.3, I would wrap this in a namespace and treat the namespace similar to what most people would call a module. Example: <?php namespace Utilities { function validateEmail( $email ) { // Code } } However, you should really consider refreshing yourself on the PHP documentation, specifically the newer stuff that's been added since 4.0. A perfect example of this is the use of the Filter extension. In your case, FILTER_VALIDATE_EMAIL will do wonders. Security: This class, I won't really comment on because I'm not sure the use case or need. I'll assume it is necessary as is. Similar to Database you have high Coupling by putting the private key directly into the class. Depending on the needs of the key, it could exist in a config file and be treated just like the Database config attributes. On initialization, you would pass the config var for passkey into Security::__constructor. Doing so means that you could have a different passkey per user instead of a single passkey. Expanding this to a public+private key system in the future would also be easy (just add another parameter). User:
{ "domain": "codereview.stackexchange", "id": 155, "lm_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, classes", "url": null }
c++, c++11, database return 0; } Here are some things that may help you improve your code. Fix the bugs The code currently contains this function: friend std::ostream& operator<< (std::ostream& stream, const ContactListManager& csm) { for (auto &c : csm.list.contacts) { stream << c.serialize() << std::endl; } return stream; } However, this won't compile on my machine because contacts is a private member of the ContactList class. This function is a friend of ContactListManager and ContactListManager is a friend of ContactList but in C++ as in life, friendship is not transitive. That is, a friend of your friend isn't necessarily your friend too. This can be addressed (if you'll pardon the pun) by simply creating a similar ostream operator<< function for the ContactList class and using that. Another bug is that because only sorting by last name sets the dirty flag, if one adds or deletes several records, they won't be committed to the file even if explicitly instructed by the user to commit. Yet another bug is that remove_record is not range checked, so if we attempt to delete record 7 from an empty database, the program segfaults and crashes. Use the standard form of main() The current main declaration looks like this: int main(int argc, const char * argv[]) { However, the use of const there may bring portability problems because the only explicitly supported signatures for main are these: int main() int main(int argc, char *argv[]) int main(int argc, char **argv)
{ "domain": "codereview.stackexchange", "id": 24948, "lm_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, database", "url": null }
newtonian-gravity, lagrangian-formalism, potential, moment-of-inertia, multipole-expansion Title: What do moments of inertia do in the potential terms of Lagrangians? I am struggling to understand the Lagrangian computed in this paper. In particular, a binary spacecraft-debris system is assumed as below. The analysis goes as follows.
{ "domain": "physics.stackexchange", "id": 65160, "lm_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-gravity, lagrangian-formalism, potential, moment-of-inertia, multipole-expansion", "url": null }
organic-reduction Title: Hydrogenation of pent-4-en-2-one If one equivalent of $\ce{H2}/\ce{Pt}$ is made to react with one equivalent of pent-4-en-2-one, what will be the product formed? You have not specified the full reaction conditions - temperature and pressure can make a considerable difference - however this quote from Chemistry Libre Texts here (in turn quoting Basic Principles of Organic Chemistry by Roberts & Caserio) gives us a clear indication of the relative ease of hydrogenation of ketones vs double bonds. Hydrogenation of aldehyde and ketone carbonyl groups is much slower than of carbon-carbon double bonds so more strenuous conditions are required. This is not surprising, because hydrogenation of carbonyl groups is calculated to be less exothermic than that of carbon-carbon double bonds....It follows that it is generally difficult to reduce a carbonyl group in the presence of a carbon-carbon double bond by hydrogenation without also saturating the double bond. Other reducing agents are more selective:
{ "domain": "chemistry.stackexchange", "id": 16027, "lm_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-reduction", "url": null }
c++, parsing, tree Title: Arithmetic expression parsing, and converting infix to postfix notation I'm doing a infix to postfix conversion. The code works, but here are some points I want to improve 1) In the line of while ((!operators.empty())&&(order(operators.top()) >= order(token[0]))) If the condition order changes ( check the stack empty later), there'll be a segmentation fault (because I'm calling operators.top() which is NULL) 2) Convert from char to string using: string s(1, operators.top()); which I think constantly create a new variable s and delete it. How to improve this code? #include "Parser.h" #include <sstream> #include <algorithm> #include <iterator> using namespace std; Parser::Parser() { Postfix=""; _source=""; operators=std::stack<char>(); } string Parser::postfix() { return Postfix; } string Parser::source() { return _source; } Parser& Parser::parse(string s) { Postfix=""; _source=""; operators=std::stack<char>(); _source=s; string token; istringstream iss (_source); while (iss >> token) { if (isdigit(token)) Postfix.append(token).append(" ");
{ "domain": "codereview.stackexchange", "id": 4656, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing, tree", "url": null }
quantum-mechanics, wavefunction, schroedinger-equation Title: Deriving the time-independent form of Schrödinger's equation The motion of particles is governed by Schrödinger's equation, $$\dfrac{-\hbar^2}{2m} \nabla^2 \Psi + V \Psi = i \hbar \dfrac{\partial{\Psi}}{\partial{t}},$$ where $m$ is the particle's mass, $V$ is the potential energy operator, and $(-\hbar^2/2m) \nabla^2$ is the kinetic energy operator ($= p^2/2m$). The state function can be expressed as the product of space-dependent and time-dependent factors, $\Psi(r, t) = \psi(r) w(t)$. If we substitute this into Shrödinger's equation, we get $$\dfrac{-\hbar^2}{2m}w \nabla^2 \psi(r) + V \psi(r) w(t) = i \hbar \psi \dfrac{\partial{w}}{\partial{t}}$$ Upon dividing by $w(t)$, we get $$\dfrac{-\hbar^2}{2m} \nabla^2 \psi(r) + V \psi(r) = i \hbar \dfrac{\psi}{w(t)} \dfrac{\partial{w(t)}}{\partial{t}}.$$ But the time-independent Shrödinger equation is said to actually be $$\dfrac{-\hbar^2}{2m} \nabla^2 \psi(r) + V \psi(r) = E \psi.$$ I would greatly appreciate it if people would please take the time to explain what I did incorrectly here. You didn't do anything incorrectly. You just haven't pushed far enough. You can write the last equation in your derivation as
{ "domain": "physics.stackexchange", "id": 68069, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, schroedinger-equation", "url": null }
javascript, assembly context.constants)); else machineCode[address].hex += node.children[2].getRegisterNumber(context.namedRegisters) + "0"; address++; } else if (/^or$/i.test(node.text)) { check_if_there_are_three_child_nodes_and_the_second_one_is_comma(); if (node.children[0].getRegisterNumber(context.namedRegisters) === "none") { alert("Line #" + node.lineNumber + ': "' + node.children[0].text + '" is not a register!'); return; } machineCode[address].line = node.lineNumber; machineCode[address].hex = "0"; if (node.children[2].getRegisterNumber(context.namedRegisters) === "none") machineCode[address].hex += "5"; else machineCode[address].hex += "4"; machineCode[address].hex += node.children[0].getRegisterNumber(context.namedRegisters); if (node.children[2].getRegisterNumber(context.namedRegisters) === "none") machineCode[address].hex += formatAsByte(node.children[2].interpretAsArithmeticExpression( context.constants)); else machineCode[address].hex += node.children[2].getRegisterNumber(context.namedRegisters) + "0"; address++; } else if (/^xor$/i.test(node.text)) { check_if_there_are_three_child_nodes_and_the_second_one_is_comma(); if (node.children[0].getRegisterNumber(context.namedRegisters) === "none") { alert("Line #" + node.lineNumber + ': "' + node.children[0].text +
{ "domain": "codereview.stackexchange", "id": 45113, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, assembly", "url": null }
java, algorithm, generics, library, dijkstra com.github.coderodde.pathfinding.DijkstrasAlgorithm.java: package com.github.coderodde.pathfinding; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.PriorityQueue; import java.util.Queue; import java.util.Set; /** * This class implements the (unidirectional) Dijkstra's algorithm. * * @param <N> the actual graph node type. * @param <W> the weight value type. */ public final class DijkstrasAlgorithm<N, W> {
{ "domain": "codereview.stackexchange", "id": 45321, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, algorithm, generics, library, dijkstra", "url": null }
electromagnetism, special-relativity, gauss-law, maxwell-equations \begin{align} \partial_{\mu} F^{\mu 0} = \frac{4 \pi}{c} j^0 \end{align} I didn't discover a flaw in this logic, this seems to be a reasonable deduction to me. However - the author of this paper, claims that this generalization is simply "guessing" He writes (page 4):
{ "domain": "physics.stackexchange", "id": 50841, "lm_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, special-relativity, gauss-law, maxwell-equations", "url": null }
There's an easier way to get your solution, just call the length $OA$ equal to $1$ (it's constant, so we can scale all lengths to it), and call length AB equal to $z$. Then $u$ equals the negative rate of change of the length of the hypotenuse $OB$ (since $OB$ + $OP$ is constant), and v equals the negative rate of change of $z$. The hypotenuse is the square root of $1+z^2$, and it's negative time derivative by the chain rule is $\cos(\theta)$ times $dz/dt$, so that is $v\cos(\theta)$, and that equals $u$, and you are done. The first student is correct, the ABC triangle is a good projection. The second student is wrong because the OAB triangle is not a good projection, the block is not moving along OB. The third student is wrong because velocities don't add like that-- if you have two straight ropes attached to a block, and pull both ropes at speed $u$, the block moves at speed $u$, not speed $2u$ .
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9637799420543366, "lm_q1q2_score": 0.8113346773525726, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 417.4872570738163, "openwebmath_score": 0.8707814812660217, "tags": null, "url": "https://physics.stackexchange.com/questions/297428/a-more-intuitive-solution-for-the-kinematics-of-the-pulley-rope-system" }
c++, algorithm, bitwise This: if((bit & i) != 0) std::cout << "1"; else std::cout << "0"; could become a single-line ternary statement: // read as: (statement is true?) ? (if so, do this) : (if not, do this) std::cout << ((bit & i) != 0) ? "1" : "0"; This: if((bit & i) == 0) lefted <<= 1; could have curly braces (to allow any additional code for the body): if ((bit & i) == 0) { lefted <<= 1; } I'd probably make your "magic numbers" (such as 0x80) constants. This could help provide more context for your code, especially when there's no relevant documentation. std::cout << std::endl; doesn't need to be in print_bit(). The display function should only print the values; that's what the user expects. If you want a newline with the displaying, put it around the calling code. That way, the displaying will be easier to adjust.
{ "domain": "codereview.stackexchange", "id": 4452, "lm_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++, algorithm, bitwise", "url": null }
mechanical-engineering, beam, vibration, stiffness Title: Stiffness of a cantilever beam I am working on calculating the stiffness of a cantilever beam by applying a distributed load. I wanted to ask if the distribution of the load on the beam effects its stiffness. For eg., if I apply a point load at the free end vs a constant distributed load throughout the beam. Will the stiffness I get be different? How do I calculate the stiffness in later case? Thanks Stiffness is a murky term frequently used ambiguously in engineering. However, the most common definition of stiffness is the product of a beam's Young's Modulus $E$ (which is a function of its material) and its moment of inertia $I$ (which is a function of its cross-section). So $\text{Stiffness} = EI$. Loading has nothing to do with stiffness according to this definition, which you could say describes an isolated beam's stiffness. This value allows you to say whether one beam would be stiffer than another in identical circumstances (whatever those may be). Now, another possible definition is stiffness as the deflection a beam or structure suffers under load. This would be an analogy with a spring's stiffness (which is literally measured in force needed to move the spring a unit distance). This could be described as the whole structure's stiffness (even if that structure is a single cantilever beam). Obviously, a structure with pinned supports will be less stiff than one with fixed supports. Likewise, a cantilever beam with a concentrated load at midspan will deflect less (be stiffer) than one where the load is at the free end. Now, as mentioned in @kamran's answer, different loading patterns will lead to different deflections even if the total applied load is equal:
{ "domain": "engineering.stackexchange", "id": 2628, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, beam, vibration, stiffness", "url": null }
ros-industrial Originally posted by gvdhoorn with karma: 86574 on 2017-08-14 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by tengfei on 2017-08-14: Thank you, gvdhoorn!my robot controller does support C/C++,but not manufactured by vendor.I just looked through the ROS-Industrial mailing list and found some similar forum. So what I should do as you said is asking for some suggestions by sending a detailed description to the mailing list right? Comment by gvdhoorn on 2017-08-14: Yes. Please include all relevant information. Comment by tengfei on 2017-08-14: Thank you! gvdhoorn,sorry to bother you again.As you said,the dx100 package was too old.But I want to know the tutorials/create_joint_position_streaming_interface_using_tcp_socket_libraries still avaliable for me to build the server on robot controller?
{ "domain": "robotics.stackexchange", "id": 28605, "lm_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-industrial", "url": null }
ruby, interpreter, brainfuck Title: Ruby Brainfuck interpreter I recently wrote a simple Brainfuck interpreter in Ruby: require "io/console" $VALID = "+-<>.," def parse(code, level=0) ast = [] while !code.empty? do c = code.shift if c == "]" then if level == 0 then throw Exception.new "Unmatched brackets" else return ast end end if c == "[" then ast.push parse(code, level+1) elsif $VALID.include? c then ast.push c end end if level != 0 then throw Exception.new "Unmatched brackets" end ast end class BF def initialize @tape = Array.new 3e4, 0 @ptr = 3e4.to_i / 2 end def run(ast) ast.each {|e| if e.kind_of? Array then while @tape[@ptr] != 0 do self.run e end else case e when "+" @tape[@ptr] += 1 when "-" @tape[@ptr] -= 1 when ">" @ptr += 1 when "<" @ptr -= 1 when "." STDOUT.write @tape[@ptr].chr when "," @tape[@ptr] = STDIN.getch.ord end @tape[@ptr] &= 0xFF end } end end if ARGV[0] == nil then puts "Simple BrainFuck interpreter" puts "Usage: #{$0} <file>" exit 1 end bf = BF.new bf.run parse(File.read(ARGV[0]).chars)
{ "domain": "codereview.stackexchange", "id": 22111, "lm_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, interpreter, brainfuck", "url": null }
php, object-oriented, url, wordpress /** * @return (bool) */ public function isTaxReferrer() { return $this->isTaxReferrer; } } This works. I have written another class that will use the conditions set by the class above. This is how it works User sets the arguments in this new class (QueryArgumentsRef.php) which is passed to the ConditionsRef class through the constructo method public function __construct(ConditionsReferInterface $conditionalReferrer, array $values = null) The get* methods from the ConditionsRef class is then used to get the conditional values through $this->conditionalReferrer->isAuthorReferrer() for instance $referArgs returns values according to the user set arguments Here is the interface and class: QueryArgumentsRefInterface.php namespace PG\Referrer\Single\Post; interface QueryArgumentsReferInterface { /** * @return (array) arguments */ public function getReferrerArgs(); } QueryArgumentsRef.php namespace PG\Referrer\Single\Post; class QueryArgumentsRefer implements QueryArgumentsReferInterface { /** * @var $conditionalReferrer = null */ protected $conditionalReferrer = null; /** * @var $values = null */ protected $values = null; /** * @var $referArgs = null */ protected $referArgs = null; /** * @param $conditionalReferrer * @param array $values = null; * * Accepted parameters that can be passed to $values. * @param (string) authorReferrer * @param (string) dateReferrer * @param (string) searchReferrer * @param (string) taxReferrer * */ public function __construct(ConditionsReferInterface $conditionalReferrer, array $values = null) { $this->conditionalReferrer = $conditionalReferrer; $this->values = $values;
{ "domain": "codereview.stackexchange", "id": 12276, "lm_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, object-oriented, url, wordpress", "url": null }
java, object-oriented, enum As Antot already stated in initial post : This still remains rather brutal and rigid Then the second question is : Is there a much more flexible way to implement the entire thing using more OOP features ? Thank you for reading First, some remarks about the usage of enums. In State: GROUND_STATE(0), M(1), ... The values associated with the elements are no more than their ordinal numbers, so exactly the same effect would be reached if it were defined as public enum IsomericState { GROUND_STATE, M, M2, M3; public int getIsomericNumber() { return this.ordinal(); } } In Symbol: H("H"), He("He") The strings redundantly repeat the literals. He.name() or He.toString() will produce the same, so there is no need to add symbol field. Now, after all the refactoring applied since the initial question, let's try to approach the design a bit differently, with the aim of simplifying the thing. In the reviewed solution there is an array to store symbols as strings (Nuclide.SYMBOLS) and enums per each chemical element (H, He...), each wrapping data for nuclides. However, the core notion of this system is the chemical element, with a few constant values for different nuclides (symbol, atomic number) and with other fields varying. So why not creating a single enum that holds constant properties for each chemical element, used as prototype to initialize a Nuclide for any of them? This could look like follows: public enum PeriodicElement { H, He, Li, // other elements ; private final int atomicNumber; PeriodicElement() { this.atomicNumber = ordinal() + 1; } public int getAtomicNumber() { return atomicNumber; } public Nuclide asNuclide(int massNumber, IsomericState isomericState, String reactions, double decayTime) { return new Nuclide(this, massNumber, isomericState, reactions, decayTime); } } This requires changes in our Nuclide definition: package codereview.nuclides; public class Nuclide {
{ "domain": "codereview.stackexchange", "id": 29389, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, enum", "url": null }
## 2 Answers From $$d(x_{n+1},x_n)=d(g(g(x_{n-1})),g(x_{n-1}))\le \lambda d(g(x_{n-1}), x_{n-1})=d(x_n,x_{n-1})$$ we get after $n$ applications of that inequality $$d(x_{n+1},x_n)\le \lambda d(x_n,x_{n-1}) \le \lambda^2 d(x_{n-1},x_{n-2}) \le \cdots\le \lambda^n d(x_1,x_0)\tag{1}$$ Now we want to show that $(x_n)_n$ is a Cauchy sequence. So let $\epsilon>0$. We assume $x_1\not=x_0$ (otherwise $x_0$ is already a fixed point). Set $c=d(x_1,x_0)>0$. Since $0<\lambda<1$, the sum $\sum_{n=0}^\infty \lambda^n$ converges (to $1/(1-\lambda)$). Therefore we can pick $N$ large enough such that $$\sum_{k=n}^\infty \lambda^k<\frac{\epsilon}{c}$$ for all $n\ge N$. Then for $m>n\ge N$ we have by the triangle inequality $$d(x_m,x_n)\le \sum_{k=n}^{m-1} d(x_{k},x_{k+1})$$ Applying $(1)$ we obtain
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138144607744, "lm_q1q2_score": 0.8494639348599307, "lm_q2_score": 0.8688267694452331, "openwebmath_perplexity": 168.4497465966098, "openwebmath_score": 0.9528273940086365, "tags": null, "url": "https://math.stackexchange.com/questions/668736/prove-the-contraction-mapping-theorem" }
$$e^{a_{n}x + b_{n}y^2}= c_1e^{a_1x + b_1y^2} + c_2e^{a_2x + b_2y^2} + ... + c_{n-1}e^{a_{n-1}x + b_{n-1}y^2}$$. Applying operator $$\frac{\partial}{\partial x} - a_nI$$ will give $$0= c_1(a_1-a_n)e^{a_1x + b_1y^2} + c_2(a_2-a_n)e^{a_2x + b_2y^2} + ... + c_{n-1}(a_{n-1}-a_n)e^{a_{n-1}x + b_{n-1}y^2}$$ which would thus require all c to be zero, which essentially completes the induction proof (other argumentation as per link). My question is: why does $$y^2$$ not seem to have any effect on the linear independence. Where does this stem from? edit: assume all $$a_k$$ and $$b_k$$ are distinct.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357259231532, "lm_q1q2_score": 0.842101595010954, "lm_q2_score": 0.8577681068080748, "openwebmath_perplexity": 305.62483752007046, "openwebmath_score": 0.9506980776786804, "tags": null, "url": "https://math.stackexchange.com/questions/3245485/why-can-linear-independence-of-eax-by2-be-proven-without-considering-y" }
vba, excel '/====================================================================================================================================================== '/ Author: Zak Armstrong '/ Email: zak.armstrong@luminwealth.co.uk '/ Date: 13/August/2015 '/ '/ Description: Handle instances where a column heading can't be found. Reference against sheet-specific lists to see if the column should be there or not. '/====================================================================================================================================================== Dim bErrorFound As Boolean Dim colMissingSheetHeadings As Collection '/ For each sheet, contains the headings that shouldn't be there Dim strException As String '/ holds string items from colMissingSheetHeadings Dim strErrorMessage As String Dim i As Long Dim j As Long Dim k As Long
{ "domain": "codereview.stackexchange", "id": 17368, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vba, excel", "url": null }
general-relativity, energy-conservation Title: Energy conservation in General Relativity I understand that energy conservation is not a rule in general relativity, but I'd like to know under what circumstances it can still be possible. In other words, when is it possible to associate a potential energy to the gravitational field, so that the energy is constant in the evolution of the system? Here are some examples, is there a convenient way to define energy in these scenarios? Just a system of gravitational waves. A point mass moving in a static (but otherwise arbitrary) space-time. Equivalent (if I'm not mistaken) to a test mass moving in the field of a second much larger mass, the larger mass wouldn't move. Two rotating bodies of similar mass.
{ "domain": "physics.stackexchange", "id": 302, "lm_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, energy-conservation", "url": null }
urdf, xacro Title: File conversion from *.urdf to *.xacro How we can convert a hand-written URDF file to a .xacro file (xml macro for generating URDF files) for robot and world models? GDSP Originally posted by PGAM on ROS Answers with karma: 61 on 2011-06-13 Post score: 6 There is no official or programmatic way of doing this, as the process is strongly dependent on the platform that you are using. When converting from a URDF to a xacro file, I did the following: Create properties for commonly-used constants Mathematics constants: M_PI, M_2PI Conversion constants: Radians to Degrees, inches to centimeters Physics constants: Speed of Light, gravity (if needed) Create properties for variable components of your robot (Parts that will be constant over a run, but may change between runs) Wheel Radius Ground Clearance Camera Height/Angle Create macros for arrays of parts on your robot (a good example would be the super-structure of the turtlebot). Create macros for any components that are "mirrored" arms wheels This would be a good starting point for creating a xacro file, in general. Edit: See this tutorial for further details and syntax. Originally posted by mjcarroll with karma: 6414 on 2011-06-13 This answer was ACCEPTED on the original site Post score: 9
{ "domain": "robotics.stackexchange", "id": 5823, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "urdf, xacro", "url": null }
raspberry-pi ACC = AutonomousCruiseControl() # range second parameter is numbers to generate not the right boundary for i in range(0,8): ACC.front_sonar.readings = readings[i] print("{}. reading: {}".format(i, ACC.read_front_sonar())) print("{}. FOS: {}".format(i, ACC.get_front_object_status())) ACC.drive() if __name__ == '__main__': main() acc.py #!/usr/bin/env python3 # coding=UTF-8 from navigation.hcsr04 import Hcsr04 from navigation.servo import Servo from random import randint class AutonomousCruiseControl: """helping to steer a robot trough obstacles""" def __init__(self, object_colision_range=None, front_sonar_angles=None): # initiate sensors self.front_sonar = Hcsr04() self.front_sonar_servo = Servo() self.collision_distance = 20 if object_colision_range is None: self.object_colision_range = [10, 15, 20, 15, 10] else: self.object_colision_range = object_colision_range if front_sonar_angles is None: self.front_sonar_angles = [0, 45, 90, 135, 180] else: self.front_sonar_angles = front_sonar_angles self.front_sonar_distances = [200, 200, 200, 200, 200] self.read_front_sonar() print(self.front_sonar_distances) self.front_object_status = [0, 0, 0, 0, 0]
{ "domain": "robotics.stackexchange", "id": 1296, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "raspberry-pi", "url": null }
c#, beginner, homework, search } } } Always nice to see a student eager to learn. Class Book Your should try to always use an access modifier, so this should be public class Book Other issues: Public properties in C#, should begin with a capital letter. Price should be a Decimal (used for currency or monetary values) instead of a whole number. Genre should rightfully be a property to a Book, and not static to the entire class. Changing the genre then becomes as easy as updating the property. myList does not belong in the Book class. It should not be static and should be moved to Main. ToString() does not need to refer this.. Nor is the output needed. Instead just return the string.Format. Search Methods The names should use PascalCasing, example SearchByPublisher, SearchByPrice. There is no reason for the trailing .ToList() inside each respective foreach. The Where has already returned an enumerable collection that you will iterate over. For comparing strings, you have no regard for case. Thus "HOBBIT" and "hobbit" would not match "Hobbit". You may want to allow for ignoring the case. Another consideration would be on matching a partial string. Consider if the user enters "dragons" at the console that maybe you want to return "A Dance with Dragons". Going Further As a beginner, be sure you grasp what you see so far. Then go a step further and add a Books class that implements List<Book>. Now the search methods could be moved inside the Books class. In the name of Separation of Concerns, you don't want the searches to also write to the console. Instead, the search should be concerned only with searching. That would mean each respective search would return an IEnumerable, or really just the results of the Where( ... ).
{ "domain": "codereview.stackexchange", "id": 27851, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, beginner, homework, search", "url": null }
java, beginner, sorting, interview-questions, search /* Auxiliary method, creating linked hash map to sort by value instead of key. */ private static Map<String, Long> sortByValue(Map<String, Long> map) { LinkedHashMap<String, Long> result = new LinkedHashMap<>(); //Create a set of records <String, Long>, to implement custom comparator. SortedSet<Map.Entry<String, Long>> sortedEntries = new TreeSet<>( new Comparator<Map.Entry<String, Long>>() { @Override public int compare(Map.Entry<String, Long> e1, Map.Entry<String, Long> e2) { //Sort by value int res = e1.getValue().compareTo(e2.getValue()); //If values are equal - sort by key return res != 0 ? res : e1.getKey().compareTo(e2.getKey()); } } ); sortedEntries.addAll(map.entrySet()); for (Map.Entry<String, Long> e : sortedEntries){ result.put(e.getKey(), e.getValue()); } return result; } } This is ISearcher interface public interface ISearcher { /** * Refreshes internal data structures to find it easily * @param classNames project classes' names * @param modificationDates modification date in ms format since 1 jan 1970 */ void refresh(String[] classNames, long[] modificationDates); /** * Seeking a suitable class names * The name must begin with the 'start' * @param start the beginning of a class name * @return an array of length 0 to 12, class names, sorted by date modifications and lexicographic. */ String[] guess(String start); } Here is all my (working) solution on Github. Synchronized? Why is this synchronized? Is it multithreaded? If not, then this would seem to be unnecessary. Prefer interfaces as types ArrayList<String> list = new ArrayList<>(); //auxiliary list for transferring data from map to array
{ "domain": "codereview.stackexchange", "id": 22293, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, sorting, interview-questions, search", "url": null }
# Problem regarding percentage increases. #### Strikera ##### New member Ran into a problem which is driving me nuts and would appreciate any assistance on the problem. Problem: A factory increases it's production by 10%. The factory then increases it's production by another 20%. To return to the original production (before the 10 and 20% increases) how much production would the factory need to reduce? The answer is 24% but I have no idea on how they arrived at that number or the steps needed to properly approach the problem. Thanks in advance for any help! #### skeeter ##### Senior Member let P = production level increase P by 10% = (1.10)P increase the new level by another 20% = (1.20)(1.10)P = (1.32)P to reduce back to P ... P = (1/1.32)(1.32)P 1/1.32 = approx 0.76 of the last level of production ... a 24% decrease. #### Denis ##### Senior Member Striker, when you have "no idea", make up a simple example, like let initial production = 1000: 1000 + 10% = 1000 + 100 = 1100 1100 + 20% = 1100 + 220 = 1320 Now you can "see" that 1320 needs to be reduced back to 1000, so a reduction of 320: kapish? #### pka ##### Elite Member Here is a sure-fire method to do all these problems: $$\displaystyle \frac{{New - Old}}{{Old}}$$ This works for % of increase or decrease. #### tkhunny ##### Moderator Staff member ...unless, of course, Old = 0. #### stapel ##### Super Moderator Staff member tkhunny said: ...unless, of course, Old = 0. But if you're starting from zero, then "percent change" has no meaning, so it's a moot point, isn't it...? Eliz. #### tkhunny
{ "domain": "freemathhelp.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232909876816, "lm_q1q2_score": 0.8373190602910491, "lm_q2_score": 0.8519528057272543, "openwebmath_perplexity": 4369.991017701301, "openwebmath_score": 0.45679402351379395, "tags": null, "url": "https://www.freemathhelp.com/forum/threads/problem-regarding-percentage-increases.52309/" }
python, neural-network, deep-learning, tensorflow train(x) plt.plot(loss_rate) plt.show() The output of 3 different runs are: =========== RESTART: /Users/macbookpro/Desktop/AI/tf/OWN/test3.py =========== (10000, 784) [[ 0. 0. 0. 0. 0. 0. 0. 1. 0. 0.] [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.] [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.] [ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0.]] Epoch 0 / 5 - Loss nan Epoch 1 / 5 - Loss nan Epoch 2 / 5 - Loss nan Epoch 3 / 5 - Loss nan Epoch 4 / 5 - Loss nan Accuracy : 0.9053 =========== RESTART: /Users/macbookpro/Desktop/AI/tf/OWN/test3.py =========== (10000, 784) [[ 0. 0. 0. 0. 0. 0. 0. 1. 0. 0.] [ 0. 0. 1. 0. 0. 0. 0. 0. 0. 0.] [ 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.] [ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [ 0. 0. 0. 0. 1. 0. 0. 0. 0. 0.]] Epoch 0 / 5 - Loss nan Epoch 1 / 5 - Loss nan Epoch 2 / 5 - Loss nan Epoch 3 / 5 - Loss nan Epoch 4 / 5 - Loss nan Accuracy : 0.8342
{ "domain": "datascience.stackexchange", "id": 1601, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, neural-network, deep-learning, tensorflow", "url": null }
thermodynamics, cooling Title: Does a ceiling fan air heat up the air? I was laying in bed one day, looking at my ceiling fan, when I wondered, "Doesn't the ceiling fan, because it makes wind, cause wind chill, which 'wicks' heat away from me -> making me feel cooler, because that's how wind chill works. But because heat energy cannot be created nor destroyed, won't the wicked heat go into the air (among other places) and make the air warmer? This question also applies to wind in general, not just wind from an innocent ceiling fan. Any support is appreciated. And final note: If a ceiling fan doesn't heat up the area, is there a practical instance where some source of wind would 'wick' away enough heat to actually heat the medium the wind is occurring in? If the air is stationary, the air near your body will heat up to (about) body temperature, reducing your heat loss. If the air is moving, you will lose more heat to the air, which will raise the average temperature of all the air in the room. However, if the air is moving the air comes into better contact with the walls, losing more heat. At the level of this experiment it is not fair to assume the air in the room is isothermal. It is hard to see which effect is greater. I suspect you are correct that the average temperature will rise with a fan, but the temperature you experience will fall.
{ "domain": "physics.stackexchange", "id": 61343, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, cooling", "url": null }
# Why does the expectancy of a discrete random variable depend only on its distribution and not the r.v. directly? In some lecture notes that I have on discrete probability, after defining expectancy, it says "the expectancy doesn't depend on the random variable directly; it depends only on its distribution", where with "distribution" the function $$W:X(\Omega) \rightarrow \mathbb{R},\ W(x)=P(X=x),$$ $X:\Omega \rightarrow \mathbb{R}$ being our random variable. As an explanation for the above, the following line is given: $$\mathbb{E}X=\sum_{x\in X(\Omega) } x \cdot W(x)=\sum_{\omega \in \Omega} X(\omega) P(\omega).$$ Now I understand why the above holds, but I don't understand why this line entitles one to say that expectancy depends only on the distribution of a random variable. If I would change my random variable $X$ to $X'$, so that $X(\omega')\neq X'(\omega')$, for some $\omega'\in \Omega$, than by the above line, of course $\mathbb{E}X \neq \mathbb{E}X'$ . For a better understand: Could someone provide me with an example of two different r.v.'s having the same distribution ? - Why don't you expand what r.d. stands for ? I, for one, have no idea what it is. –  Sasha Apr 18 '12 at 18:37 (In my answer I assume that "r.d." is a typo for "r.v." and stands for "random variable"). –  Henning Makholm Apr 18 '12 at 18:38 Yes, it was a typo, sorry –  user26698 Apr 18 '12 at 19:06 For example, let the experiment be to roll two fair 6-sided dice of different colors, and the $X$ be the random variable that gives the result of the red die and $Y$ be the random variable that gives the result of the green die.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9719924802053235, "lm_q1q2_score": 0.8479150947655977, "lm_q2_score": 0.8723473813156294, "openwebmath_perplexity": 226.80512247924977, "openwebmath_score": 0.8971765637397766, "tags": null, "url": "http://math.stackexchange.com/questions/133557/why-does-the-expectancy-of-a-discrete-random-variable-depend-only-on-its-distrib" }
waves, string Title: Speed of a transverse wave in a string For the speed of a transverse wave in a string we use the formula $$v= \sqrt{\frac Tμ } $$ and sometimes we use the formula $v =λf$. Are these two same or different? They give the same value for speed, however, they are different; they relate the speed to different parameters. The first relates the speed to the tension and the linear density, which gives the value of the speed in relation to the specific parameters of the string. Similar to relating speed of sound to temperature. The second equation is a universal equation that relates to any type of wave. Simply, wavelength is the length of the repeating cycle of the wave. Frequency is how many cycles pass per second. This gives, (length(m) / cycle) * (cycles / second) = length passing per second = speed (m/s)
{ "domain": "physics.stackexchange", "id": 48804, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves, string", "url": null }
cosmology, astrophysics, space-expansion, cosmological-inflation, observational-astronomy Title: How far has a 13.7 billion year old photon travelled I've read that the size of the observable Universe is thought to be around ~46 billion light years, and that the light we see from the most distant galaxies were emitted ~13.7 billion years ago as a result of the expansion. So is the actual distance the photons have travelled 46 billion light years, or 13.7 billion light years? Age of universe is roughly 13.8 billion years, so anything with longest traveling record can only travel 13.8 billion light years at most (in any direction; not necessarily to Earth) because nothing can travel faster than light. Now, we are at the center of the observable universe (which is spherical with visible radius 13.8 billion years), so longest traveling record holders are the oldest ones and are at the edge of the observable universe and they have traveled 13.8 billion light years so far. The actual calculated radius 46 billion light years is different from the visible radius because the universe has expanded. So, the answer to your question is 13.8 billion light years.
{ "domain": "physics.stackexchange", "id": 39653, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, astrophysics, space-expansion, cosmological-inflation, observational-astronomy", "url": null }
python, algorithm return unord_list It seems to work in cases where it's possible to make such a list, but I'm pretty sure there is a more efficient way and the code can be optimized. As the Python version was not specified, I assume Python 3; for Python 2 you need to adjust the imports from itertools There are a number of ways you can attack this problem. One way becomes apparent if we think of an input that has no solution, which would be if more than half + 1 (rounded up) of the elements would be equal to each other, e.g. you can find a solution for [1, 1, 1, 2, 2] but not for [1, 1, 1, 1, 2, 2]. The solution would be that you group the elements and sort them by decreasing group length, then interleave first half of the elements with the rest; so, if your list is [3, 2, 2, 1, 3, 1, 1], at first you need to somehow group them, then sort into decreasing order, so that you get for example [1, 1, 1, 3, 3, 2, 2]; then you split it into 2 almost equal parts: [1, 1, 1, 3] and [3, 2, 2], and interleave these into the result: [1, 3, 1, 2, 1, 2, 3]. There are many ways to write this algorithm, here is one, using Python standard library extensively: from collections import Counter from itertools import chain, repeat, starmap, zip_longest, islice def funny_op(l): # use Counter to count the number of each distinct element, then # most_common() to sort them by decreasing frequency counts = Counter(l).most_common() # counts is a list of (element, count) pairs; with the example input # it could be [(1, 3), (3, 2), (2, 2)] # we then make an iterator that iterates over each distinct # element, by repeating each `element` `count` times sorted_els = chain.from_iterable(starmap(repeat, counts))
{ "domain": "codereview.stackexchange", "id": 18289, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, algorithm", "url": null }
$$f(x):= x^1+x^2+x^3+x^4+x^5+x^6$$ pack the sequence of number of sides of a fair die (note that the power of each monomial represent one of the sides of a dice). Now: multiplication of generating functions have the effect that the new sequence, after multiplication, is a sum of products of the old ones, where the indices of every product in each sum add up to the exponent of the monomial that will accompany. Its easy to check that, as we are throwing three dice, then the generating function $$g(x):=f(x)^3=(x^1+x^2+x^3+x^4+x^5+x^6)^3$$ pack as coefficients the total amounts of different ways to add up to the exponent of each monomial. Now: the polynomial $$f$$ can be seen as the partial sum of a geometric series, i.e. \begin{align*} f(x)&=x^1+x^2+x^3+x^4+x^5+x^6\\ &=x(x^0+x^1+x^2+x^3+x^4+x^5)\\ &=x\sum_{k=0}^{5}x^k\\ &=x\frac{1-x^6}{1-x} \end{align*} Then $$g(x)=x^3\left(\frac{1-x^6}{1-x}\right)^3=x^3\color{red}{(1-x^6)^3}\color{green}{(1-x)^{-3}}$$ The colored expressions (red and green) can be expressed as binomial series[*]. Then
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9919380099017026, "lm_q1q2_score": 0.8063139850731336, "lm_q2_score": 0.8128673133042218, "openwebmath_perplexity": 887.9062553857045, "openwebmath_score": 0.9974386096000671, "tags": null, "url": "https://math.stackexchange.com/questions/992125/if-i-roll-three-dice-at-the-same-time-how-many-ways-the-sides-can-sum-up-to-13" }
soft-question, education Title: Is it too late to study physics? I'm 24 year old student and I study Bachelor's degree of information technology. This is my last year there. Before I applied to this school I didn't know (remember) anything about mathematics or physics, but nevertheless I got in and after that I studied especially physics and mathematics. I had the best teachers I could hope for. They made me realize how much I love physics and math and now I have top grades in both. My GPA is 4/5. Is it too late to study physics (career-wise)? If not, then when is it too late? I want to study M.Sc. or Ph.D. degree, but I'd be 25 years old when I apply and when I would graduate I would be 30 years old. By the way, what are the differences in M.Sc. or Ph.D degrees in physics? Also are there any good tips what to study for the entrance examination? Maybe some good text books to study? I have few text books that I plan to read and I might also check Khan Academy videos. Definitely not too late! I've known graduate students in physics entering anywhere between 20 and 30, and I know there are even older and younger out there. Even better, it's not like information technology is a completely irrelevant- in physics (particularly high energy physics) we routinely deal with big data and I'm sure you could apply some of what you learned there. If you've kept up in physics and mathematics, that's a good thing as well. As far as entrance examinations go, I would recommend looking up what textbooks your university of choice assigns their undergraduate physics majors, and think about studying that. The difference between the M.S. and Ph.D. varies a little bit, but generally the M.S. is a short program mainly based on coursework (though there may be a thesis as well) and the Ph.D. is a much longer program that universally requires a lengthy dissertation.
{ "domain": "physics.stackexchange", "id": 28304, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "soft-question, education", "url": null }
gazebo Title: Will the 1.2.2 Gazebo version de one presented at Darpa Robotics Challenge Kickoff? Next week will happen the Darpa Robotics Challenge Kickoff with a tutorial on the simulator that will be used during the challenge. Will the 1.2.2 Gazebo version de one presented at Darpa Robotics Challenge Kickoff or you guys got a special version for the event? Best regards, Luis Filipe Rossi Originally posted by Luis Filipe Rossi on Gazebo Answers with karma: 43 on 2012-10-17 Post score: 0 Version 1.2.3 will be used at the kickoff Originally posted by nkoenig with karma: 7676 on 2012-10-18 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 2771, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
Proof of Theorem 4 Let $x \in Y_1$ and $x \in \overline{A}$ where $A \subset Y_1$. We proceed to find a countable $W \subset Y_1$ such that $x \in \overline{W}$. Choose $y \in Y_2$ such that $y=f(x)$. Let $M$ be the fiber of the map $f$ at the point $y$, i.e. $M=f^{-1}(y)$. By assumption, $M$ is countably tight. Call a point $w \in M$ countably reached by $A$ if there is some countable $C \subset A$ such that $w \in \overline{C}$. Let $G$ be the set of all points in $M$ that are countably reached by $A$. We claim that $x \in \overline{G}$. Let $U \subset Y_1$ be open such that $x \in U$. Because the space $Y_1$ is regular, choose open $V \subset U$ such that $x \in V$ and $\overline{V} \subset U$. Then $V \cap A \ne \varnothing$. Furthermore, $x \in \overline{V \cap A}$. Let $C=f(V \cap A)$. By the continuity of $f$, we have $y \in \overline{C}$. Since $Y_2$ is countably tight, there exists some countable $D \subset C$ such that $y \in \overline{D}$. Choose a countable $E \subset V \cap A$ such that $f(E)=D$. It follows that $y \in \overline{f(E)}$.
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9883127423485423, "lm_q1q2_score": 0.865551443428762, "lm_q2_score": 0.8757869916479466, "openwebmath_perplexity": 83.69010705959454, "openwebmath_score": 0.9987096786499023, "tags": null, "url": "https://dantopology.wordpress.com/2015/07/01/products-of-compact-spaces-with-countable-tightness/" }
homework-and-exercises, thermodynamics, electricity, heat Title: Problem with an electricity / thermodynamics assignment I've been trying to figure this one out for a while on my own, so I'd like to ask for your help if you could offer some. The task states: A heater made out of a wire with a diameter $R = 0.2\text{ mm}$, length $4\pi\text{ m}$ and electrical resistivity of $0.5\times 10^{-6}\ \Omega\;\mathrm{m}$ is connected to a voltage source of $220\text{ V}$, sinked in the water. Which mass of water will it heat up from $20^{\circ}\mathrm{C}$ to $50^{\circ}\mathrm{C}$ in the time of 10 minutes? (C of water = $4200\ \mathrm{J\;kg}/\mathrm{K}$)
{ "domain": "physics.stackexchange", "id": 1761, "lm_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, thermodynamics, electricity, heat", "url": null }
c++, c++11, game } public: kenoGamePlay(Bank &credits); ~kenoGamePlay() = default; int GameLoop(); }; kenogameplay.cpp #include "stdafx.h" #include <iostream> #include <vector> #include <string> #include <algorithm> #include "kenoGameConstants.h" #include "kenogameplay.h" #include "KenoWinCalculator.h" #include "Award.h" #include "GetUserInput.h" #include "RandomNumber.h" static const size_t QUIT_VALUE = 100; static const size_t MAX_NOS_PICKED = 10; static const size_t MIN_NOS_PICKED = 5; static const size_t INSERT_MONEY = 1; kenoGamePlay::kenoGamePlay(Bank &credits) : m_credits{credits} { m_NumberGenerator = new RandomNumber(); } std::vector<int> kenoGamePlay::QuickPickNumbers() { int quickPickCount = 0; char* Prompt = "How many number do you want the computer to pick (5-10)?"; do { quickPickCount = PromptUserReturnResponse<decltype(quickPickCount)>(Prompt); Prompt = "Invalid count value. Choose between 5 and 10 only.?"; } while (quickPickCount < MIN_NOS_PICKED || quickPickCount > MAX_NOS_PICKED); return m_NumberGenerator->GenerateAndGetVectorOfUniqueRandomNumbers(quickPickCount); }
{ "domain": "codereview.stackexchange", "id": 28894, "lm_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, game", "url": null }
black-hole, roche-limit Title: Do Roche limits apply to black holes? Consider black hole A, a super massive black hole at the center of the galaxy. Orbiting it is black hole B, a much less massive black hole. If some passing body were to modify black hole B's orbit such that it fell within the Roche limit of black hole A, what would happen to black hole B? If it were to turn into a ring, would the black hole matter re-inflate since it wouldn't be under such high gravity? Do black holes even respond to Roche limits like regular matter does? The Roche limit applies when a smaller body that would be held together by its own self-gravity is in the gravitational field of another, such that the tidal forces of the latter are stronger than the self-gravity of the latter, thus destroying the smaller body. However, the gravitational tidal forces of a black hole are always finite, except at the internal singularity. This is a problem because the self-gravity of a black hole, in the sense of the acceleration a mass would need to remain stationary on its surface, is infinite1. Thus, we shouldn't expect for a large black hole to destroy another through gravitational tidal forces. Put another way, the Roche limit occurs when particles from the smaller body can escape them... but they can't escape the event horizon of a black hole. Thus, the black holes will either orbit or merge, which is what happens in numerical simulations. 1There is a separate concept of surface gravity of a black hole that's essentially this re-scaled by the gravitational time dilation factor, and thus kept finite.
{ "domain": "astronomy.stackexchange", "id": 702, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "black-hole, roche-limit", "url": null }
ros, turtlebot, asus Title: rviz error on turtlebot laptop(Asus Eee PC 1215B) Hi, I bought turtlebot full kit and am trying to move it. However, I got some errors in this tutorial(Looking at Camera Data : http://www.ros.org/wiki/turtlebot/Tutorials/Looking%20at%20Camera%20Data). I couldn't launch rviz with Asus EeePC. How do I solve it ? I'm using Asus EeePC 1215B(This is a default PC for turtlebot). It has Ubuntu 10.04 and ros electric. I've already confirmed that turtlebot can be moved by teleoperation(turtlebot_teleop), so I think RobotSetup is correctly done. I found one of the solution here(http://answers.ros.org/question/2109/rviz-in-ros-electric?answer=3627#3627), but I couldn't understand how to solve it in my case because of different configuration. Here, I show the log data including four results. terminal error1 : rosrun rviz rviz (on turtlebot laptop) Ogre.log : got by the command "rosrun rviz rviz -l" (on turtlebot laptop) terminal error2 : rosrun rviz rviz (on workstation) troubleshooting : the result I got when I followed this page(http://answers.ros.org/question/2109/rviz-in-ros-electric?answer=3627#3627)
{ "domain": "robotics.stackexchange", "id": 10097, "lm_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, turtlebot, asus", "url": null }
complexity-theory, terminology-and-notation, qma Title: How is a promise gap related to a spectral gap? In linear algebra one often concerns oneself with the spectral gap of a given matrix, which may be defined as the difference between the smallest and second-smallest eigenvalue (or, depending on convention and context, between the largest and second-largest eigenvalue). In computational complexity one often concerns oneself with a promise gap of a given problem, which may be loosely defined as a difference of some variable between accepting and rejecting inputs. The different meanings of "gap" appear to overlap in certain problems of quantum computing. For example a promise gap is used in the $\mathsf{QMA}$-complete problem of determining the ground energy of a Hamiltonian - e.g. a promise that the ground energy of the given Hamiltonian is either less than a first value or greater than a second value, but we are also concerned with the spectral gap of the considered Hamiltonian, which may affect the general dynamics of the Hamiltonian. I'd like to know whether there is any relation between the two different meanings of "gap". For example: In certain formulations of $\mathsf{QMA}$-complete or $\mathsf{BQP}$-complete problems, can the spectral gap be smaller than the promised gap? What would be the implications of the promise gap being larger than the spectral gap?
{ "domain": "quantumcomputing.stackexchange", "id": 2553, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, terminology-and-notation, qma", "url": null }
algorithms, binary-trees, trees Title: BIT: What is the intuition behind a binary indexed tree and how was it thought about? A binary indexed tree has very less or relatively no literature as compared to other data structures. The only place where it is taught is the topcoder tutorial. Although the tutorial is complete in all the explanations, I cannot understand the intuition behind such a tree? How was it invented? What is the actual proof of its correctness? Intuitively, you can think of a binary indexed tree as a compressed representation of a binary tree that is itself an optimization of a standard array representation. This answer goes into one possible derivation. Let's suppose, for example, that you want to store cumulative frequencies for a total of 7 different elements. You could start off by writing out seven buckets into which the numbers will be distributed: [ ] [ ] [ ] [ ] [ ] [ ] [ ] 1 2 3 4 5 6 7 Now, let's suppose that the cumulative frequencies look something like this: [ 5 ] [ 6 ] [14 ] [25 ] [77 ] [105] [105] 1 2 3 4 5 6 7 Using this version of the array, you can increment the cumulative frequency of any element by increasing the value of the number stored at that spot, then incrementing the frequencies of everything that come afterwards. For example, to increase the cumulative frequency of 3 by 7, we could add 7 to each element in the array at or after position 3, as shown here: [ 5 ] [ 6 ] [21 ] [32 ] [84 ] [112] [112] 1 2 3 4 5 6 7 The problem with this is that it takes O(n) time to do this, which is pretty slow if n is large. One way that we can think about improving this operation would be to change what we store in the buckets. Rather than storing the cumulative frequency up to the given point, you can instead think of just storing the amount that the current frequency has increased relative to the previous bucket. For example, in our case, we would rewrite the above buckets as follows: Before: [ 5 ] [ 6 ] [21 ] [32 ] [84 ] [112] [112] 1 2 3 4 5 6 7
{ "domain": "cs.stackexchange", "id": 21463, "lm_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, binary-trees, trees", "url": null }
# Coordinates of point on a line defined by two other points with a known distance from one of them I have two points in 3D space; let's call them $A=(a_x, a_y, a_z)$ and $B=(b_x, b_y, b_z).$ Now, I need to place a third point, let's call it $C=(c_x, c_y, c_z)$, which lies on the line between $A$ and $B$ and is some known distance from $A$. Is there some easy way I can get the $c_x, c_y, c_z$ coordinates knowing the distance from $C$ to $A$? I would easily be able to do this in 2D, but I never worked with 3D space and I can't seem to figure it out. Thanks. - It's quite similar to 2D space. Consider a vector $v = B-A$ which you can imagine is the direction from $A$ to $B$. Hence for any point $C$ between $A$ and $B$ (inclusive of $A$ and $B$). $$C = A + tv$$ where $t = 0$ implies $C = A$ and $t = 1$ implies $C = B$ and $t \in (0,1)$ are all the points in between (one of which is the desired $C$). As you can see, this representation is independent of the dimension of your space. So, what's the value of $t$? Well, let the known distance from $A$ to $C$ be $d_{AC}$. Now, the distance between $A$ and $B$ or $d_{AB}$ is the magnitude of $v$ or $|v|$ which is nothing but $$d_{AB} = |v| = \sqrt{(a_x-b_x)^2+(a_y-b_y)^2+(a_z-b_z)^2}$$ (You can see that this formula for the Euclidean distance between two points is similar in 2D as well)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9912886173437991, "lm_q1q2_score": 0.8303231413394967, "lm_q2_score": 0.8376199694135332, "openwebmath_perplexity": 162.34857589292287, "openwebmath_score": 0.9645959138870239, "tags": null, "url": "http://math.stackexchange.com/questions/46527/coordinates-of-point-on-a-line-defined-by-two-other-points-with-a-known-distance" }
Now let $$\mathbb{Z}_z = \{x \in \mathbb{R} | x-z \in \mathbb{Z}\}$$. The above equation tells us that for all $$x$$ in $$\mathbb{Z}_z$$, $$f(x) = m_z x + c_z$$ for some $$m_z, c_z \in \mathbb{R}$$. In particular, for all $$x$$ in $$\mathbb{Z}$$, $$f(x) = m_0x + c_0$$. For arbitrary $$z$$, it's not necessarily true that the values of $$m_z$$ and $$c_z$$ are equal to $$m_0$$ and $$c_0$$, respectively. To show this, let $$x$$ be and integer and $$y \in \mathbb{Z}_z$$. Then $$x+y \in \mathbb{Z}_z$$ and using our original equation, we have $$xf(x) - yf(y) = (x-y)f(x+y)$$ $$\Rightarrow x(m_0x+c_0) - y(m_zy+c_z) = (x-y)(m_z(x+y) + c_z)$$ $$\Rightarrow m_0 x^2 + c_0 x = m_z x^2 + c_z$$ Since this must hold for all integers $$x$$ it follows that $$m_0 = m_z$$ and $$c_0 = c_z$$. Therefore $$f(x) = mx + c$$ for all $$x \in \mathbb{R}$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808718926534, "lm_q1q2_score": 0.8312465735194738, "lm_q2_score": 0.8479677583778257, "openwebmath_perplexity": 127.44799670002323, "openwebmath_score": 0.97682785987854, "tags": null, "url": "https://puzzling.stackexchange.com/questions/99019/what-should-you-substitute" }
strings, matrix, iterator, rust, vectors Title: Convert a type u16 number to a matrix (Vec> or array) of 4 x 4 I am a Rust newbie and I am not familiar with all the iterator options. This is what I have so far. How can I make this better or at least avoid collecting twice into a Vec? let num: u16 = 0b0010001000100010; // input number let bin = format!("{:016b}", num); let parsed = bin .split("") .filter_map(|s| s.parse().ok()) .collect::<Vec<u8>>(); let mat = parsed.chunks(4).collect::<Vec<_>>(); println!("{:?}", mat); // outputs [[0,0,1,0],[0,0,1,0],[0,0,1,0],[0,0,1,0]] One thing I'm going to do first is create an enum with only two values. This represents a binary value and is more memory-efficient than passing around a bunch of u8s. This way 16 Bits can be represented as 16 actual bits in memory (though this isn't guaranteed). /// a single bit #[derive(Clone, Copy, Debug)] enum Bit { /// 1, high H1 = 1, /// 0, low L0 = 0, } use Bit::*; // allow us to just use `L0` and `H1` without the `Bit::` prefix It is likely much faster to split a number into bits using numerical operators. There are a couple ways of doing it. Iterating a mask With this we increase our mask each time, building an array from it. The 15 - i is there because we want the MSB at index 0. /// convert a number to 16 bits by sliding a mask across it fn into_bits_mask(num: u16) -> [Bit; 16] { let mut out = [L0; 16];
{ "domain": "codereview.stackexchange", "id": 32369, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "strings, matrix, iterator, rust, vectors", "url": null }
1. Use your calculator to evaluate $f$ for several $x$-values close to zero and record the results in the tables below. $x$ $f(x)=\dfrac{1}{x}$ $g(x)=\dfrac{1}{x^2}$ $-2$ $-1$ $-0.1$ $-0.01$ $-0.001$ $x$ $f(x)=\dfrac{1}{x}$ $g(x)=\dfrac{1}{x^2}$ $2$ $1$ $0.1$ $0.01$ $0.001$ What happens to the values of $f(x)$ as $x$ approaches zero? Extend your graph of $f$ to reflect your answer. As $x$ approaches zero from the left (through negative values), the function values decrease toward $-\infty\text{.}$ As $x$ approaches zero from the right (through positive values), the function values increase toward $\infty\text{.}$ The graph approaches but never touches the vertical line $x = 0$ (the $y$-axis.)We say that the graph of $f$ has a vertical asymptote at $x = 0\text{.}$ 2. Repeat step (1) for the graph of $g(x)\text{.}$ 3. The functions $f(x) = \dfrac{1}{x}$ and $g(x) = \dfrac{1}{x^2}$ are examples of rational functions, so called because they are fractions, or ratios. Verify both graphs with your graphing calculator. Use the window \begin{equation*} \begin{aligned}[t] \text{Xmin} \amp = -4 \amp\amp \text{Xmax} = 4\\ \text{Ymin} \amp = -4 \amp\amp \text{Ymax} = 4 \end{aligned} \end{equation*} 4. State the intervals on which each graph is increasing. 5. Write a few sentences comparing the two graphs. Part IV Absolute Value
{ "domain": "yoshiwarabooks.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9934102285320158, "lm_q1q2_score": 0.8463386221005705, "lm_q2_score": 0.8519527963298946, "openwebmath_perplexity": 420.7700164678617, "openwebmath_score": 0.7928138375282288, "tags": null, "url": "https://yoshiwarabooks.org/mfg/basic-functions.html" }
factoring Title: Does being able to efficiently factor semiprimes allow to efficiently factor any integer? The Wikipedia page about Shor's algorithm currently contains the following sentence: A complete factoring algorithm is possible using extra classical methods if $N$ is a semiprime, that is, if it is the product of just two primes $p$ and $q$; therefore the algorithm only needs to achieve that.
{ "domain": "cstheory.stackexchange", "id": 5617, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "factoring", "url": null }
Your truth table would be correct otherwise (i.e. the conclusions you made based on the $p, q, r$ axioms that you (not the instructor that assigned the work) had initially set are correct). • You're telling me the truth table is incorrect because of the position of q & r, while everyone else is telling me it doesn't matter. I'm still confused. Or are you saying that both answers are correct? – Manumit Sep 15 '15 at 17:54 • Don't think about just the letters used, think about their corresponding truth values. Basically, your truth values for r are the same as the truth values your instructor put for q, and vice versa. Therefore, when you write p^r, you are writing what your instructor would write as p^q, since your truth values for r correspond to his/her truth values for q. p^r is different from p^q, and thus anything dependent on p&q or p&r will have different truth values with respect to your and your professor's truth table. – adamcatto Sep 15 '15 at 19:22 • tl;dr order matters if you swap the truth values of q and r but don't swap q with r for all other statements that use them (e.g. p^r, p^q, q-->p, etc.) – adamcatto Sep 15 '15 at 19:26 • But in an exam it would still be correct to list the axioms as I please? – Manumit Sep 15 '15 at 19:26 • Sure, just make sure to switch p,q,r accordingly (e.g. since you switched q and r here, you would need to change p^r to p^q, since the prof's r is your q) – adamcatto Sep 15 '15 at 19:28
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9481545304202039, "lm_q1q2_score": 0.8351317368987814, "lm_q2_score": 0.8807970748488297, "openwebmath_perplexity": 529.1578128781109, "openwebmath_score": 0.6955498456954956, "tags": null, "url": "https://math.stackexchange.com/questions/1436721/truthtable-logic-ordering" }
pcl std::sort (cloud_index_.begin (), cloud_index_.end (), std::less<CloudPointIndexIdx> ()); std::vector<Eigen::Vector3i>::iterator iter = std::unique(voxel_idx_.begin(),voxel_idx_.end()); voxel_idx_.erase(iter,voxel_idx_.end()); for(int i = 0;i < static_cast<int>(voxel_idx_.size());i++){ int ijk0 = voxel_idx_[i][0]; int ijk1 = voxel_idx_[i][1]; int ijk2 = voxel_idx_[i][2]; pcl::PointXYZI tmp_pt; tmp_pt.x = (ijk0 + static_cast<float> (min_bounding_idx_[0])) * leaf_size_[0] + leaf_size_[0] / 2.; tmp_pt.y = (ijk1 + static_cast<float> (min_bounding_idx_[1])) * leaf_size_[1] + leaf_size_[1] / 2.; tmp_pt.z = (ijk2 + static_cast<float> (min_bounding_idx_[2])) * leaf_size_[2] + leaf_size_[2] / 2.; out_cloud_ptr->push_back(tmp_pt); } I test my code and pcl with the same dataset, my code cost 50ms,and the pcl cost 2ms. I am just very curious why is so diffetrent. are there any skill ? I appreciate who can give me some answer! thx ~
{ "domain": "robotics.stackexchange", "id": 28763, "lm_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", "url": null }
neuroscience Title: What is the function of nodes of Ranvier in axons? In a neuroscience class I'm taking, it was explained that myelin covers axons in sections, the uncovered sections are called nodes of Ranvier, and signals propagate much faster in the covered sections. But if it is faster for signals to propagate along myelinated regions of the axon, why doesn't the entire axon get covered by myelin? Wouldn't that make it faster? Every signal rapidly fades out with distance if it is not amplified. So if the whole axon were covered with myelin, action potentials wouldn't reach their target. Each Ranvier node can be seen as an active signal repeater.
{ "domain": "biology.stackexchange", "id": 956, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience", "url": null }
# What is the chance of having a 10 of one suit and all other cards of other suits? A game consists of 32 cards (A, K, Q, J, 10, 9, 8, 7) in four suits, and each player gets 8 cards. I need to find the probability that I am being dealt a 10 of one suit, and have all my other cards be of a different suit. I know the chance of having a 10 is 1/8, but I get stuck on this. The card game is a Dutch card game called 'klaverjassen'. There are 4 suits, just like a normal card game. Each player gets 8 cards out of the 32 cards. Now I need the probability that I get a 10 of one suit, and all of my 7 other cards of different suits. For example if my 10 is a diamond, the other 7 cards either need to be clubs, spades or hearts. It doesn't matter which one it is. So I have 24 cards left where I need to pick 7 cards out of. There are 4 10's in the game. The goal I have is that I have at least 1 10 in my hand, with all other 7 cards being of a different suit than that 10. I can have multiple 10's, as long as one of them is 'unique', meaning that the other 7 cards are not of the 10's suit. So I can have a 10 of hearts, 10 of clubs, 10 of spades and 10 of diamonds in my hand and when all other cards are also hearts, it is still good
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771798031351, "lm_q1q2_score": 0.8201529845240519, "lm_q2_score": 0.8311430394931456, "openwebmath_perplexity": 341.59861948383065, "openwebmath_score": 0.7169082164764404, "tags": null, "url": "https://math.stackexchange.com/questions/2705073/what-is-the-chance-of-having-a-10-of-one-suit-and-all-other-cards-of-other-suits" }
earthquakes, models, mathematics Title: Is there a general equation to know how big of an area is affected by an earthquake? If you visit USGS earthquakes listing, you get 3 points of information for each earthquake: Location, depth, magnitude. My question is, is there a way to approximate how big of an area is affected? Like if an earthquake happens 20km from San Francisco, how strong does it have to be for someone in SF to be able to feel it? No, there isn't, because the area affected depends on so many factors, some of them unknowable. Magnitude, cause, depth, geology (which may be very variable in different parts of the area) etc. Besides which, the easiest way to tell which areas are affected is to monitor reports from observers. In the final analysis, the data that aid agencies want to know is which areas ARE affected rather than which might theoretically be affected if all relevant factors were known, which they rarely will be.
{ "domain": "earthscience.stackexchange", "id": 1845, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "earthquakes, models, mathematics", "url": null }
cosmological-inflation Title: What are the significant assumption of the Inflation Theory? Can it still be considered theory ?, because I can't find it's major or significant assumptions. The most significant assumption is that very shortly after the Big Bang, the universe expanded very rapidly for a short period of time. Much faster than normal expansion due to Big Bang. It was an exponential expansion and occurred around ${10}^{-32}$ seconds after Big Bang and lasted for tiny fraction of second. The universe continues to expand but not at that exponential rate. Yes it is still a theory and is accepted by many scientists.
{ "domain": "astronomy.stackexchange", "id": 2300, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmological-inflation", "url": null }
Quote:but after calculating the lengths of the three sides this fact became evident and I took advantage of it to avoid the use of the more complicated Heron's formula. Then the solution is a special case solution (namely when x=z and y=x*2*sqrt(3)/3), which is fine. However it is not a complete solution to the problem, which asks for the general case when x may or may not be equal to z (and similarly for the relationship between x and y). Unless there is some trivial explanation that reduces the general case to the case where x=z and y=x*2*sqrt(3)/3, such a reduction must be proved. Quote:The invariance of the areas relationship regardless the shape needs indeed a proof, but that is not up to the solver, as the problem itself suggests it is true. I do not see how the problem statement indicates that the invariance is guaranteed. Yes, it is a consequence of the relative lengths of the sides, but one that is not obvious (to me) and needs proof. Quote:Although apparently only geometric solutions matter here, I think all approaches are valid as long they lead to the correct answer. "All solutions matter" indeed (this may be a reference that only Americans will likely get, unless you follow American politics and social issues). I am equally interested in analytical solutions just as much as geometric ones. In the case of an analytical solution using trigonometry, it appears that we have only solved a special case. (Setting y=k1*x and z=k2*x may give us a general solution; I have not tried this.) Graph 3D | QPI | SolveSys 04-07-2017, 10:04 PM (This post was last modified: 04-07-2017 10:06 PM by Gerson W. Barbosa.) Post: #147 Gerson W. Barbosa Senior Member Posts: 1,212 Joined: Dec 2013 RE: Little explorations with the HP calculators (04-07-2017 09:26 PM)pier4r Wrote:  About the proof. I learned the hard way that showing the correct result may be a coincidence, while proving it is something different. If you just "prove" with a result it is like a proof by example, so, no proof.
{ "domain": "hpmuseum.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104972521579, "lm_q1q2_score": 0.8252302445971783, "lm_q2_score": 0.8539127492339909, "openwebmath_perplexity": 599.9081437511267, "openwebmath_score": 0.7620023488998413, "tags": null, "url": "https://www.hpmuseum.org/forum/thread-7955-post-71539.html" }
ros, rostopic, ros-indigo, joint-state Notice that in two of the above cases, all the links of the Fetch are present. However, in the other cases, only the two gripper joints are present. Here is the corresponding Fetch documentation for the links. This is a problem because, for instance, when I try to move the robot in code, I can only get the gripper movement to work since it seems like the gripper joints are the ones that are consistently published. The torso, wheels, shoulders, etc., all seem to be unaccessible. I think (though not sure) that the code I'm using isn't the main issue (which is why I'm not pasting it here). The main problem I think is to figure out why the joint_states topic isn't containing all the correct joints. In case this helps: <fetch>~/FETCH_CORE/fetch_core$ rostopic hz /joint_states subscribed to [/joint_states] average rate: 199.688 min: 0.000s max: 0.165s std dev: 0.01874s window: 176 no new messages no new messages average rate: 52.374 min: 0.000s max: 3.072s std dev: 0.21341s window: 208 average rate: 110.425 min: 0.000s max: 3.072s std dev: 0.13154s window: 548 average rate: 125.474 min: 0.000s max: 3.072s std dev: 0.11259s window: 748 average rate: 136.194 min: 0.000s max: 3.072s std dev: 0.10001s window: 948 average rate: 144.238 min: 0.000s max: 3.072s std dev: 0.09089s window: 1148 average rate: 150.420 min: 0.000s max: 3.072s std dev: 0.08385s window: 1349 average rate: 155.401 min: 0.000s max: 3.072s std dev: 0.07826s window: 1549 average rate: 159.610
{ "domain": "robotics.stackexchange", "id": 30837, "lm_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, rostopic, ros-indigo, joint-state", "url": null }
sound, acoustics, dsp-puzzle Aliasing and the limits of human hearing are relevant to this question but are not absolute requirements for the "paradox" that is mentioned here to occur. White noise: sounds exactly the same if you play it back at double the speed Stack up diminished fifth starting at a low enough fundamental (say 20 Hz). Play back at double speed: sounds exactly the same. Stack octaves with equal amplitude starting with a low enough fundamental. Play back at twice the speed: sounds exactly the same Detune the octaves slightly (say multipler of 2.05 starting at 20 Hz). Play back at double the speed: perceived pitch goes DOWN.
{ "domain": "dsp.stackexchange", "id": 4497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sound, acoustics, dsp-puzzle", "url": null }
general-relativity, cosmology, vacuum, stress-energy-momentum-tensor, cosmological-constant Comment 1. As per how the vacuum energy was conceived, the cosmological constant $\Lambda$ can not be variable. 2. You can not embed the cosmological constant $\Lambda$ in a perfect fluid $f$ with equation of state $p = w \rho$ and rename it as $f'$ with equation of state $p' = w' \rho'$, because if $w'$ is not constant it is not legitimate to talk of equation of state. The perfect fluid models used in general relativity are matter: $w = 0$, radiation: $w = 1/3$ and vacuum: $w = -1$. 3. Nevertheless you can keep the $\Lambda$ on the R.H.S. as a separate term compounding the total energy-momentum tensor which shapes the geometry of spacetime. This is an essential constituent of the current $\Lambda CDM$ cosmological model.
{ "domain": "physics.stackexchange", "id": 53696, "lm_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, vacuum, stress-energy-momentum-tensor, cosmological-constant", "url": null }