text
stringlengths
1
1.11k
source
dict
javascript, node.js, express.js Creating modules to contain shared code is a generally good idea. But, when working with async functions and their responses, you need to make sure you preserve full async response and error handling when you write cover functions that use async library functions. In this case, you missed some of that, rendering your cover function not fully functional. In addition, when covering a built-in function, you should pretty much make sure you're adding enough value to justify a new interface. Simple defaulting one argument is probably not enough change/improvement to justify creating a whole new set of functions that someone learning or modifying your code would have to become familiar with in order to be productive in your code (which would not be an issue if you just used the standard functions).
{ "domain": "codereview.stackexchange", "id": 14039, "lm_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, node.js, express.js", "url": null }
quantum-mechanics, waves The bubble chamber picture of an electron is a good example. It is curving in a helix in a magnetic field, and the little dots that make up the track are small interactions with the hydrogen atoms, tiny dots of kicked off electrons ionizing even more atoms and making up the dots. The continuous energy loss reduces the radius of the theoretical spiral to the effect seen. This is the macroscopic picture and we call it the trajectory of the electron. We have found out that one cannot go to a microscopic detection that will give a specific trajectory within the HUP volume, the electron is within a fuzzy circle, which is the probability of finding the electron within the circle, the non-zero-probability-of-interaction circle. Thus there are no trajectories in the quantum mechanical frame, just loci of probability for an interaction of the particle under examination.
{ "domain": "physics.stackexchange", "id": 30175, "lm_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, waves", "url": null }
python, algorithm, python-2.x, sorting, reinventing-the-wheel def custom_sort(): for index in range(0, len_of_list): if (index + 1) == len_of_list: if not check_results(): custom_sort() elif check_results(): print value_list else: if value_list[index] > value_list[index + 1]: smaller_val = value_list[index + 1] value_list[index + 1] = value_list[index] value_list[index] = smaller_val elif value_list[index] < value_list[index + 1]: continue def check_results(): for index in range(0, len_of_list): if (index + 1) == len_of_list: return True else: if value_list[index] < value_list[index + 1]: continue elif value_list[index] > value_list[index + 1]: return False @timeit def run(): custom_sort() run()
{ "domain": "codereview.stackexchange", "id": 23508, "lm_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, python-2.x, sorting, reinventing-the-wheel", "url": null }
quantum-mechanics, hamiltonian, many-body, second-quantization $$ and you end up with $$ V=\sum_{a,b,c,d}a_a^\dagger a_b^\dagger a_ca_d\int d^3r d^3r' \phi_a^*(r)\phi^*_b(r')\phi_c(r')\phi_d(r)V(r-r') $$ and what you mean by $$ \bbraket{ij}{V}{kl} $$ is $$ \int d^3r d^3r' \phi_i^*(r)\phi^*_j(r')\phi_l(r')\phi_k(r)V(r-r') $$ because you are writing the i and k terms first (in $|ij\rangle$ and $|kl\rangle$) because they both are integrated over "r" and the j and l term second because they are both integrated over r'. So, we have $$ V=\sum_{a,b,c,d}a_a^\dagger a_b^\dagger a_ca_d \bbraket{ab}{V}{dc} $$
{ "domain": "physics.stackexchange", "id": 22854, "lm_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, hamiltonian, many-body, second-quantization", "url": null }
botany, terminology, taxonomy, mycology, nomenclature Title: A word that includes plants and fungi, but not animals Hello biologists and biology enthusiasts! I am working on a project which includes information about plants and fungi. It would be very helpful for me if there a word that means plants-and-fungi, but I'm not sure there is. "Flora" only includes plants, but "biota" includes animals. Thanks! Short Answer There is no such word that I can think of. Long Answer Note: although fungi were once considered to be lumped with plants, such classifications fell out of favor 60+ years ago (or sooner). See here for a summary. Nomenclature "dead ends" Using the traditional taxonomic approach (including Woese's familiar 3-domain classification system) will not provide the collective term you're looking for. Plants, Animals, and Fungi are all of the kingdoms rank in this system; the only higher rank than kingdom in this system is domain (in this case "Eukarya"), which would include all 3 kingdoms.
{ "domain": "biology.stackexchange", "id": 11114, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "botany, terminology, taxonomy, mycology, nomenclature", "url": null }
quantum-mechanics, angular-momentum, quantum-spin, protons Title: Addition of Angular Momementa in deeply bound situations, proton spin crisis In Landau and Lipshitz's introductory book on Quanum Mechanics, "Quantum Mechanics Non-Relativistic Theory, Third Edition: Volume 3", chapter XIV (page 433 in the edition on Amazon) is "Addition of Angular Momenta". Interestingly, the first page is footnoted to the effect that the theory covered only applies in the limit of a binding force sufficiently weak that the angular momentum can be considered separately for the particles:
{ "domain": "physics.stackexchange", "id": 327, "lm_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, angular-momentum, quantum-spin, protons", "url": null }
newtonian-mechanics, newtonian-gravity, reference-frames, mass, torque $$\int d\vec\tau=0\tag2$$ Where $d\vec\tau$ is the torque on each small piece of mass $dm$. On the other hand, if we have noncontinuous bodies, like for example balls scattered across the pool table then we can't perform integration on the whole system directly. Instead, first, we'll calculate the net torque on each part of the system by the method of integration described above, this means that in the case of the pool balls we have to calculate the net torque on each ball first, then simply sum all these torques to get a final resultant torque Cleared with this, first, consider a ball in a uniform gravitational field. The torque on some small piece of it having mass $dm$ is $$d\vec\tau=\vec r\times dm\vec g\tag3$$ Thus net torque on the whole body is simply the integral of this expression, hence $$\vec\tau=\int d\vec\tau=\int\vec r\times dm\vec g\tag4$$ Since we are assuming $\vec g$ to be a constant we get $$\vec \tau=\bigg(\int\vec r dm\bigg)\times\vec g\tag5$$
{ "domain": "physics.stackexchange", "id": 91335, "lm_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, newtonian-gravity, reference-frames, mass, torque", "url": null }
phasors in polar or rectangular form. cis φ = cos φ +i*sin φ = e iφ: cis(the result of step No. Find all answers rounded to the nearest hundredth. Yes To convert from polar form to rectangular form, first evaluate the trigonometric functions. cis φ = cos φ +i*sin φ = e iφ: cis(45°) = 0.7071068+0.7071068i Assuming trigonometric angle argument in degrees. (*denotes a required field), Home / Resources / Tax Calculators / CIS Tax Deduction Calculator. It can be written in the form a + bi. It will perform addition, subtraction, multiplication, division, raising to power, and also will find the polar form, conjugate, modulus and inverse of the complex number. Converting a Complex Number from Polar to Rectangular Form. De Moivre’s Theorem Calculator is a free online tool that displays the equation for the given values. TRIGONOMETRIC AND RECTANGULAR FORMS USING CALCULATOR APPROXIMATIONS Write each complex number in its alternative form, using calculator approximations as necessary. By using
{ "domain": "elab.is", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464499040092, "lm_q1q2_score": 0.8352648939113813, "lm_q2_score": 0.8558511524823263, "openwebmath_perplexity": 1342.5111164313003, "openwebmath_score": 0.7379550337791443, "tags": null, "url": "https://elab.is/nm37u/cis-to-rectangular-form-calculator-646a7e" }
nomenclature According to the current version of Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book), simple prefixes (simple substituent groups consisting of just one part that describes an atom, or group of atoms as a unit, for example methyl, cyclohexyl, and isopropyl) are arranged alphabetically disregarding any multiplicative prefixes. For example, ‘3,5-dimethyl’ is considered to begin with ‘m’. Any multiplicative prefixes are inserted later and do not alter the alphabetical order.
{ "domain": "chemistry.stackexchange", "id": 5099, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nomenclature", "url": null }
# A doubt on integration by parts My friend had the following doubt: $\int { \frac { dx }{ x\ln { x } } }$ You might laugh at me and say this is a straightforward integration by substitution which gets us to $\ln { (\ln { x)+C } }$ But what if we try integration by parts??? $I=\int { \frac { dx }{ x\ln { x } } } =\frac { 1 }{ \ln { x } } \int { \frac { dx }{ x } } -\int { \left( -\frac { 1 }{ { (\ln { x } ) }^{ 2 } } \frac { 1 }{ x } \int { \frac { dx }{ x } } \right) dx } =\frac { 1 }{ \ln { x } } \ln { x } +\int { \frac { dx }{ x\ln { x } } } =1+I\quad \\ \Rightarrow I=I+1\Rightarrow 1=0$ Please tell me where are we wrong? Note by Krishna Jha 5 years, 2 months ago This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
{ "domain": "brilliant.org", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9473810466522863, "lm_q1q2_score": 0.8179608471277628, "lm_q2_score": 0.8633916099737806, "openwebmath_perplexity": 2035.37728565242, "openwebmath_score": 0.9907634258270264, "tags": null, "url": "https://brilliant.org/discussions/thread/a-doubt-on-integration-by-parts/" }
terminology, paleontology, fossils An evolutionary radiation is an increase in either taxonomic diversity (i.e. the number of species) or morphological disparity (how they differ in anatomy). This can result from an adaptive change or the opening of ecospace. The combination Putting the two parts back into the contexts where you found them: the first article mentions an increase in the diversity or marine mammals, and the second in the diversity of dry-adapted shrubs. Both these increases occurred between the start of the Oligocene and the end of the Miocene.
{ "domain": "earthscience.stackexchange", "id": 1271, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "terminology, paleontology, fossils", "url": null }
c#, beginner, game, console It's better to declare variables as close to where they will be used as possible, and to initialize them immediately, instead of declaring them up-front at the start of a method. ArrayList is an old type that was created before C# had generics. Nowadays you should use List<T> instead. With rpsList as a List<string>, the compiler knows that rpsList[index] will return a string, so you don't need those ToString() calls, and you can use the == operator for string comparisons instead of Equals. The strings "rock", "paper" and "scissors" are repeated several times throughout the code. It's easy to introduce a bug by making a typo. Use constants instead: public const string Rock = "rock";. Or rather, use an enum: public enum Choice { Rock, Paper, Scissor }. This makes it clear that a Choice can only be one of these 3 values, whereas a string can hold any possible string value.
{ "domain": "codereview.stackexchange", "id": 34962, "lm_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, game, console", "url": null }
graphs, computational-geometry Title: Sort edges in euclidean graph Given a euclidean graph $G$ and a node $p$ with edges to all the other nodes, is there a more efficient solution than $O(NLog(N))$ to output all the edges to $p$ in sorted order? If you find a way to do this, then you can build a sorting algorithm that does it faster than the $\Omega(n \log n)$ boundary on comparison sort.
{ "domain": "cs.stackexchange", "id": 1887, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graphs, computational-geometry", "url": null }
cc.complexity-theory, ds.algorithms, graph-algorithms $2^{n + b\log(n)} \cdot 2^{(2n + c\log(n))/2 + 1} \le 2^{n + c\log(n)}$, you want to pick $c$ to have $2^{n + b\log(n)} \cdot 2^{2(n/2 + 1) + c\log(n/2+1)} \le 2^{2n + c\log(n)}$ for large $n$. (The "$/2 + 1$" gets pre-composed with $n + c\log(n)$, not post-composed.) This overall gives a time bound of $2^{2n + c\log(n)}$. Of course, only $c = \Omega(\log(n))$ can achieve this, but a choice of $c = O(\log(n))$ does work. This gives the stated time bound of $2^{2n}\cdot n^{O(\log(n))}$.
{ "domain": "cstheory.stackexchange", "id": 3732, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, ds.algorithms, graph-algorithms", "url": null }
quantum-mechanics, gravity by the fact that the electrons would be appearing for only very brief instances. Also I think lots of other things could be explained this way, such as through using QED to explain gravitational lensing, as well as phenomena such as the Lorentz force. Does anyone think this could be right? Thanks in advance for comments.
{ "domain": "physics.stackexchange", "id": 30918, "lm_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, gravity", "url": null }
quantum-chemistry Title: Why Balmer series exist? I was reading about Bohr's atomic model in our textbook when came up with this question: Since the electron in hydrogen atom is most stable in the first orbit, why should it descend from higher orbits to any orbit except the first orbit(that means balmer series for example)? The entire process has two parts: Excitation and relaxation. The first is clear enough, we excite an electron into a higher energy level.
{ "domain": "chemistry.stackexchange", "id": 5610, "lm_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-chemistry", "url": null }
special-relativity, rotation, precession \begin{equation} \left( \frac{d\mathbf{x}}{dt} \right)_{nonrot} = \left( \frac{d\mathbf{x}}{dt} \right)_{rest} + \mathbf{v}~, \end{equation} which you already knew.
{ "domain": "physics.stackexchange", "id": 7965, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "special-relativity, rotation, precession", "url": null }
c#, event-handling, delegates, e-commerce public class BillingDepartment { public BillingDepartment(ShoppingCart sc) { sc.OrderSubmittedEvent+=OrderSubmittedHandler; } public void OrderSubmittedHandler(OrderDetails orderDetails) { foreach (var item in orderDetails.ItemCodes) { Console.WriteLine("Billing user "+orderDetails.UserId+" for the order "+item.ToString()); } } } public class MailingDepartment { public MailingDepartment(ShoppingCart sc) { sc.OrderSubmittedEvent += OrderSubmittedHandler; } public void OrderSubmittedHandler(OrderDetails orderDetails) { foreach (var item in orderDetails.ItemCodes) { Console.WriteLine("Mailing user " + orderDetails.UserId + " the order " + item.ToString()); } } } }
{ "domain": "codereview.stackexchange", "id": 4478, "lm_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#, event-handling, delegates, e-commerce", "url": null }
javascript, array, google-apps-script, google-sheets var diacriticsMap = {}; for (var i = 0; i < defaultDiacriticsRemovalMap.length; i++) { var letters = defaultDiacriticsRemovalMap[i].letters; for (var j = 0; j < letters.length; j++) { diacriticsMap[letters[j]] = defaultDiacriticsRemovalMap[i].base; } } function remove_all_diacritics(sheet_name, get_range, row_set, col_set) { // var sheet = SpreadsheetApp.getActive().getSheetByName(sheet_name); // var values = sheet.getRange(get_range).getValues(); var values = [['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['æ', 'ø', 'å', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], ['á', 'á', 'á', 'á'], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ]]
{ "domain": "codereview.stackexchange", "id": 43514, "lm_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, array, google-apps-script, google-sheets", "url": null }
Now coming to these logics. Are all these logics, "temporal Logic", "Modal Logic", "First order Logic", "Higher order Logic" independent of each other or we need to understand few of these logic to understand a few others in this group? In a nutshell, what will be the prerequisites for them? (It will be great if I can get suggestions on some materials also.) P.S : Thanks a ton for your kindness
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9728307700397332, "lm_q1q2_score": 0.830712602809108, "lm_q2_score": 0.8539127548105611, "openwebmath_perplexity": 941.4161748491073, "openwebmath_score": 0.7411478757858276, "tags": null, "url": "https://cs.stackexchange.com/questions/89770/what-exactly-is-a-logic/89780" }
plant-physiology, botany, plant-anatomy In nature the primary means of pineapple propagation is the formations of lateral shoots, the growth of which consequently are accelerated by influoresence of the main shoot. Now the actual way the plant grows is not quite as simple to answer, as plant development is often as complicated as animal development, but in general it is a function of cell division and elongation. In the root apical meristem, there is a region known as the quiescent centre which contains the actual root stem cells. Directly behind the quiescent centre is a region known as the merismatic zone, which features extensive cell division, and directly behind that is the elongation region where the cells grow, effectively pushing the root tip through the soil. In the region behind the elongation region, the maturation zone where the cells have reached full length, cells begin to form more rigid cell walls and differentiate into the different tissues of the root.
{ "domain": "biology.stackexchange", "id": 1222, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "plant-physiology, botany, plant-anatomy", "url": null }
homework-and-exercises, electrostatics, electric-fields, gauss-law The Mathematica notebook used to produce the images in this post is available through Import["http://goo.gl/NaH6rM"]["https://i.stack.imgur.com/bcsC4.png"].
{ "domain": "physics.stackexchange", "id": 60527, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, electrostatics, electric-fields, gauss-law", "url": null }
machine-learning, python, data-mining, sentiment-analysis, twitter Notice how words repeat? Imagine what a 3-gram or 5-gram would look like. Before anything, why would we use bigrams over unigrams or those of higher n values? Well, the higher the n, the more about of order you're able to capture. Sometimes order is an important factor in learning. Playing around with how you'll represent your data might show you important features. Now that we have our text tokenized, we can start extracting features! We can turning our example test, and other text samples, into a Bag-Of-Words (BOW) model. Think of a BOW as a table with column headers as the words/terms and rows as your text samples/tweets. A cell could then contain the number of words/terms for a given sample of text. You could start with counting each term in a sample, so based on the tweet, you'd come up with something like tweet1: { 'I': 2, 'do': 1, 'not': 1, 'like': 1, 'the': 1, ... '!': 3, ... }
{ "domain": "datascience.stackexchange", "id": 3124, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, python, data-mining, sentiment-analysis, twitter", "url": null }
ros, ros-melodic, gazebo-ros Title: Cannot teleop turtlebot3 in gazebo with melodic I am trying to control a turtlebot3 in gazebo using ROS. I can do this without a problem in Ubuntu 16 ros kinetic (gazebo 7). But I cannot do the same thing with same commands in Ubuntu 18 ros melodic (gazebo 9) Here's the log shown from roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch in ros melodic xacro: in-order processing became default in ROS Melodic. You can drop the option. started roslaunch server http://xxxxxx:45893/ SUMMARY ======== PARAMETERS * /gazebo/enable_ros_network: True * /robot_description: <?xml version="1.... * /rosdistro: melodic * /rosversion: 1.14.5 * /use_sim_time: True NODES / gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) spawn_urdf (gazebo_ros/spawn_model) auto-starting new master process[master]: started with pid [3042] ROS_MASTER_URI=http://localhost:11311
{ "domain": "robotics.stackexchange", "id": 35112, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-melodic, gazebo-ros", "url": null }
java, array, search return indices; } Here is an O(mn) solution. Given that haystack is about 1000 in length and needle is 5 or smaller, the simplest code to do the search is probably the best. But if testing for equality is expensive, there are things we can do to mitigate that, although I'm not sure switching to KMP or BM will help so much given that we're dealing with Object here. // assumes no null entries // returns starting index of first occurrence of needle within haystack or -1 public int indexOf(final Object[] haystack, final Object[] needle) { foo: for (int a = 0; a < haystack.length - needle.length; a++) { for (int b = 0; b < needle.length; b++) { if (!haystack[a+b].equals(needle[b])) continue foo; } return a; } return -1; }
{ "domain": "codereview.stackexchange", "id": 23, "lm_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, array, search", "url": null }
electric-circuits, charge, electrical-resistance, capacitance, voltage You can also consider situations that do not match either of these two. For example, maybe your capacitor starts with voltage $2V_1$ and decays down to voltage $V_1.$ That requires a new choice of $\alpha_1,$ namely $$V(t) = V_1 + V_1 e^{-t/(RC)}.$$All of these are valid, it just depends on what the battery voltage $V_1$ is and what the initial condition voltage $V_0$ is. You can always write this as $$V(t) = V_1 + (V_0 - V_1) e^{-t/(RC)}.$$
{ "domain": "physics.stackexchange", "id": 61790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, charge, electrical-resistance, capacitance, voltage", "url": null }
supplementary, because two right angles add to a straight angle, so the opposite sides of a rectangle are parallel. Log in. asked Jan 19, 2019 in Mathematics by Bhavyak ( 67.3k points) quadrilaterals Quadrilaterals . Say m alternate interior angles equal. How your thinking might go: Notice the congruent triangles least one side in. Free answer to your question ️ prove that opposite sides of a parallelogram has opposite of... Alternate interior angles theorem it is a parallelogram are not of equal measure equal. Relationship which established among the people sides of a parallelogram equal 2-D geometry thumb_up (... Given then use CPCTC to say all their parts match and say what makes! 1 here ’ s a game plan that summarizes your basic argument or chain of logic ️ prove opposite... Way to begin a proof is to think through a game plan that summarizes your basic argument or of. State the given then use CPCTC to say all their parts match and what! Show game plans followed by the resulting
{ "domain": "boshuisnijhildenberg.nl", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140216112959, "lm_q1q2_score": 0.8593533406826788, "lm_q2_score": 0.8887587949656841, "openwebmath_perplexity": 571.5825052222348, "openwebmath_score": 0.7450726628303528, "tags": null, "url": "http://boshuisnijhildenberg.nl/g2wu81ag/6cbd21-prove-that-opposite-angles-of-a-parallelogram-are-equal" }
• The "just less" should be justified. It might be "a tad bit more than just a little less" – Hagen von Eitzen Jun 4 '18 at 14:56 • I disagree with @HagenvonEitzen; obviously $99<100$ so $\log99<\log100$—and since you’re dealing with the floor function, how much less it is is irrelevant. [+1] – gen-z ready to perish Jun 4 '18 at 15:05 • @ChaseRyanTaylor Note that in general, $\lfloor n x\rfloor \ne n\lfloor x\rfloor$. How much less is highly relevant. How much relevant? Remove just $0.3\%$ from $\log_{10}(99)$ and you're wrong. – Jean-Claude Arbaut Jun 4 '18 at 15:28 • @Jean-ClaudeArbaut Ohhh, now I see! Good point $\ddot\smile$ In my mind I was thinking backwards; I was focusing on how close $\log99$ is to $\log100$, not how far away it is. – gen-z ready to perish Jun 4 '18 at 17:21
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812336438724, "lm_q1q2_score": 0.8048633300195649, "lm_q2_score": 0.8311430478583168, "openwebmath_perplexity": 411.12583893920413, "openwebmath_score": 0.8391745686531067, "tags": null, "url": "https://math.stackexchange.com/questions/2807758/how-many-digits-is-9999-without-a-calculator" }
game-ai, search, efficiency, uninformed-search, informed-search There is also an algorithm called Iterative Deepening A* which has a much better space complexity, at the cost of often being slower. It is still an informed search algorithm using exactly the same kind of information as A* though.
{ "domain": "ai.stackexchange", "id": 612, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "game-ai, search, efficiency, uninformed-search, informed-search", "url": null }
symmetry, definition, supersymmetry Title: What is $R$-symmetry with supersymmetric theory? What is $R$-charge and $R$-symmetry? In usual context, $\mathcal{N}=2$ supersymmetry has $U(1)$ $R$-symmetry. I don't understand what this means. Could you explain to me with more examples? $R$-symmetry with relevant gauge groups would be helpful. For example in $d=7$, $\mathcal{N}=2$ supergravity we have R symmetry $R=sp(2)$. I wonder where this comes from. An R-symmetry is any global symmetry that transforms the supercharge or supercharges – often in a theory with extended supersymmetry, one in which the supersymmetry generators $Q_i^\alpha$ carry an extra internal index $i$ – into each other. It is typically $U(1)$ for non-extended $N=1$ supersymmetry and becomes non-Abelian, like $SU(2)$ or $SU(4)$, in extended SUSY.
{ "domain": "physics.stackexchange", "id": 32654, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "symmetry, definition, supersymmetry", "url": null }
ds.algorithms, functional-programming, hash-function Question 2: Can I implement it if $f$ keeps some state? Neel's observation still holds. You can't. Question 3: Huh? But I did implement a version that works slow! First, I believe your implementation is not polymorphic. Second, and more important, even if there is no injection from $\mathbb{Z}\to\mathbb{B}$ to $\mathbb{Z}$, there is one from the elements of $\mathbb{Z}\to\mathbb{B}$ that your program constructs in some finite time. (If you give up polymorphism but not state, then there is a way to find a counterexample to any potential implementation. I learned this from Paulo Oliva, but I don't know how yet.) Question 4: That's all good and theoretical. Can you also tell me something actually helps me write my program?
{ "domain": "cstheory.stackexchange", "id": 731, "lm_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, functional-programming, hash-function", "url": null }
genetics, molecular-biology, dna Title: Do I need primers if ordering from a DNA synthesis provider Do I need to design / synthesize primers for PCR if I am ordering from a DNA synthesis company and they are providing free cloning into my preferred vector backbone? Any good reason to order primers as well? Only if you intend to subsequently amplify the DNA you've ordered. I tend to never fully trust anything I don't confirm myself so primers to sequence the insert in the construct they give you might not be a bad idea either.
{ "domain": "biology.stackexchange", "id": 6474, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "genetics, molecular-biology, dna", "url": null }
You want something like this: An alternative way to express this is to assume one or more solutions or examples exists. Then there must be a smallest solution or example—a minimal counterexample. We then prove that if a smallest solution exists, it must imply the existence of a smaller solution (in some sense)—which again proves that the existence of any solution would lead to a contradiction. (Citations from WP) As it is indicated in the text, this is just a reformulation of said proof. If I were to borrow André's argumentation, I would write:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9648551556203815, "lm_q1q2_score": 0.8239021239289726, "lm_q2_score": 0.8539127548105611, "openwebmath_perplexity": 241.47541558849804, "openwebmath_score": 0.9149721264839172, "tags": null, "url": "https://math.stackexchange.com/questions/2779723/show-x2-y2-z2-2xyz-has-no-non-trivial-solutions-using-infinite" }
agi, human-like, superintelligence, mythology-of-ai Everyone is just guessing, and we still don't if AGI is possible, or merely a myth. Nevertheless, recent breakthroughs are promising!
{ "domain": "ai.stackexchange", "id": 567, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "agi, human-like, superintelligence, mythology-of-ai", "url": null }
ecology, marine-biology At equilibrium, the biomass in a trophic level is equal to (inflow/turnover rate) or (inflow $\times$ residence time). If consumers at a particular level consume one tonne of biomass per month (assume 100% efficiency for now) and the residence time is 6 months, the standing stock or quantity of biomass at that level will be 6 tonnes. Taking some of the numbers from the paragraph above: suppose the residence time for phytoplankton is 4 days while of consumers is 400 days. If the consumers have a 10% efficiency for taking up phytoplankton biomass, then the consumer biomass will be $(400~\textrm{days}/4~\textrm{days}) \times 10\% = 10$ times higher than the phytoplankton biomass.
{ "domain": "biology.stackexchange", "id": 11052, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ecology, marine-biology", "url": null }
Hence, by the Inclusion-Exclusion Principle, the number of positive integers less than or equal to $$200$$ which are odd or divisible by $$3$$ or divisible by $$5$$ is $$100 + 66 + 40 - 33 - 20 - 13 + 7 = 147$$ • Thankyou so much for the clear explanation!! – kili Feb 12 at 19:28 There is a simplier way to count the number. First let separate the even and odd numbers. There are $$100$$ odd numbers between $$1$$ and $$200$$. All of them are part of the answer. We will continue only with even number. We will use the inclusion-exclusion principle, as you did.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806478450307, "lm_q1q2_score": 0.8254779366088689, "lm_q2_score": 0.8418256452674008, "openwebmath_perplexity": 156.88696803420038, "openwebmath_score": 0.9727140069007874, "tags": null, "url": "https://math.stackexchange.com/questions/3543770/how-many-of-the-integers-between-1-and-200-are-odd-numbers-or-divisible-by" }
python, scikit-learn, clustering, visualization G = nx.Graph() n = len(linkage_matrix) for i in range(n): row = linkage_matrix[i] G.add_edge(label(int(row[0])),label(n+i+1),len=1+0.1*(math.log(1+row[2]))) G.add_edge(label(int(row[1])),label(n+i+1),len=1+0.1*(math.log(1+row[2]))) dot = nx.nx_pydot.to_pydot(G).to_string() dot = graphviz.Source(dot, engine='neato') dot.render(format='pdf',filename='tree') This specific format to me looks like graphviz. So if you can extract the tree edges from your original object, then you can render it, example below (some roundabout to convert between different objects): import networkx as nx import pydot import graphviz # Just a part of your graph G = nx.Graph() ed = [('n3','n0'), ('n0','MusicHendrixA'), ('n0','MusicHendrixB'), ('n3','n2'), ('n2','n8'), ('n8','MusicBergA'), ('n8','MusicBergB') ] G.add_edges_from(ed)
{ "domain": "datascience.stackexchange", "id": 10015, "lm_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, scikit-learn, clustering, visualization", "url": null }
matlab, fft, frequency-spectrum, cross-correlation, estimation UPDATE: So thinking about this some more, I determined what I was doing was equivalent to just taking the two sequences and performing a circular convolution on them and saving the maximum value. This is the same as computing the FFT of the sequences and then cross correlating them and saving the zero lag value. With this method I end up doing something like ifft(fft(x).*conj(fft(y))) to do the circular correlation quickly, although I'm still trying to determine if this is more efficient than what i was doing before... Regarding the problem with high correlation values, this happens when both signals are not zero-mean. Assume two signals $x[k]$ and $y[k]$ of length $N$ each. Each signal can be decomposed into the sum of a constant and a mean-free signal as follows: $$x[k] = \overline{x} + x_0[k]$$ with $\overline{x}$ being the mean $$\overline{x} = \frac{1}{N} \sum_{k=0}^{N-1}x[k]$$ and $x_0[k] = x[k] - \overline{x}$. Do the same to get $$y[k] = \overline{y} + y_0[k]$$
{ "domain": "dsp.stackexchange", "id": 1076, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "matlab, fft, frequency-spectrum, cross-correlation, estimation", "url": null }
control-engineering, control-theory, dynamics, kinematics This way, at time t, we determine the voltage to achieve the desired angles for each independent motor, then plug that into our DC motor model to obtain the generated torques: $$\tau_1, \tau_2$$ We then plug these torques into the dynamics to get the actual angles, taking into account the coupling forces, and then use the actual angles compared to the desired angles in order to generate the error signal that feeds into the PID control loop. Does this approach make sense? If not, where have I gone wrong and how can I simulate the error signal due to coupling forces?
{ "domain": "engineering.stackexchange", "id": 958, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "control-engineering, control-theory, dynamics, kinematics", "url": null }
physical-chemistry, equilibrium, analytical-chemistry $$K_{aqua} = \frac{[\ce{CH3COOCH2CH3}]}{[\ce{CH3COOH}][\ce{CH3CH2OH}]}$$ $$K_{ethanol} = \frac{[\ce{CH3COOCH2CH3}][\ce{H2O}]}{[\ce{CH3COOH}]}$$ $$K_{ethylacetate} = \frac{[\ce{H2O}]}{[\ce{CH3COOH}][\ce{CH3CH2OH}]}$$ $$K_{acetic acid} = \frac{[\ce{CH3COOCH2CH3}][\ce{H2O}]}{[\ce{CH3CH2OH}]}$$
{ "domain": "chemistry.stackexchange", "id": 11658, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, equilibrium, analytical-chemistry", "url": null }
dirac-equation, mesons Title: Clarifying with Dirac equation The Dirac equation has a solution, $\Psi(x^\mu) = Ae^{-ip_\mu x^\mu / \hbar} u(p^\mu)$ and $\Psi(x^\mu) = Ae^{+ip_\mu x^\mu / \hbar} \nu(p^\mu)$, where $u(p^\mu)$ corresponds to the particle solution and $\nu(p^\mu)$ corresponds to the anti-particle solution. From the wiki article about meson there is a line there that says, " according to the Dirac equation, a quark and an antiquark have opposite intrinsic parities ". Now my question , is this because that the exponent in the particle solution is negative while the anti-particle solution is positive? Just want to clarify. Now if this is not the case can someone give an insight given this four set of solutions, Yes, the opposite intrinsic parities of anti-particles can be seen from the signs in the exponents.
{ "domain": "physics.stackexchange", "id": 98553, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "dirac-equation, mesons", "url": null }
The alternating tensor can be used to write down the vector equation z = x × y in suffix notation: z i = [x×y] i = ijkx jy k. (Check this: e.g., z 1 = 123x 2y 3 + 132x 3y 2 = x 2y 3 −x 3y 2, as required.) Each part can reveal information that might not be easily obtained from the original tensor. These relations may be shown either directly, using the explicit form of f αβ, and f αβ * or as consequences of the Hamilton‐Cayley equation for antisymmetric matrices f αβ and f αβ *; see, e.g., J. Plebański, Bull Acad. According to the Wiki page: ... Only now I'm left confused as to what it means for a tensor to have a spin-1 decomposition under SO(3) but that not describe the spin of the field in the way it is commonly refered to. This means that traceless antisymmetric mixed tensor $\hat{T}^{[ij]}_{k}$ is equivalent to a symmetric rank-2 tensor. The symmetry-based decompositions of finite games are investigated. In these notes, the rank of Mwill be denoted by 2n. Decomposition
{ "domain": "noiwatdan.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9895109093587028, "lm_q1q2_score": 0.9155251311078471, "lm_q2_score": 0.9252299519377654, "openwebmath_perplexity": 1171.1674094407806, "openwebmath_score": 0.9022778868675232, "tags": null, "url": "http://noiwatdan.com/black-colour-haawwfu/0556c0-decomposition-of-antisymmetric-tensor" }
optics, polarization Title: What stops Hank Green's 2D glasses work in IMAX cinemas? 2D glasses work by having the same direction polarisation lens in both eyes, letting people who normally get headaches from 3D films, watch 3D glasses with friends (obviously, if they're on their own they can just go watch 2D movies) However on the purchase page they say: Note: 2D glasses work in 3D cinemas. However, they do not work at IMAX theatres.
{ "domain": "physics.stackexchange", "id": 32701, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "optics, polarization", "url": null }
gravity, centrifugal-force So in that moment, you are pressed against the side of the car (the door) in the same manner as you are pressed against the ground by gravity in any normal situation. It can therefore seem like "gravity acting sideways" on your body when a car turns. Or in the case of the water in the bucket it seems like "gravity acting upwards" on the water, when the bucket is above your head. And in the case of water poured into the cup in the spinning aircraft, it is exactly the same - it seems that "gravity acts downwards seen from the aircraft, even when the aircraft is turned up-side down". But as explained this isn't gravity, but just the tendency of objects to continue on their path when they are set in motion. This feeling or tendency is in everyday terms named "centrifugal force". And all this will only work if gravity is overcome. Otherwise the water would just fall downwards (as if you swung the bucket of water to slowly).
{ "domain": "physics.stackexchange", "id": 31743, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gravity, centrifugal-force", "url": null }
python, strings Title: Find first unique character in string I intentionally avoided Python tools which would make this even more trivial. I would like to be reviewed on efficiency, style, and obviously if there is a bug I would like to know. def unique_char(s): ''' Find first non-repeated char in a string ''' myDict = {} first = len(s) for c in s: if c in myDict.keys(): myDict[c] += 1 else: myDict[c] = 1 if 1 in myDict.values(): for k,v in myDict.items(): if v == 1: if s.index(k) < first: first = s.index(k) return s[first] return(False) The docstring is not quite right: "Find first non-repeated char in a string" — and then what? It should say explicitly that it returns the character. The function returns False if all characters are repeated. This is a bad idea: it would be easy for the caller to forget to check. It's better to raise an exception in exceptional cases.
{ "domain": "codereview.stackexchange", "id": 16528, "lm_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, strings", "url": null }
(ODEs) play a vital role in engineering problems. 2 Package deSolve: Solving Initial Value Di erential Equations in R with the initial conditions: X(0) = Y(0) = Z(0) = 1 Where a, band care three parameters, with values of -8/3, -10 and 28 respectively. Differential Equations Calculator Applet This is a general purpose tool to help you solve differential equations numerically by any one of several methods. Now for some initial conditions--suppose the initial conditions are that x of 0 is 0, and x prime of 0 is 1. Wolfram|Alpha can solve many problems under this important branch of mathematics, including solving ODEs, finding an ODE a function satisfies and solving an ODE using a slew of. Linear first-order systems. 2, we notice that the solution in the first three cases involved a general constant C, just like when we determine indefinite integrals. Differential-Algebraic Equations (DAEs), in which some members of the system are differential equations and the others are purely algebraic,
{ "domain": "aeut.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9899864305585842, "lm_q1q2_score": 0.8184334602260644, "lm_q2_score": 0.8267117962054049, "openwebmath_perplexity": 353.133644874304, "openwebmath_score": 0.6667168140411377, "tags": null, "url": "http://ulpr.aeut.pw/solving-system-of-differential-equations-with-initial-conditions-calculator.html" }
pressure, air, atmospheric-science Title: Why I can't feel the difference of atmospheric pressure between a closed room and outside? As far as I know atmospheric pressure is the result of the weight of earth's atmosphere. It has an approximate value of $10^5 Nm^{-2}$. Then why I can't feel it? My physics teacher told me that we are used to it. If that is so then why I can't feel the lack of pressure under a roof or in a closed room? A side question: Does atmospheric pressure act equally in every direction like air pressure? To my guess it shouldn't. Because it is caused by its weight. Yes, atmospheric pressure is primarily caused by the weight of the atmosphere above you. This is why the pressure decreases as your altitude increases.
{ "domain": "physics.stackexchange", "id": 55642, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pressure, air, atmospheric-science", "url": null }
machine-learning, algorithms, optimization Instead here you seem to have a combinatorial optimisation problem. A well known example of this is the Travelling Salesman Problem. There are many possible algorithms to attack these kinds of problem. Which to choose may depend on other traits of the data, such as how quickly you can calculate the scores - both for the whole set and for individual changes. If calculating for changes is fast enough, you can use optimisers that work from a complete (but not yet optimal) solution and make changes. There is a free PDF/book called Clever Algorithms (Nature-Inspired Programming Recipes) covering selection choice amongst all the varied optimisers. This may allow you to find something optimal in terms of speed and reliability of algorithm. Here's a simple thing you could try though
{ "domain": "datascience.stackexchange", "id": 7802, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, algorithms, optimization", "url": null }
ros /septentrio/SbfBaseLine_1_0 233 msgs : std_msgs/String /septentrio/SbfBaseVectorGeod_1_0 233 msgs : std_msgs/String /septentrio/SbfDOP_2 233 msgs : std_msgs/String /septentrio/SbfEndOfAtt_1_0 233 msgs : std_msgs/String /septentrio/SbfEndOfPVT_1_0 233 msgs : std_msgs/String /septentrio/SbfGeoCorrections_1_0 233 msgs : std_msgs/String /septentrio/SbfPVTGeodetic_2_1 233 msgs : std_msgs/String /septentrio/SbfPVTResiduals_2_1 233 msgs : std_msgs/String /septentrio/SbfPosCovGeodetic_1_0 233 msgs : std_msgs/String /septentrio/SbfPvtSatCartesian_1_0 233 msgs : std_msgs/String /septentrio/SbfRAIMStatistics_2_0 233 msgs : std_msgs/String
{ "domain": "robotics.stackexchange", "id": 13061, "lm_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", "url": null }
c#, performance In your Program (or wherever): CR_101636._Main(args);
{ "domain": "codereview.stackexchange", "id": 15367, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance", "url": null }
python, beginner, python-3.x, machine-learning, neural-network And finally you are passing way too many variables around, with different groups of four variables that are always passed in the same order. You need to refactor your code into a class so that class knows the variables without passing the arguments. And you need to put them into a stack and get them from the stack to make things easier. def sqrt_inv(n): return (1 / n) ** 0.5
{ "domain": "codereview.stackexchange", "id": 44691, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, python-3.x, machine-learning, neural-network", "url": null }
complexity-theory, p-vs-np What kind of near-immediate effect would a thorough, accurate, and constructive proof of $P=NP$ have on the practical world? People have given good answers assuming that $P=NP$ with some really large constant. I'm going to play the optimist and assume that we find a proof of $P=NP$ with a tractably small constant. Perhaps not likely, but I'm going to try to give some insight into what sorts of things would happen if we could efficiently solve all $NP$ problems.
{ "domain": "cs.stackexchange", "id": 5793, "lm_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, p-vs-np", "url": null }
php, object-oriented if (isset($_POST['db']['password'])) { $_POST['db']['password'] = filter_var($_POST['db']['password'], FILTER_SANITIZE_MAGIC_QUOTES); } if (isset($_POST['db'])) { $config['db'] = $_POST['db']; echo $this->installDatabase($config); } else { echo $this->installDatabase(); } } /** * Method for installing database config to config.php * * @param null $config * @return null; */ public function installDatabase($config = null) { $comments = ""; $tokens = token_get_all(file_get_contents('./Config/config.inc.php')); foreach ($tokens as $token) { if ($token[0] == T_COMMENT || $token[0] == T_DOC_COMMENT) { $comments .= $token[1] . "\n"; } }
{ "domain": "codereview.stackexchange", "id": 18840, "lm_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": null }
java, strings, array, random for (int j = 0; j < randomIrregularArray[i].length; j++) { randomIrregularArray[i][j] = random.nextInt(); } } } /** * Renders Random2dIntArray to a String type. * @return a String representation of the Random2dIntArray */ public String toString() { String arrayAsString = ""; for (int outerIdx = 0; outerIdx < random2dIntArray.length; outerIdx++) { arrayAsString = arrayAsString.concat(String.format("outer[%d]: ", outerIdx)); for (int innerIdx = 0; innerIdx < random2dIntArray[outerIdx].length; innerIdx++) { arrayAsString = arrayAsString.concat(String.format("[%d]: %d ", innerIdx, random2dIntArray[outerIdx][innerIdx])); } arrayAsString = arrayAsString.concat(System.lineSeparator()); } return arrayAsString; }
{ "domain": "codereview.stackexchange", "id": 17950, "lm_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, strings, array, random", "url": null }
ros-groovy, osx Title: rosmake tf2 osx fails When I try to rosmake -a in osx Mountain Lion, it fails in tf2 package. I am following the installation tutorial ros.org/wiki/groovy/Installation/OSX/Homebrew/Source, with the exception that I am compiling rviz direclty from git devel version. I get the following output. mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=/Users/mllofriu/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/rostoolchain.cmake .. CMake Error at /usr/local/Cellar/cmake/2.8.10.1/share/cmake/Modules/Platform/Darwin.cmake:190 (message): CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT: "" is not set to a MacOSX SDK with a recognized version. Either set CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to empty. Call Stack (most recent call first): /usr/local/Cellar/cmake/2.8.10.1/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include) -- Configuring incomplete, errors occurred! make: *** [all] Error 1
{ "domain": "robotics.stackexchange", "id": 12486, "lm_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-groovy, osx", "url": null }
black-hole, gravitational-waves, supermassive-black-hole Question: could someone qualified give an estimate of the magnitude of the space-time deformation we would experience on planet Earth, had the collision happened closer to us? I.e. how close would the collision have to happen for the space-time deformation to be millimeters? What about meters? At what magnitude of the deformation would the gravitational wave be dangerous or lethal for humans on planet Earth? Bryan Greene described the gravitational wave deformation of space-time as a temporary "shrinkage" or "compression" of Earth (and everything on it). Am I right to assume that being compressed by even 1 centimeter could potentially be lethal for all live on Earth? Part of the answer is easy. The strain measured in that event was about $0.25\times 10^{-21}$. That is an object $1m$ long would be squeezed by $0.25\times 10^{-21} m$ in one direction and stretched by the same amount in the orthogonal direction.
{ "domain": "astronomy.stackexchange", "id": 4849, "lm_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, gravitational-waves, supermassive-black-hole", "url": null }
fluid-dynamics, aerodynamics, viscosity, navier-stokes The section OP is refering to is on dimensional analysis (similarity) and within that context the author is refering to: flows over two bodies of different shapes... I think we can safely assume these bodies have a relative large size which together with the quote above results in the assumption that: $$\tau_{xx} = \lambda\vec{\nabla}\cdot\vec{v}+2\mu\frac{\partial u}{\partial x} \sim 0$$ I think the author blatantly assumed this without proof (e.g. by dimensional analysis) and simplified the expression too quickly. It happens sometimes in technical literature.
{ "domain": "physics.stackexchange", "id": 50766, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, aerodynamics, viscosity, navier-stokes", "url": null }
visible-light, electromagnetic-radiation, vacuum, aether Title: How do electromagnetic waves travel in a vacuum? This is perhaps a total newbie question, and I will try to formulate it the best I can, so here it goes. How does an electromagnetic wave travel through for example, the vacuum of space? I usually see that waves are explained using analogies with water, pieces of rope, the strings of a guitar, etc, but it seems to me that all those waves need a medium to propagate. In fact, from my point of view, in those examples the wave as a "thing" does not exist, it's just the medium that moves (involuntary reference to The Matrix, sorry). But in space there is no medium, so how does a wave travel? Are there free particles of some sort in this "vacuum" or something? I believe the existence of "ether" was discarded by Michelson and Morley, so supposedly there isn't a medium for the wave to travel through.
{ "domain": "physics.stackexchange", "id": 37852, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "visible-light, electromagnetic-radiation, vacuum, aether", "url": null }
atomic-physics, physical-chemistry, atoms Title: What makes atoms stick together? I just need help finding out what makes them stick together. I tried looking here and I found why they stick but not how. There are two forces that hold an individual atom together. The electromagnetic force keeps the atom's electrons in orbit around the nucleus. And the strong nuclear force binds the protons and neutrons together in the atom's nucleus.
{ "domain": "physics.stackexchange", "id": 71850, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "atomic-physics, physical-chemistry, atoms", "url": null }
Coordinates; Converting Triple Integrals to Cylindrical Coordinates; Volume in Cylindrical Coordinates; Spherical Coordinates; Triple Integral in Spherical Coordinates to Find Volume; Jacobian of the Transformation (2x2) Jacobian of the Transformation (3x3) Plotting Points in Three Dimensions; Distance Formula for Three Variables Expanded in 3-dimensional Cartesian coordinates (see Del in cylindrical and spherical coordinates for spherical and cylindrical coordinate representations), The del operator in this system leads to the following expressions for gradient, divergence, curl and Laplacian: respectively. Definition The cylindrical coordinates of a point P ∈ R3 is the ordered triple (r,θ,z) defined by the picture. Orthogonal Coordinate Systems In electromagnetics, the fields are functions of space and time. Dirac and Function We will calculate the line integral of a vector field along this contour. Cartesian Cylindrical Spherical Coordinates Coordinates Coordinates Coordinate
{ "domain": "menubuddy.sg", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.992422760300897, "lm_q1q2_score": 0.8204475964078123, "lm_q2_score": 0.8267117898012105, "openwebmath_perplexity": 683.347574851877, "openwebmath_score": 0.8974097967147827, "tags": null, "url": "http://menubuddy.sg/ls-swap-p4psh/lkgvx---curl-in-cylindrical-coordinates-calculator---du3s.html" }
c++, performance, strings, c++20 +-------------------------+--------+------+------------------------------+ |METHOD |CLASS |TIME |NOTES | +-------------------------+--------+------+------------------------------+ |create empty |xstring |0 | | | |string |0 | | +-------------------------+--------+------+------------------------------+ |create by string |xstring |56 | | | |string |0 | | +-------------------------+--------+------+------------------------------+ |create by character |xstring |58 | | | |string |7 |Unavailable, used to_string() | +-------------------------+--------+------+------------------------------+ |create by bool |xstring |45 | |
{ "domain": "codereview.stackexchange", "id": 43152, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, strings, c++20", "url": null }
homework-and-exercises, rotational-dynamics, moment-of-inertia Title: Moment of Inertia of a Ring about an axis inclined at $\frac {\pi}{4} $ radians with normal to plane of ring I have a thin Ring of mass $M$ and radius $R$, I have to find it's moment of Inertia about an axis passing through it's centre and at an angle of $\frac{\pi}{4}$ radians with the normal to the plane of the ring. My approach: I am trying to use perpendicular axes theorem. Suppose I place three mutually perpendicular axes on the centre so that one is the diameter, another one is perpendicular to it (also diameter), but on the plane of the ring, while the third is parallel to the normal, now I rotate the axes such that the one of them remains the diameter while the other two are mutually inclined at $\frac{\pi}{4}$ to the normal. Now, as I know the moment of Inertia about a diameter ($\frac{MR^2}{2}$) So the required moment of Inertia (say $I$) must be : $ I+I = \frac{MR^2}{2}$ from perpendicular axes theorem, So, $I = \frac{Mr^2}{4}$.
{ "domain": "physics.stackexchange", "id": 43718, "lm_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, rotational-dynamics, moment-of-inertia", "url": null }
c#, multithreading, asynchronous, task-parallel-library public void Stop() { var stopTasks = this.workflows.Select(w => w.StopAsync()).ToArray(); Task.WaitAll(stopTasks); } } Is this the correct way for the Engine to invoke in parallel the configure method on all workflows and then once all are completed, invoke in parallel the start method on all workflows? Your code is absolutely correct in case when you want to start workflows only when all of them are configured. But if you want to start each workflow once it's configured (independently from other workflows) then it might be a good idea to use continuations... In .NET 4.5 it would look like this: public sealed class Engine : IEngine { private readonly List<IWorkflow> _workflows; public Engine(IEnumerable<IWorkflow> workflows) { _workflows = new List<IWorkflow>(workflows); } private async Task RunWorkflow(IWorkflow workflow) { await workflow.ConfigureAsync(); await workflow.StartAsync(); }
{ "domain": "codereview.stackexchange", "id": 2797, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, multithreading, asynchronous, task-parallel-library", "url": null }
focused on force diagrams, energy conservation, translation and gravitational force is incorrectly identified as causing a change in angular velocity about the wheel's center of mass. The friction is kinetic friction. Now, because the ball is rolling without slipping, we can relate the angular acceleration to the linear acceleration of the center of mass: Substituting this expression allows us to express the acceleration as: Using the result that the moment of inertia for a sphere about an axis that passes through its center of mass is 2/5 m R 2, we have:. C) both the mass and the radius of the sphere. the kinematics of the wheel can be changed to represent sliding, rolling with sliding, rolling without slipping, rolling with slipping, and spinning. Rolling without slipping v H. The plank starts moving with acceleration a. Find the height h above the base, from where it has to start rolling down the incline such that the sphere just completes the vertical circular loop or radius R. We
{ "domain": "amicidellacattolica.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9817357227168956, "lm_q1q2_score": 0.8284819761123067, "lm_q2_score": 0.8438951104066293, "openwebmath_perplexity": 340.4795727430887, "openwebmath_score": 0.5913660526275635, "tags": null, "url": "http://xuqc.amicidellacattolica.it/acceleration-of-center-of-mass-rolling-without-slipping.html" }
star, hubble-telescope, gravitational-lensing, galaxy-cluster, earendel-whl0137-ls Caustic lines A lens model thus returns a magnification factor for each 2D point in the vicinity of the cluster. In certain regions called "caustic lines", or just caustics, which lie along 1D lines, the magnification increases tremendously (in principle to infinity). In the picture you see such a caustic, drawn in red. It bends smoothly around a handful of galaxies in the upper left corner, but where it comes close to the galaxy a little below the center, it bends around that one. The reason we're able to see Earendel is that it happens to lie almost exactly on top of the caustic. Figure 2 from the paper (which isn't yet available online, but I think it's ok to share here with proper credits) showing the caustics predicted from four different lens models:
{ "domain": "astronomy.stackexchange", "id": 6250, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star, hubble-telescope, gravitational-lensing, galaxy-cluster, earendel-whl0137-ls", "url": null }
php, object-oriented, authentication How do I determine which function should be implemented in the class? A good general set of rules to follow is GRASP. Another easy test is to look at what the class does and then check that the name matches that what it does. Your User apparently loads things from the database and checks passwords. Not exactly what I'd expect from a User. should I follow Single Responsibility principle? Yes, always. Except for when you can reasonably justify not to. Following SRP will make your code easier to maintain in the long run and will increase reuse possibilities. Once you assign multiple responsibilities, you will have to have the same set of responsibilities in another project if you want to reuse the class. And the chances for that are smaller than for single responsibilities. Wouldn't it be too extreme??
{ "domain": "codereview.stackexchange", "id": 4503, "lm_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, authentication", "url": null }
electromagnetism, electrostatics, mathematical-physics, potential-energy, crystals Although rarely cited, the real reason behind the conditional convergence of the Coulomb series is that for Coulomb point-like charges the boundary effects matter, they depend on the shape and charge of the surface and do not vanish relatively to the bulk contribution with increasing the size of the sample, as it happens for short-range potentials. Therefore, there is a clear physical origin of the conditional convergence of the sum. The only way to get a unique result is to decide which, among all possible boundary effects has to be chosen. It turns out that the choice of finite size cells which make vanishing the highest multipoles over the whole summation procedure is a wise choice because it allows to get a unique result and energy per particle of different structures which are comparable without need of taking into account the pesence of surface terms.
{ "domain": "physics.stackexchange", "id": 63409, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, electrostatics, mathematical-physics, potential-energy, crystals", "url": null }
human-biology, physiology, food, human-physiology Title: Can food swallowed when a person is upside down reach the stomach? If a person positions him/herself upside down and swallows food, will it reach the stomach against gravity? If so how? The eminent @JanDvorak has basically provided the full answer, but yes, it is possible. You can easily try this yourself, just lean off a bed and swallow something (small) and see what happens. Peristalsis in the esophagus is responsible for moving food down into the stomach. The big proof of this is that astronauts can eat when in space, when weightless. Their food is moved into the stomach just fine. It's easier to do it upright (peristalsis + gravity) as opposed to upside down (peristalsis - gravity) but definitely quite possible.
{ "domain": "biology.stackexchange", "id": 8196, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "human-biology, physiology, food, human-physiology", "url": null }
bond, orbitals So we perform some mathematically chicanery. If you are familiar with "even" and "odd" functions. An even function times an odd function is odd, and the product of two odd functions is even. The orbital $p_y$ is odd as it changes sign if $y \rightarrow -y$. However, $\ce{d_{x^2-y^2}}$ doesn't change signs under the same transformation and thus is even. This is evident if you look at the shape/diagram of the orbital. Thus their product is an odd function, and when evaluating the integral of an odd function over a symmetric interval (and doing so over all space is necessarily a symmetric interval because 3D space is isometric) is necessarily zero. Simple proof of this mathematical fact is given below: Consider an integral of the form (this is the same form as the 3D integral given in the first line, wherein your boudns are $-\infty$ and $+\infty$ for each of the three directions $x,y,z$ $$I=\int_{-a}^a f(x)\,\mathrm{d}x$$ $$I=\int_{-a}^a f(x)\,\mathrm{d}x$$
{ "domain": "chemistry.stackexchange", "id": 10224, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bond, orbitals", "url": null }
second-quantization, klein-gordon-equation $$ for $a^\dagger,a$, raising and lowering operators (respectively). The normal ordered Hamiltonian is then $$ H^{\mathtt{N.O.}}=\int d^3k E_ka^\dagger\left(\vec{k}\right)a\left(\vec{k}\right) $$ I understand that we needed a way to remove the negative energy solutions, but the book doesn't expand on why the new Hamiltonian is a "proper" candidate that admits positive energy eigenvectors and not negative ones. Even worse, in the next section, commutation relations between the lowering and raising operators and the Hamiltonian are taken as the same as with the non-normal ordered Hamiltonian without explanation. Let $\left| E \right>$ be a positive energy solution of the original Hamiltonian: $H\left| E\right>=E\left| E\right>$. How can I show that $H^{\mathtt{N.O}}\left| E\right>=E\left| E\right>$, or the weaker proposition (where the energy is not the same) $H^{\mathtt{N.O}}\left| E\right>=E'\left| E\right>$ where $E'>0$? What I tried was to use the relation: $$
{ "domain": "physics.stackexchange", "id": 99525, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "second-quantization, klein-gordon-equation", "url": null }
c++, locking, winapi, c++03, raii void somefunction(void) { GetLock<LockableClass> lock(queue); ... } Here the only requirement of LockableClass is that is has Lock() and Unlock() methods. Specialisations of the class are provided for CRITICAL_SECTION, etc. However, in the case of there being several queues, only some of which need to be locked at one time, I would like the following to be possible: void somefunction(void) { list<GetLock<LockableClass> > locks; for (vector<LockableClass>::iterator its = queues.begin(); queues.end() != its; ++its) if (some_condition) locks.push_back(GetLock<LockableClass>(*its)); ... }
{ "domain": "codereview.stackexchange", "id": 5004, "lm_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++, locking, winapi, c++03, raii", "url": null }
fft, signal-analysis, dft, frequency-domain Start with a continuous-time signal $x_c(t)$. (Optionally) filter the signal to make it band-limited to $f_s/2$. Sample the signal to get $x[n] = x_c(n/f_s)$. At this point, the spectrum is given by the sampling theorem. You will have spectrum aliasing if the sampled signal was not band-limited in step 2. Now apply a window of size M. The window type depends on your application (Rectangular (ugly), Hann, Hamming, Blackman, Flat top, etc.). At this point, your spectrum is that of the sampled signal, but convolved with the window (depending on window size and type, you will get some energy spread to other frequencies). This spectrum is $X_w(e^{j\theta})$. The DFT of the windowed signal will return samples of its spectrum, at frequencies $Y[k] = X_w( e^{j 2\pi k/N})$.
{ "domain": "dsp.stackexchange", "id": 7763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, signal-analysis, dft, frequency-domain", "url": null }
python, performance, object-oriented, file-system, logging #======= Create XLS workbook with a new sheet for each day of the logs def make_workbook(to_dir): wb = xlwt.Workbook() csv_files = os.path.join(to_dir, "*.csv") for filename in glob.glob(csv_files): ## Break everything down so we can use variables for names that relate the the file (f_path, f_name) = os.path.split(filename) (f_short_name, f_extension) = os.path.splitext(f_name) ws = wb.add_sheet(f_short_name) csvReader = csv.reader(open(filename, 'rb'))
{ "domain": "codereview.stackexchange", "id": 15632, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, object-oriented, file-system, logging", "url": null }
This question is over 2 years old, and has been discussed in the comments. So that this question does not remain listed as unanswered I will provide an approach. We consider $$S_{p}$$, the symmetric group on $$p$$ letters, with order $$p!$$. Subgroups of order $$p$$ must be cyclic. Notice that a subgroup of order $$p$$ contains $$p-1$$ elements of order $$p$$ and then also the identity element. On the other hand, given an element of order $$p$$, say $$x$$, then $$\langle x \rangle$$ is a group of order $$p$$. In particular every element of order $$p$$ is contained in precisely one subgroup of order $$p$$. (To put this another way, the intersection of any two subgroups of order $$p$$ is trivial). So, to find the number of subgroups of order $$p$$, we can find the number of elements of order $$p$$ and divide this number by $$p-1$$ (Since each subgroup is being counted $$p-1$$ times).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462179994596, "lm_q1q2_score": 0.8054058590805612, "lm_q2_score": 0.8152324938410784, "openwebmath_perplexity": 91.34934504684001, "openwebmath_score": 0.8575081825256348, "tags": null, "url": "https://math.stackexchange.com/questions/2254377/number-of-subgroups-of-order-n-in-s-n/3303639" }
general-relativity, gravity, black-holes, spacetime The problem is unfixable because it's rooted in the intrinsic oddness of the black hole geometry. If you try to define the diameter abstractly as a metric distance at a fixed $t$, you have to specify what $t$ is, and there is no natural choice. Dividing spacetime into space and time only makes sense in some sort of Newtonian limit, and black holes are far from Newtonian.
{ "domain": "physics.stackexchange", "id": 90535, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, gravity, black-holes, spacetime", "url": null }
Why does cross product give a vector which is perpendicular to a plane I was wondering if anyone could give me the intuition behind the cross product of two vectors $\textbf{a}$ and $\textbf{b}$. Why does their cross product $\textbf{n} = \textbf{a} \times \textbf{b}$ give me a vector which is perpendicular to a plane? I know I can just check this by using dot product but I'm not totally satisfied with "it just works" answer =) Thank you for any help! =)
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9683812299938007, "lm_q1q2_score": 0.8250151022667376, "lm_q2_score": 0.8519528019683106, "openwebmath_perplexity": 257.6203290431166, "openwebmath_score": 0.7788159847259521, "tags": null, "url": "https://math.stackexchange.com/questions/420006/why-does-cross-product-give-a-vector-which-is-perpendicular-to-a-plane" }
java, performance, algorithm, strings, file /** Write a numbered client file if <code>bb</code> not empty. */ private void buffer2file(ByteBuffer bb, int i) { bb.flip(); if (bb.hasRemaining()) { String fileName = "tasks_info_" + clientId + "_" + i + ".txt"; try (java.nio.channels.FileChannel fc = java.nio.channels.FileChannel.open( java.nio.file.Paths.get(fileName, NO_STRINGS), java.nio.file.StandardOpenOption.CREATE, java.nio.file.StandardOpenOption.WRITE)) { fc.write(bb); } catch (IOException ex) { ex.printStackTrace(); } } bb.flip(); } static final String NO_STRINGS[] = {}, LINE_SEPARATOR = System.getProperty("line.separator"); static final byte[] LINE_SEPARATOR_BYTES = LINE_SEPARATOR.getBytes(); static final int LS_LENGTH = LINE_SEPARATOR_BYTES.length;
{ "domain": "codereview.stackexchange", "id": 29400, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, algorithm, strings, file", "url": null }
java, performance, complexity for (int thirdValueIndex = secondValueIndex + 1; thirdValueIndex < numbers.length; thirdValueIndex++) { int thirdValue = numbers[thirdValueIndex]; int sum = firstValue + secondValue + thirdValue; if (sum == 0) { // Hit. } } } }
{ "domain": "codereview.stackexchange", "id": 39967, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, complexity", "url": null }
So, $U= \begin{bmatrix} 1 &1 &-2 \\ 0 &2 &1 \\ 0 &0 &\frac{-1}{2} \end{bmatrix}$ It means $U_{33} = \frac{-1}{2}$ Hence, $\textbf{Answer: D}$ $\textbf{Method 3:}$ Now, to find the complete solution for the given question, we can use this previous year question to find the $LU$ decomposition and then find $x_1$ After Applying $R_2 \leftarrow R_2 – R_1,$ $A$ becomes $\begin{bmatrix} 1 &1 &-2 \\ 0 &2 &1 \\ 2 &1 &-5 \end{bmatrix}$ and $E_{21}$ becomes $\begin{bmatrix} 1 &0 &0 \\ -1 &1 &0 \\ 0 &0 &1 \end{bmatrix}$ After Applying $R_3 \leftarrow R_3 – 2R_1,$ $A$ becomes $\begin{bmatrix} 1 &1 &-2 \\ 0 &2 &1 \\ 0 &-1 &-1 \end{bmatrix}$ and $E_{31}$ becomes $\begin{bmatrix} 1 &0 &0 \\ 0 &1 &0 \\ -2 &0 &1 \end{bmatrix}$ After Applying $R_3 \leftarrow R_3 + \frac{1}{2}R_2,$ $A$ becomes $\begin{bmatrix} 1 &1 &-2 \\ 0 &2 &1 \\ 0 &0 &\frac{-1}{2} \end{bmatrix}$ and $E_{32}$ becomes $\begin{bmatrix} 1 &0 &0 \\ 0 &1 &0 \\ 0 &\frac{1}{2} &1 \end{bmatrix}$
{ "domain": "gateoverflow.in", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.974434783107032, "lm_q1q2_score": 0.801169684950346, "lm_q2_score": 0.8221891283434876, "openwebmath_perplexity": 418.2588539697781, "openwebmath_score": 0.9993814826011658, "tags": null, "url": "https://gateoverflow.in/371901/gate-cse-2022-question-35" }
computability, programming-languages, computation-models Sketch of the author's proof: He does this by drawing from the derived relationship $M \in \mathcal{B}^{\prime}$ and $M \in \mathcal{E}(\cdots)$ (definition (5)) and then sets up the relationship $M^{*} \in \mathcal{E}^{*}(\cdots)$. For each component of $\mathcal{E}(\cdots)$ he draws a one-to-one mapping with those of $\mathcal{E}^*(\cdots)$. Thus by establishing the bridge between $M$ and $M^{*}$ through $\mathcal{E}(\cdots)$ the author proves $M \in \mathcal{B}^{\prime} \implies M^{*} \in \mathcal{B}^{\prime\prime}$.
{ "domain": "cs.stackexchange", "id": 1849, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computability, programming-languages, computation-models", "url": null }
# probability with martingales 12.2 sum of zero-mean independent variables in L^2 I am struggling with the following theorem from David Williams, Probability with Martingales: THEOREM Suppose that $$(X_{k}:k\in\mathbb{N})$$ is a sequence of independent random variables such that, for every $$k$$, $$E(X_{k})=0, \sigma_{k}^2:=Var(X_{k})<\infty$$. (a) Then $$\sum\sigma_{k}^2<\infty\Rightarrow\sum X_{k}\text{ converges a.s. .}$$ (b) If the variables $$(X_{k})$$ satisfies $$\exists K \in [0,\infty),\forall k, \omega,\\ |X_{k}(\omega)|\leq K,$$ then $$\sum X_{k}\text{ converges a.s.}\Rightarrow\sum\sigma_{k}^2<\infty.$$ The proof for the statement (a) is easy to understand, but I cannot get the other one. According to the proof, "since $$\sum X_{n}$$ converges a.s., the partial sums of $$\sum X_{k}$$ are a.s. bounded, and it must be the case that for some $$c$$, $$P(T=\infty)>0$$." Here $$T$$ is the stopping time $$T = \inf\{r: |\sum_{k=1}^r X_k| > c\}.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137879323496, "lm_q1q2_score": 0.8161939265799487, "lm_q2_score": 0.8311430415844384, "openwebmath_perplexity": 125.22180107966369, "openwebmath_score": 0.9692682027816772, "tags": null, "url": "https://math.stackexchange.com/questions/3158274/probability-with-martingales-12-2-sum-of-zero-mean-independent-variables-in-l2" }
navigation if __name__ == '__main__': w = Walk() w.run() Originally posted by mmwise with karma: 8372 on 2013-01-20 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by Chik on 2013-01-20: Thank you very much indeed. It works now. Comment by Christopher on 2013-10-15: Do you have the launch file for this example?
{ "domain": "robotics.stackexchange", "id": 12343, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation", "url": null }
Example: For $\theta=30$ and $T=164$, we found that the force $F=31.87$. Now here's my question: How do I find a function for $F$ that can handle "in between" values for both $\theta$ and $T$? Here's what I mean: I would like a function $F=f(\theta,T)$ for values like $\theta=34$ and $T=195$, or any values $\theta$ and $T$ that are not on the table above. However, I only need this function for the interval $\theta\in[10,60]$ and $T\in[101,200]$. Essentially, I am trying to approximate $F$ for all $\theta\in[10,60]$ and $T\in[101,200]$. I should note that I enjoy working on problems like these, so if somebody knows the answer, please try giving hints instead of solutions so that I can figure this out myself.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9433475778774728, "lm_q1q2_score": 0.8454765711645589, "lm_q2_score": 0.8962513828326955, "openwebmath_perplexity": 2125.100944096614, "openwebmath_score": 0.2426089644432068, "tags": null, "url": "https://mathematica.stackexchange.com/questions/66086/developing-a-function-of-two-variables-from-given-data" }
python, error-handling, library, web-scraping, beautifulsoup or also_acceptable = ( 'start on the next line' and ' use a single level of indent' ) # closing paren on next line, here # ) or here Pick one of the three, and be consistent. missing-docstring [8 counts] Although you have a docstring for the class (albeit not correctly formatted), none of its methods are documented. I would put your overall explanation as a module docstring, then have an addition docstring for at least every public method. I like the Google style, but there are others. multiple-statements [6 counts] To return, as promised, to: if "RATINGS" in label.text: key = "num_ratings" That line contains two statements, and should therefore be on two lines: if "RATINGS" in label.text: key = "num_ratings" Note that you could use a dictionary to simplify this, for example: KEYWORDS = {'RATINGS': 'num_ratings', ...} for keyword in KEYWORDS: if keyword in label.text: key = KEYWORDS[keyword] break
{ "domain": "codereview.stackexchange", "id": 10614, "lm_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, error-handling, library, web-scraping, beautifulsoup", "url": null }
MathJax reference. Access the answers to hundreds of Piecewise functions questions that are explained in a way that's easy for you to understand. Here, pupils watch as each graph is created and then pieced together to make a function. Define a piecewise function f(x) That has an input x, An individuals taxable income and an output the amount the person owes in federal income tax Marginal tax rate Taxable Over Not Exeeding \$0. Pieces may be single points, lines, or curves. It is a step function, and the graph is said to have "jump discontinuities " at the integers. Hence the name! Graphing a Piecewise Function. Some of the worksheets for this concept are Work piecewise functions, Work piecewise functions, Piecewise answers, Piecewise functions, Lesson 1 piecewise functions, Piecewise functions date period, Piecewise functions, Work piecewise functions name algebra 2. Consider the following piecewise-defined function F*-1 if is-5 f(x) = - 4x + 6 if x > -5 Step 1 of 3: Evaluate this
{ "domain": "m-spitzer.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9759464422083111, "lm_q1q2_score": 0.840815155525152, "lm_q2_score": 0.8615382147637196, "openwebmath_perplexity": 985.4630696164663, "openwebmath_score": 0.3814734220504761, "tags": null, "url": "http://m-spitzer.de/piecewise-functions-answers.html" }
java // Update the best shorthand color if the current similarity is higher if (similarity > maxSimilarity) { maxSimilarity = similarity; bestShorthand = "#" + toHex(r) + toHex(g) + toHex(b); } } } }
{ "domain": "codereview.stackexchange", "id": 44890, "lm_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 }
Of course, as it was stated above, the equality holds in the sense of distributions. In order to approach this same issue, i.e. showing that the equality follows from the theory of distributions, one can define the derivative of a function-type distribution (a distribution which in fact is a function in $L^1_{\text{loc}}(\mathbb R)$), as the limit, in the sense of distributions, of the usual incremental ratio, as follows: $$\theta(x) = \begin{cases} 0\quad \text{ if } x\le 0\\ 1\quad \text{ if }x>0. \end{cases}$$ Then the functions $$\delta_\varepsilon (x) \equiv \frac{\theta(x)-\theta(x-\varepsilon)}{\varepsilon}$$ for, say, $\varepsilon>0$ are in fact $$\delta_\varepsilon(x) = \begin{cases} 0\quad\text{ if }x<\varepsilon\\ \dfrac{1}{\varepsilon}\quad\text{ if }0< x\le\varepsilon\\ 0\quad\text{ if }x\le0 \end{cases} =\varepsilon^{-1}\chi_{(0,\varepsilon]}(x) =\varepsilon^{-1}\chi_{(0,1]}\left(\frac{x}{\varepsilon}\right),$$ where $\chi_{B}$ is the characteristic function of $B$. Now,
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877700966099, "lm_q1q2_score": 0.8307642395998056, "lm_q2_score": 0.8558511451289037, "openwebmath_perplexity": 181.9418406227583, "openwebmath_score": 0.9733068346977234, "tags": null, "url": "https://math.stackexchange.com/questions/13898/how-to-prove-that-the-derivative-of-heavisides-unit-step-function-is-the-dirac" }
catkin-make /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_set_upper_bounds1' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_set_min_objective' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_set_munge' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_add_inequality_mconstraint' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_set_force_stop' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_set_lower_bounds' /home/alex/planner_examples_ws/devel/lib/libcurvature_constrained_state_spaces.so: undefined reference to `nlopt_optimize'
{ "domain": "robotics.stackexchange", "id": 26246, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "catkin-make", "url": null }
b) This is very similar to part a). Here we only give the answer. For $1\leqslant i<j\leqslant n$, let ${\bf e}_{ij}$ be the $n\times n$ matrix whose entries in row number $i$ and column number $j$ AND in row number $j$ and column number $i$ are 1 while all other entries are zero, see for example ${\bf e}_{12}$ in a). For $1\leqslant k\leqslant n$, let ${\bf e}_{kk}$ be the $n\times n$ matrix whose entry in row number $k$ and column number $k$ is one while all other entries are zero. Then the list ${\bf e}_{ij}$ for all $1\leqslant i\leqslant j\leqslant n$ is a basis of the space of $n\times n$ symmetric matrices.
{ "domain": "linearalgebras.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9930961609071284, "lm_q1q2_score": 0.8024884452390356, "lm_q2_score": 0.8080672112416737, "openwebmath_perplexity": 98.26305144965409, "openwebmath_score": 0.9707024097442627, "tags": null, "url": "https://linearalgebras.com/ladw-exercise-1-2-4.html" }
jupyter Title: Collaborating on Jupyter Notebooks I have prepared Jupyter Notebook with some findings and I shared it with other team members through GitHub to get their feedback in a written form. It used to work like this when working together on a piece of code but does not work for Jupyter Notebook. In GitHub that would mean commenting on HTML or JSON level (internal markup for .ipynb files), not on the document level. An alternative would be for team members to clone the repo and puts inline comments in the document. That's an additional effort for other team member I would like to avoid. What is the way you collaborate, peer review and provide feedback when working on Jupyter Notebooks? There are several collaboration platforms with hosted notebooks that can be shared like: Google Colab Kaggle Kernels Deepnote Binder Curvenote Noteable Etc.
{ "domain": "datascience.stackexchange", "id": 11472, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "jupyter", "url": null }
c++, matrix class row { //class for matrix row object. Pass in a // vector and overload `[]`. std::vector<int> _row; public: // constructor row(std::vector<int> r) : _row(r) { } // overload `[]` to return y element. // note `.at()` does a range check and will throw an error // if out of range int operator[]( int y) { return _row.at(y); } }; // overload [] to return x element row operator[]( int x) { return row(m.at(x)); } int get_value ( int x, int y ) { // Function: get_value // Definition: returns value `v` of element // `xy` in matrix `M`. return m[x][y]; } void assign_value ( int x, int y, int v ) { // Function: assign_value // Definition: Assigns value `v` to element // `xy` in matrix. m[x][y] = v; }
{ "domain": "codereview.stackexchange", "id": 32003, "lm_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++, matrix", "url": null }
ros, rosbag, rxbag, clock, rqt-bag Original comments Comment by Stephane.M on 2013-05-21: I have a question : why would you want not to use rosbag play ? Is there any particular reason, advantages in rxbag or rqt_bag ? (except the graphical interface) Comment by Miguel Riem de Oliveira on 2013-05-23: Hi Stephane Comment by Stephane.M on 2013-05-23: hi ! You did not answer my question :-) Comment by Miguel Riem de Oliveira on 2013-05-23: Sorry. Had a problem with the browser. Yes there are many advantages. With rxbag or rqt_bag you can move forward or backward in time, jump to a specific time in the bag, change in real time the playback rate, etc. There are many advantages. Regards Miguel Comment by Johannes Meyer on 2013-07-15: Created a ticket: https://github.com/ros-visualization/rqt_common_plugins/issues/102 Comment by georgebrindeiro on 2013-09-17: I was looking for that just now! Thanks for creating the ticket, I totally back this feature. Comment by mark_vision on 2015-08-10:
{ "domain": "robotics.stackexchange", "id": 14172, "lm_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, rosbag, rxbag, clock, rqt-bag", "url": null }
c#, algorithm, programming-challenge, sorting, graph should have finished both courses \$1\$ and \$2\$. Both courses \$1\$ and \$2\$ should be taken after you finished course \$0\$. So one correct course order is \$[0,1,2,3]\$. Another correct ordering is \$[0,2,1,3]\$.
{ "domain": "codereview.stackexchange", "id": 24089, "lm_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, programming-challenge, sorting, graph", "url": null }
electrostatics Note, that the capacity of the electroscope is not changed much by the movement of the needle (as the case is still far away from the needle). So, actually, an electroscope always measures the voltage applied to its terminals, or equivalently (connected by the electroscopes capacity) the charge transferred to the electroscope, but never directly the charge carried by some capacity it is connected to.
{ "domain": "physics.stackexchange", "id": 96641, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics", "url": null }
c#, game, console, tic-tac-toe Title: Tic Tac Toe in the Console I have made a Tic Tac Toe game in C#. How can I improve my code? The full listing is as follows: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading;
{ "domain": "codereview.stackexchange", "id": 11041, "lm_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#, game, console, tic-tac-toe", "url": null }
java, android, xml, static src wholepackagename activity MainActivity fragment FirstFragment SecondFragment res layout values ... With the code of src/wholepackagename/activity/MainActivity: public class MainActivity extends FragmentActivity implements FirstFragment.Callback { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() { public void onBackStackChanged() { int backCount = getSupportFragmentManager().getBackStackEntryCount(); if (backCount == 0) { finish(); } } });
{ "domain": "codereview.stackexchange", "id": 8678, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, android, xml, static", "url": null }
lagrangian-formalism, hamiltonian-formalism, constrained-dynamics Because your Lagrangian does not depends of $\dot q$, then $p = \frac{\partial L}{\partial \dot{q}} = 0$, and so : $$H(q, p) = - L(q, \dot q) = - \ln(q) + (2q-10)\lambda$$ From this hamiltonian, you get the equations of movement : $$\dot q = \frac{\partial H}{\partial p} ~,~\dot p = - \frac{\partial H}{\partial q}$$ So we have : $$\dot q = 0~,~\dot p = \frac{1}{q} - 2\lambda \tag{1}$$ From this, we cannot recover the equation obtained from Euler-Lagrange equations, we have to add the constraint $p = 0$. If $p = 0$, it means that $\dot p = 0$, and so : $$q = \frac{1}{2 \lambda}\tag{2}$$ This is coherent with the fact that $\dot q = 0$
{ "domain": "physics.stackexchange", "id": 8183, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lagrangian-formalism, hamiltonian-formalism, constrained-dynamics", "url": null }
• Btw, you can use MathJax to type equations: math.meta.stackexchange.com/questions/5020/…. Use dollar signs to enclose equations and backslashes for commands: \forall = $\forall$, \exists = $\exists$, etc. You can use detexify to find the name of a symbol. Aug 30 '20 at 19:03 • Your step from 1 to 2 is wrong: you replaced the expression inside the brackets by its negation. Aug 31 '20 at 7:58
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140244715405, "lm_q1q2_score": 0.846810727808894, "lm_q2_score": 0.8757869948899665, "openwebmath_perplexity": 279.7006799476647, "openwebmath_score": 0.927057683467865, "tags": null, "url": "https://math.stackexchange.com/questions/3808575/pulling-universal-quantifier-out-of-parenthesis-makes-nonequivalent-statement" }
# How many idempotent elements does the ring ${\bf Z}_n$ contain? Let $R$ be a ring. An element $x$ in $R$ is said to be idempotent if $x^2=x$. For a specific $n\in{\bf Z}_+$ which is not very large, say, $n=20$, one can calculate one by one to find that there are four idempotent elements: $x=0,1,5,16$. So here is my question: Is there a general result which tells the number of the idempotent elements of ${\bf Z}_n$? If $n=p_1^{m_1}\cdots p_k^{m_k}$ is the factorization of $n$ as a product of powers of distinct primes, then the ring $\mathbb Z/n\mathbb Z$ is isomorphic to the product $\mathbb Z/p_1^{m_1}\mathbb Z\times\cdots\times \mathbb Z/p_k^{m_k}\mathbb Z$. It is easy to reduce the problem of counting idempotent elements in this direct product to counting them in each factor. Can you do that?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676436891864, "lm_q1q2_score": 0.8009512671648503, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 107.09328165200401, "openwebmath_score": 0.9448435306549072, "tags": null, "url": "https://math.stackexchange.com/questions/45747/how-many-idempotent-elements-does-the-ring-bf-z-n-contain?noredirect=1" }
navigation, ros-melodic, base-global-planner, move-base, baseglobalplanner Originally posted by ParkerRobert with karma: 113 on 2021-06-27 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 36583, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "navigation, ros-melodic, base-global-planner, move-base, baseglobalplanner", "url": null }