text
stringlengths
49
10.4k
source
dict
$$A=S_1\times...\times S_r$$ Clearly (it should be checked, the $p$-Sylows are characteristic) this leads to : $$Aut(A)=Aut(S_1)\times ...\times Aut(S_r)$$ Hence, it suffices to check the property for abelian $p$-groups. Now assume $A$ is an abelian $p$-group and that $A$ is non-cyclic then we have that : $$A=\frac{\mathbb{Z}}{p^{a_1}}\times...\times \frac{\mathbb{Z}}{p^{a_r}}$$ and $r\geq 2$. Now define : $$B_1=\frac{\mathbb{Z}}{p^{a_1}}\times...\times \frac{\mathbb{Z}}{p^{a_{r-2}}}$$ $$B_2=\frac{\mathbb{Z}}{p^{a_{r-1}}}\times \frac{\mathbb{Z}}{p^{a_r}}$$ We have that $Aut(A)$ contains $Aut(B_1)\times Aut(B_2)$. I will show that $Aut(B_2)$ is non commutative. Define $e_1$ and $e_2$ to be respectively the element $(1,0)$ and $(0,1)$ of respective orders $p^{a_{r-1}}$ and $p^{a_r}$. Now you have two automorphisms : $$\phi_1\text{ defined by }\phi_1(e_1):=e_1\text{ and } \phi_1(e_2):=e_1+e_2$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692366242304, "lm_q1q2_score": 0.8138825024278046, "lm_q2_score": 0.8333246015211009, "openwebmath_perplexity": 294.25395373731214, "openwebmath_score": 0.9098387360572815, "tags": null, "url": "https://math.stackexchange.com/questions/1346974/whats-a-group-whose-group-of-automorphisms-is-non-abelian/1346989" }
$\require{cancel}$ HINT Look at the first few terms: $$\frac14\cancel{-\frac18}+\frac16\cancel{-\frac1{10}}\cancel{+\frac18}-\frac1{12}+\cancel{\frac1{10}}-\cdots$$ Do you notice anything particular? One approach you could use is to manually check which terms cancel out. Notice that: $$\sum^{n}_{k=2} \dfrac{1}{k} = \dfrac{1}{2} + \dfrac{1}{3} + \left[\dfrac{1}{5} + ... + \dfrac{1}{n}\right]$$ And, $$\sum^{n}_{k=2} \dfrac{1}{k+2} = \left[\dfrac{1}{5} + \dfrac{1}{6} + \dfrac{1}{7} + ... + \dfrac{1}{n}\right] + \dfrac{1}{n+1} + \dfrac{1}{n+2}$$ The terms in the square brackets get cancelled out on subtraction. Hint : $1/2(\sum_{k=2}^{n}\dfrac{1}{k} -\sum_{k=2}^{n}\dfrac{1}{k+2} ):$. $(1/2)\sum_{k=2}^{n}\dfrac{1}{k}=$ $(1/2)(\dfrac{1}{2} + \dfrac{1}{3} +.......\dfrac{1}{n})$ ; $(1/2)\sum_{k=2}^{n}\dfrac{1}{k+2}=$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9867771794142751, "lm_q1q2_score": 0.826544268839009, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 1630.6036333894406, "openwebmath_score": 0.5247853398323059, "tags": null, "url": "https://math.stackexchange.com/questions/2644242/evaluate-a-sum-which-almost-looks-telescoping-but-not-quite-sum-k-2n-frac" }
ros, logging Title: ros log: named and stderr I'm trying to better understand the ROS console and logging. I have two issues -- named logs and stderr logs -- that might have a related root cause. OS: Ubuntu 14.04.4 ROS release: indigo Named Logs I would like to use a named stream but I never see the named log file in ~/.ros/log as I would expect. Instead I see nodename-2-stdout.log. The documentation for NAMED logs is here but I'm not sure if I'm missing something or it has changed. I still see the INFO and DEBUG prints in nodename-2-stdout.log from ROS_DEBUG_STREAM_NAMED or ROS_INFO_STREAM_NAMED but no mention anywhere of the name I used. Are these NAMED, INFO and DEBUG prints supposed to end up in a named log file in ~/.ros/log? STDERR The Logging Output Documentation describes stderr and stdout to the log file according to the table and text. I only see a node log file appended with stdout.log. stderr (e.g. ERROR) seems to be printed to my rosout.log. Should I have a nodename.log containing stderr and stdout or is my setup somehow configured to only output the node log with stdout output?
{ "domain": "robotics.stackexchange", "id": 26630, "lm_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, logging", "url": null }
Now, to find $x_1,x_2,x_3,$ we can write: $AX=B \implies LUX = B$ let $UX=Y,$ So, $LY=B$ we can write $LY=B$ in matrix notation as: $\begin{bmatrix} 1 &0 &0 \\ 1 &1 &0 \\ 2 &\frac{-1}{2} &1 \end{bmatrix}$$\begin{bmatrix} y_1\\y_2 \\ y_3 \end{bmatrix} = \begin{bmatrix} 4\\7 \\ 7 \end{bmatrix}$ So, $y_1=4,y_1+y_2=7 \implies y_2=3, 8 – \frac{3}{2} + y_3 = 7 \implies y_3=\frac{1}{2}$ So, $y_1=4, y_2=3,y_3=\frac{1}{2}$ Now, on solving $UX=Y$ i.e. $\begin{bmatrix} 1 &1 &-2 \\ 0 &2 &1 \\ 0 &0 &\frac{-1}{2} \end{bmatrix} \begin{bmatrix} x_1\\x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 4\\3 \\ \frac{1}{2} \end{bmatrix}$ It means $\frac{-x_3}{2}=\frac{1}{2} \implies x_3=-1, 2x_2-1=3 \implies x_2 =2, x_1+x_2-2x_3 = 4 \implies x_1+2+2=4\implies x_1=0$ Hence, $x_1=0,x_2=2,x_3=-1$ Check this online website to calculate LU decomposition.
{ "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" }
java, game, community-challenge, rock-paper-scissors Your RPSLS class only contains one big main method. And I still think that it does too much. RPSLS could instead be the game class, and the main method splitted into a couple of methods within the class. Overall, I'd say your code looks great. Well done. Good use of interfaces. Good use of different classes and methods. It's been a pleasure reading your code. A great improvement compared to the previous version.
{ "domain": "codereview.stackexchange", "id": 5203, "lm_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, game, community-challenge, rock-paper-scissors", "url": null }
java std.bat is an unfortunate name for a serialised object, because .bat is usually associated with Batch script files. I don't know what the standard is for this, but I imagine something like .object, .jo (for Java object) or .Student would work. The code only ever reads and writes a single student to the same file. A production application would support many students, and would use a more portable system like a database to persist information. Naming things according to what they contain or do rather than what they are is very useful for comprehension. For example, myfine (sic) could be something like studentFile and sc could be inputScanner. Short variable names are a thing of the past, before code completion became ubiquitous. It would be difficult to automate command line interaction with your system since it is interactive. I would instead make it accept parameters to decide what to do and which information to do it with, like almost every shell tool (find, grep, wc, etc.). Interactivity can then be tacked on if at all necessary. 800 is a "magic" amount of money in two places in your code. It should ideally be configurable since it clearly would change over time in the real world. Being able to pass an existing student ID would be extremely useful if this code is to be used with an existing system. Four random characters chosen from 31 does make for a lot of possible IDs, but why not just use a serial number and persisting that information? Using abcdefghijklmnopqrstuvwxyz12345 as the possible characters for an ID is a bit strange. Why not six through nine or zero? Why not upper case characters? Why not the entire base 64 range, all printable characters or even all of Unicode? I can't tell at a glance whether (int) (Math.random() * pick.length()) manages to land on each index uniformly. These solutions are more obviously intuitively correct. Having a getter and setter for each field is considered an antipattern by many developers. I don't have an authoritative reference, but I would encourage reading up on the arguments given.
{ "domain": "codereview.stackexchange", "id": 30736, "lm_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 }
reproduction, asexual-reproduction Title: can self-fertilization in flowers be called asexual reproduction? Suppose a flower having both male and female reproductive parts is self-fertilized then can this be called asexual reproduction...?I'm quite confused cause in this case the fusion of male and female gametes do take place but again the gametes are from the same parent....please help. According to this article from Berkeley, asexual reproduction is: Any reproductive process that does not involve meiosis or syngamy Using this definition of asexual reproduction and knowing self-fertilization involves meiosis and syngamy, it is not asexual.
{ "domain": "biology.stackexchange", "id": 8965, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reproduction, asexual-reproduction", "url": null }
c#, beginner, ascii-art public int height;: is this supposed to be a field or a property? If it is a field it should be private, if it's a property it should be PascalCase and should have a getter/setter. public int biggestOddNumber(): does this method need to be public? Does this even need to be a method? I'd be inclined to make it a property: public int BiggestOddNumber { get { // 1 2 3 4 5 6 7 8 9 10 // ? ? ? ? // //Formula for Odd Numbers = 2n + 1 //2*0 + 1 = 1 //2*1 + 1 = 3 //2*2 + 1 = 5 //... // we do height -1 since if you look at formula we start from 0 not 1 // if we do 2*4 + 1 = (9) //4 // * = 1 // *** = 3 - (+2) // ***** = 5 - (+2) //******* = 7 - (+2) However it should be (7) return (2 * (height-1) + 1); } } If you want to keep it a method, you'll need to change its name since a method name should contain a verb. More worrying to me is that you repeatedly call this, so it is repeatedly calculated, but this is pointless since height won't ever change. Right now if height is 10, biggestOddNumber() gets called over thirty times! If you don't need to expose this biggestOddNumber it could simply be a private field which you set in the constructor public Triangle(int height). Even if you need to expose it, I'd still advice you to set a private field in the constructor and have a get-only property to expose it. Don't use "\r\n", use Environment.NewLine. You seem confident your users won't enter an invalid value, e.g. "-" or "boo". Don't trust input, always check! Console.WriteLine("Enter height of pyramid"); int height = int.Parse(Console.ReadLine());
{ "domain": "codereview.stackexchange", "id": 18942, "lm_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, ascii-art", "url": null }
50 + x + 17 y == 0 And Simplify @ Rationalize[y - Fit[{pA, pB}, {x, 1}, x] == 0] 50 + x + 17 y == 0 You may do as follows. Let us look for the equation in the form ax+by==1, where the parameters a and b are to be found.This will substitute the coordinates of the points pA and pB into this equations, thus, forming two equations with respect to a and b and solves the system: eq = a*#[[1]] + b*#[[2]] == 1 &; eq1=eq /@ {{1, -3}, {-33, -1}} (* {a - 3 b == 1, -33 a - b == 1} *) This will substitute the solution into the linear equation already in coordinates x and y: eq[{x, y}] /. sol (* -(x/50) - (17 y)/50 == 1 *) This will plot the solution: Show[{ ContourPlot[-(x/50) - (17 y)/50 == 1, {x, -34, 2}, {y, -4, 0}], Graphics[{Red, PointSize[0.015], Point[#] & /@ {{1, -3}, {-33, -1}}}] }] yielding the following plot: The original points are shown in red. This is one of several possible ways. Have fun! The equation of a planar line going through two points $$P_1(x_1,y_1)$$ and $$P_2(x_2,y_2)$$ (e.g. cf this for reference) is $$\begin{vmatrix} x & y\\ x_2-x_1 & y_2-y_1 \end{vmatrix} = \begin{vmatrix} x_1 & y_1\\ x_2 & y_2 \end{vmatrix}.$$ So there is the piece of codes below:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9343951588871156, "lm_q1q2_score": 0.8151171668681901, "lm_q2_score": 0.8723473779969194, "openwebmath_perplexity": 2283.223994093817, "openwebmath_score": 0.3514730930328369, "tags": null, "url": "https://mathematica.stackexchange.com/questions/186285/another-way-to-write-equation-of-the-line-passing-through-two-points/186306" }
cell-biology Title: Are ribosomes assembled in rough ER and Golgi body, or in the nucleolus? I mean all the components, such as ribosomal RNA (rRNA) are synthesized in the nucleolus, but is the whole ribosome structure assembled in the nucleolus or is it also done in the rough endoplasmic reticulum and Golgi apparatus? Ribosome assembly starts in the nucleolus (of eukaryotes) and finishes in the cytoplasm. However, in the cytoplasm the Golgi apparatus is certainly not involved, and, as some cells have little rough endoplasmic reticulum, assembly does not require that. Thus, the abstract of a review by Fromont-Racine et al. in Gene (2003) vol 313 pp. 17–42 starts with the statement: Ribosome synthesis is a highly complex and coordinated process that occurs not only in the nucleolus but also in the nucleoplasm and the cytoplasm of eukaryotic cells. In the 26 pages of this review there is not a single mention of the words ‘endoplasmic reticulum’ or ‘Golgi’. A more recent (and freely available) review by Thomson et al. in Journal of Cell Science (2013) vol 126 pp. 4815-4820 is in accord with this. It has a pretty poster insert which presents the assembly as a succession of events, starting in the nucleolus, proceeding to the nucleoplasm, and with some final polishing in the cytoplasm.
{ "domain": "biology.stackexchange", "id": 5520, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cell-biology", "url": null }
c, linked-list // Get the last node in the list // LIST_NODE_H list_back(const LIST_NODE_H node); // Get the data from a list node // void *list_data(LIST_NODE_H node); // Find a the first node in the list that matched the provided "what" value using the supplied comparator // Search Order: // - The supplied node // - Forwards from the supplied node // - Backwards from the supplied node // typedef bool (*list_comparator_t)(void *what, const void *value); LIST_NODE_H list_find(const LIST_NODE_H node, const void *what, list_comparator_t comparator); // Iterate forwards over a list // WARNING: does not support destructive list operations // #define list_foreach_forward(start, iter) \ for (iter = start; iter; iter = list_next(iter)) // Iterate backwards over a list // WARNING: does not support destructive list operations // #define list_foreach_backward(start, iter) \ for (iter = start; iter; iter = list_prev(iter)) #endif //__LIST_H__ list.c #include "list.h" #include <stddef.h> #include <stdlib.h> struct list_node { LIST_NODE_H next; LIST_NODE_H prev; void *data; }; LIST_NODE_H list_node_create(void *data) { LIST_NODE_H node = malloc(sizeof(struct list_node)); if (node) { node->next = NULL; node->prev = NULL; node->data = data; } return node; } void *list_node_destroy(LIST_NODE_H node) { if (node) { void *data = node->data; node->next = NULL; node->prev = NULL; free(node); return data; } return NULL; }
{ "domain": "codereview.stackexchange", "id": 30938, "lm_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, linked-list", "url": null }
image-processing, computer-vision, local-features, visual-tracking Title: Are location in BRIEF feature descriptor reused? In the BRIEF feature descriptor ("BRIEF: Binary Robust IndependentElementary Features", Calonder et al., 2011) they investigate five different methods of choosing point pairs to compute the binary values of the descriptor vectors: Among these methods there are the methods named GI up to GIV that sample the point pairs randomly, according to various distributions. Are these point pair sampled for every keypoint that we want to compute the descriptor for separately, or are these pairs sampled once and then remain the same for every keypoint? When using a randomized pattern in BRIEF, this means that you computed random positions inside the patch once in an offline procedure, then used these random locations every time you computed the descriptors. This makes sense, as it means that when comparing descriptors you will actually compare the same locations, it's simply that the sampling pattern was not obtained by some regular or geometric scheme (which is probably what makes it a bit more generic than hand-crafted patterns). For example, here is the sampling pattern used by OpenCV.
{ "domain": "dsp.stackexchange", "id": 9280, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, computer-vision, local-features, visual-tracking", "url": null }
− yz + 1, not! Interpolation and the use of splines. [ 1 ] having an 'equal to ' symbol two... 2 +a +1 has a single phrase, a polynomial equation be considered to have no terms at,... The x occurring in a specified matrix ring Mn ( R ) the of! Form \ [ a_ { 1 } = 0\ ] is the highest degree first,! Branch for positive x and one for negative x ) = 0 where g is a function that can computed... 23 ] given an ordinary, scalar-valued polynomial, or solving an equation that has terms! Is to put the highest degree do not have any roots among oldest... [ 23 ] given an ordinary, scalar-valued polynomial, let 's have a look at the elementary math are. A trinomial equation of irreducible polynomials include the laurent polynomials, or simply a polynomial.... For solvable equations of degree higher than one indeterminate is called a polynomial in to. The time, incorrectly for degrees one and two say simply polynomials over the integers and the of! And End Behavior equation are -1 and -5 this page was last edited on January! Equations '' tends to be an expression used rather loosely and much the. Operators and non-negative integers as exponents however, a constant term and constant... Quotient can be computed by any of several terms produces a polynomial linear or! Interpolation and the rational numbers the irreducible factors are linear multiplications and.. Commutative law of addition can be defined by a graph counts the number of colourings. The number of proper colourings of that graph English Noun a specified matrix ring Mn ( R.! An 'equal to ' symbol between two algebraic expressions 1 and itself, also called the coefficient, is. With degree ranging from 1 to 8 algebra in mathematics elegant and notation... Polynomials is the polynomial the commutative law of addition, subtraction and.. Can occur multiple times in a single root, solvable with a stoichio metric concentration of 0.100 mol −1... Any ring ) set to elements of the field of complex numbers, for example, the. Approximate equation by discarding any negligible terms only for degrees one and two yz 1! Degrees 5 and 6 have been published ( see root-finding algorithm
{ "domain": "7cloudtech.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138105645059, "lm_q1q2_score": 0.8147529614725092, "lm_q2_score": 0.8333245911726382, "openwebmath_perplexity": 741.2931142253956, "openwebmath_score": 0.838147759437561, "tags": null, "url": "http://www.7cloudtech.com/1v2x8/01ee4b-polynomial-equation-definition" }
atomic-physics, semiconductor-physics, electronic-band-theory It is fundamental that you understand that electrons, as every other particle with spin 1/2, obey the Pauli exclusion principle, which states that two electrons cannot be in the same quantum state simultaneously. In order to understand things properly you need to study how the wave functions of the electrons are characterized by a variety of quantum number (spin, orbital, principal), but for the following you can just accept that you cannot have all the electrons of an atom in the lowest energetic state. They will occupy all the possible energy states in order, until the last electron has found a "place". The last shell that gets filled is the valence shell. Therefore, as you correctly point out, the electrons in the valence shell are those with the highest energy in the unexcited atom. However, there is no way they can reach a state with lower energy, since all of them are occupied by other electrons. Since these valence electrons are the outermost ones, they are less attracted by the nucleus and therefore are easier to "take away". When you talk about bands you refer to a material, and not about a single atom. However the intuitive picture is somewhat similar: there are electrons which belong to the valence band, which has the highest energy among the bands that are filled. These electrons are the ones that participate the most in the interactions that occur inside the material, since they are not so strictly bounded to the atom. At non-zero temperature some of them might get excited and jump to the conduction band, where they are even more free and contribute significantly to the electrical conductivity. But even if you decrease the temperature to $0$ Kelvin, they will not be able to decrease their energy more than the one they have in the valence band, since the lower energetic bands are already completely filled. In some pictures that you see only the valence and conduction bands are shown, because they are relevant to the physics of a solid. But below the valence bands there are a lot of other bands, that are completely filled by electrons which will hardly be removed from their place. This might be the source of your confusion. A single shell can contain electrons in multiple states. As an example, two electrons with opposite spin but otherwise same quantum numbers belong to the same shell.
{ "domain": "physics.stackexchange", "id": 34622, "lm_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, semiconductor-physics, electronic-band-theory", "url": null }
first in one direction, and then again in the other direction. Imagine scaling the 750 x 750 grid to fit over our 500 x 500 image. In akima: Interpolation of Irregularly and Regularly Spaced Data. ANTIALIAS is best for downsampling, the other filters work better with upsampling (increasing the size). It smooths the output raster grid, but not as much as cubic convolution. You can also use this linear interpolation calculator for extrapolation - for example, you can calculate what amount of flour is required to bake 50 cookies. Could you please provide the math behind so that how implementing it on CPU and GPU will be clearer?. Learn more about image processing, bilinear interpolation, interpolation, text file, bicubic interpolation, 2d array, digital image processing Image Processing Toolbox. Rosenthal Besteck 6 Tafelmesser Sculptura Lino Sabattini Stainless steel (P79),PORTRAIT VON PAPST LUCIUS III. The following matlab project contains the source code and matlab examples used for bilinear interpolation. Using polyfit for polynomial fit. Bilinear interpolation is a process that enhances textures that would normally be larger on-screen than in texture memory, i. Also note this sentence from the help for pcolor: "With shading interp, each cell is colored by bilinear interpolation of the colors at its four vertices, using all elements of C. Setting the interpolation does not carry through to any images created by imageaffine() or imagerotate(). You want to translate this image 0. Bilinear forms and their matrices Joel Kamnitzer March 11, 2011 0. In the last post we saw how to do cubic interpolation on a grid of data. Nearest Neighbor, Bilinear, and Bicubic Interpolation Methods Nearest Neighbor Interpolation. We have a need for a bilinear interpolation algorithm that can interpolate a 2MP (2000x1000) image at an ideal rate of 40-50/s. Gaussian blur is an image space effect that is used to create a softly blurred version of the original image. 25, 0}, respectively. , James Sherman Jr. The function returns a two-dimensional, floating-point interpolated
{ "domain": "labottegamedievale.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9840936073551712, "lm_q1q2_score": 0.8384012987870352, "lm_q2_score": 0.8519527944504227, "openwebmath_perplexity": 859.3927201907605, "openwebmath_score": 0.5450966358184814, "tags": null, "url": "http://xzqd.labottegamedievale.it/bilinear-interpolation-example.html" }
quantum-mechanics, wavefunction, schroedinger-equation, boundary-conditions Title: Particle in a box in the momentum representation I'm self-studying a book about QFT. In one of the initial sections, the following statement appears: Solutions to the Schroedinger equation for a particle in a box of size $L$ are running waves $\psi(x)=\frac 1 {\sqrt L} e^{\frac {ipx} \hbar}$.
{ "domain": "physics.stackexchange", "id": 98763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, schroedinger-equation, boundary-conditions", "url": null }
library, go for v := range elements { if encountered[elements[v]] == true { // Do not add duplicate. } else { // Record this element as an encountered element. encountered[elements[v]] = true // Append to result slice. result = append(result, elements[v]) } } // Return the new slice. return result } func MergeStringSlice(slice1, slice2 []string) (c []string) { c = append(slice1, slice2...) return } func MergeIntSlice(slice1, slice2 []int) (c []int) { c = append(slice1, slice2...) return } func SliceContains(sl []interface{}, v interface{}) bool { for _, vv := range sl { if vv == v { return true } } return false other package other import ( "fmt" c "github.com/skilstak/go/colors" "os" "reflect" ) func PrintType(item interface{}) { Objecttype := reflect.TypeOf(item) fmt.Println(Objecttype) } //credit goes to @whitman func Spacer(timesToRepeat int) { //draws that many blank lines repeat := 0 for repeat < timesToRepeat { fmt.Println() repeat++ } } func Exit(message string) { //prints a message and takes in whether you want to clear the screen fmt.Println(c.B1 + message + c.X) os.Exit(-1) }
{ "domain": "codereview.stackexchange", "id": 19174, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "library, go", "url": null }
pcl, rosmake, pcl-ros Title: error during pcl_ros Hi , I downloaded pcl and perception_pcl from pointclouds.org and did rosdep without any errors.. when I rosmake pcl_ros, its resulting the errors below. mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=rospack find rosbuild/rostoolchain.cmake .. [rosbuild] Building package pcl_ros [rosbuild] Cached build flags older than manifests; calling rospack to get flags Failed to invoke /opt/ros/fuerte/bin/rospack cflags-only-I;--deps-only pcl_ros CMake Error at /usr/lib/vtk-5.8/VTKTargets.cmake:16 (ADD_EXECUTABLE): Command add_executable() is not scriptable Call Stack (most recent call first): /usr/lib/vtk-5.8/VTKConfig.cmake:231 (INCLUDE) /usr/share/cmake-2.8/Modules/FindVTK.cmake:73 (FIND_PACKAGE) /home/sai/fuerte_workspace/pcl17/pcl/vtk_include.cmake:1 (find_package) CMake Error at /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:129 (message): Failed to invoke rospack to get compile flags for package 'pcl_ros'. Look above for errors from rospack itself. Aborting. Please fix the broken dependency! Call Stack (most recent call first): /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:227 (rosbuild_invoke_rospack) CMakeLists.txt:4 (rosbuild_init) -- Configuring incomplete, errors occurred! Thanks
{ "domain": "robotics.stackexchange", "id": 12947, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pcl, rosmake, pcl-ros", "url": null }
computability, turing-machines, undecidability, rice-theorem For every machine in $L$ you can easily construct many machines that accept the same language but run for more than $\langle M \rangle$ steps, and thus are not in $L$. Thus, $L$ is not an index set. $L$ is decidable, using the same argument as for the original language we're discussing.
{ "domain": "cs.stackexchange", "id": 10294, "lm_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, turing-machines, undecidability, rice-theorem", "url": null }
= r = Round to decimal places. Calculate the area of a regular pentagon that has a radius equal to 8 feet. When just the radius of the regular pentagon is given, we make use of the following formula. Calculate the area of the pentagon. WHAT IS THE AREA OF THE STAR. The area of this pentagon can be found by applying the area of a triangle formula: Note: the area shown above is only the a measurement from one of the five total interior triangles. Substitute the values in the formula and calculate the area of the pentagon. I just thought I would share with you a clever technique I once used to find the area of general polygons. Within the last section, Steps for Calculating the Area of a Regular Polygon, step-by-step instructions were provided for calculating the area of a regular polygon.For the purpose of demonstrating how those steps are used, an example will be shown below. Let's Summarize. area = (½) Several other area formulas are also available. Area of Irregular Polygons Introduction. Area of a square. Area of a trapezoid. Below given an Area of a Pentagon Calculator that helps you in calculating the area of a five-sided pentagon. For regular pentagon. Here are a few activities for you to practice. The adjacent edges form an angle of 108°. Area = (5/2) × Side Length ×Apothem square units. Area=$\frac{\square^2}{4}\sqrt{5(5+2\sqrt{5_{\blacksquare}})}$ Or Formulas. We're gonna have five times s squared companies. P – perimeter; A – area; R – radius K; r – radius k; O – centre; a – edges; K – circumscribed circle; k – inscribed circle; Calculator Enter 1 value. Solution: Step 1: Identify and write down the side measurement of the pentagon. This is an interesting geometry problem. To solve the problem, we will use the direct formula given in geometry to find the area of a regular pentagon. The idea here is to divide the entire polygon into triangles. The area of a regular polygon formula now becomes $$\dfrac{n \times (2s) \times a}{2} = n \times s \times a$$. Regular: Irregular: The Example
{ "domain": "3dmediaworks.net", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9820137868795702, "lm_q1q2_score": 0.8549385121540238, "lm_q2_score": 0.8705972600147106, "openwebmath_perplexity": 384.8334827766857, "openwebmath_score": 0.7083063721656799, "tags": null, "url": "http://3dmediaworks.net/itzep/2372ea-area-of-pentagon-formula" }
So near to x=1, say like the root we seek at x=1+\epsilon, the slope of a line approximating this function should be about -10...thus when y=0 at x=1+\epsilon a line approximating the curve should be: y-y_0=m(x-x_0)...0-4=-10(\epsilon)...so \epsilon=4/10=2/5...and the root should be close by to x=1.4. Now evaluate f(1.4)= -9*1.4^2+8*1.4+5 = -9*1.96+11.2+5=-17.64+16.2 = -1.44... So we overshot by a little, our \epsilon was too large, it made our y value decrease from 4 to something past 0, a negative number...thus the true \epsilon should of been smaller. We have a choice now, with given possible values above we can quickly see which choice has an x greater than 1 and less than 1.4 {1.31,-.42}. Of course evaluating all the choices initially works too...but this allows us to apply calculus to get an approximation, in case no choices were available and a linear approximation would be acceptable. We can use this new point (x_1,y_1)=(1.4,-1.44)=(7/5,-36/25) to find a better approximation. Use x=7/5-\delta, for some small \delta between 0 and 1, and repeat the procedure: y-y_1=m(x-x_1), where we now let m be the deviated at x_1=7/5... Thus 0-(-36/25)=f'(7/5)*(-\delta)...and \delta=18/215...so x=1+\epsilon-\delta=1+2/5-18/215=(215+86-18)/215=283/215...doing long divison to a few decimal places yields 1.316.
{ "domain": "wyzant.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9873750507184356, "lm_q1q2_score": 0.8049402271698535, "lm_q2_score": 0.8152324960856175, "openwebmath_perplexity": 932.6984727935755, "openwebmath_score": 0.8802751302719116, "tags": null, "url": "https://www.wyzant.com/resources/blogs/357281/taylor_expansion_and_approximating_roots_of_polynomials_over_the_rational_field" }
How do we find the arc length parameter? Start with any parametrization of $\vec r\text{.}$ We can compute the arc length of the graph of $\vec r$ on the interval $[0,t]$ with \begin{equation*} \text{ arc length } = \int_0^t\norm{\vec r\,'(u)}\ du. \end{equation*} We can turn this into a function: as $t$ varies, we find the arc length $s$ from $0$ to $t\text{.}$ This function is $$s(t) = \int_0^t \norm{\vec r\,'(u)}\ du. \label{eq_vvfarc}\tag{11.5.1}$$ This establishes a relationship between $s$ and $t\text{.}$ Knowing this relationship explicitly, we can rewrite $\vec r(t)$ as a function of $s\text{:}$ $\vec r(s)\text{.}$ We demonstrate this in an example. ##### Example11.5.4Finding the arc length parameter Let $\vec r(t) = \la 3t-1,4t+2\ra\text{.}$ Parametrize $\vec r$ with the arc length parameter $s\text{.}$ Solution Things worked out very nicely in Example 11.5.4; we were able to establish directly that $s=5t\text{.}$ Usually, the arc length parameter is much more difficult to describe in terms of $t\text{,}$ a result of integrating a square–root. There are a number of things that we can learn about the arc length parameter from Equation (11.5.1), though, that are incredibly useful.
{ "domain": "pcc.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.988312744413962, "lm_q1q2_score": 0.8010066345175992, "lm_q2_score": 0.8104789086703225, "openwebmath_perplexity": 290.0973945509804, "openwebmath_score": 0.8749964833259583, "tags": null, "url": "http://spot.pcc.edu/math/APEXCalculus/sec_curvature.html" }
sliplines especially, over several computational cells, while the accuracy in the smooth flow region. EXPONENT RULES & PRACTICE 1. Plus and Minus. products have become integral towards securing the parameters of political and religious belonging. Novices will get introduced to the game and can learn the Setup, Swing and Game Management. Math 104: Calculus has been evaluated and recommended for up to 6 semester hours and may be transferred to over 2,000 colleges and universities. This is a full-length test with a complete set of multiple choice and free response questions. SHWS C11: TRIPLE INTEGRATION 29 Self-Help Work Sheets C11: Triple Integration These problems are intended to give you more practice on some of the skills the chapter on Triple Integration has sought to develop. Integration: The Basic Logarithmic Form. College Board is a mission-driven organization representing over 6,000 of the world’s leading colleges, schools, and other educational organizations. The derivative is the function slope or slope of the tangent line at point x. Furthermore, a substitution which at first sight might seem sensible, can lead nowhere. The development of the definition of the definite integral begins with a function f( x), which is continuous on a closed interval [ a, b]. Find more online open access dissertations / theses in this subject. Users can also view their OneDrive files directly in Canvas. It's calculus done the old-fashioned way - one problem at a time, one easy-to-follow step at a time, with problems ranging in difficulty from easy to challenging. Evaluate the integral. The app includes the same information and practice questions found in the CLEP Official Study Guide and subject-specific Examination Guide but offers the convenience of answering sample questions on your mobile device. Global leader with over 45 years of experience in IT Consulting, Managed Services, IT Application Development and IT Outsourcing. References to complexity and mode refer to the overall difficulty of the problems as they appear in the main program. Unit 6: Integration and Accumulation of Change You’ll learn to apply limits to define definite integrals and how the Fundamental Theorem connects integration and differentiation. Another way of stating this is that the antiderivative is a nonunique inverse of the derivative. Calibrating the model, welfare gains from financial integration are equivalent to a 9% increase in consumption for the median country, and 14% for the most capital-scarce. An Issue occurred. Free Pre-Algebra, Algebra,
{ "domain": "quellidellalambra.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211612253741, "lm_q1q2_score": 0.8102158269803681, "lm_q2_score": 0.8311430436757312, "openwebmath_perplexity": 1585.5757865630837, "openwebmath_score": 0.5003786683082581, "tags": null, "url": "http://vcfk.quellidellalambra.it/antiderivative-practice-khan.html" }
More generally for distribution $X\sim N(\mu,\Sigma)$ it holds $AX+b\sim N(A\mu+b,B\Sigma B^T)$, see Wikipedia. - If you can sample from the $2$-dimensional normal distribution whose variance is $\begin{bmatrix} 1 & \rho \\ \rho & 1\end{bmatrix}$, you can then rescale the $x$-coordinate and the $y$-coordinate to get the standard deviations you want, and that won't alter the correlation $\rho$. If $A$ is a square root of the given correlation matrix and $\begin{bmatrix} Z_1 \\ Z_1 \end{bmatrix}$ has a $2$-dimensional normal distribution whose variance is the $2\times 2$ identity matrix, then $A\begin{bmatrix} Z_1 \\ Z_1 \end{bmatrix}$ has a $2$-dimensional normal distribution whose variance is $\begin{bmatrix} 1 & \rho \\ \rho & 1\end{bmatrix}$. So the remaining problem is finding a square root of $\begin{bmatrix} 1 & \rho \\ \rho & 1\end{bmatrix}$. Let $P=\begin{bmatrix} 1/2 & 1/2 \\ 1/2 & 1/2\end{bmatrix}$ and $Q=I-P$. Then $P^2=P$, $Q^2=Q$, and $PQ=QP=0$. Then we have $$\begin{bmatrix} 1 & \rho \\ \rho & 1\end{bmatrix} = (1+\rho)P + (1-\rho)Q.$$ Since $P^2=P$, $Q^2=Q$, and $PQ=QP=0$, we can find a square root just by taking square roots of the coefficients: $$\sqrt{1+\rho}\,P + \sqrt{1-\rho}\,Q.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9861513922264661, "lm_q1q2_score": 0.8152629824824972, "lm_q2_score": 0.8267117898012104, "openwebmath_perplexity": 79.76624438144066, "openwebmath_score": 0.963485836982727, "tags": null, "url": "http://math.stackexchange.com/questions/268298/sampling-from-a-2d-normal-with-a-given-covariance-matrix/268301" }
astronomy, history, solar-system Title: Mass and distance of the bodies of the solar system? This might be a bit of a historical question in nature. Obviously given that we know the constant G, the mass of the sun, and the distance between a solar body and the sun we can calculate it's mass. Ditto if one of the other variables are missing. What I don't understand however is how we managed to find the initial variables that we used to calculate all other variables? E.g. how did we find the distance between the Earth and sun and the sun's mass? Sorry if the question is more historical than physical, but I couldn't find a place that describes how we arrived at our current knowledge. $G$ was historically calculated from the Cavendish experiment, involving balls and a torsion balance. The earth's mass was actually calculated before the sun's mass. Using the assumption that the earth was a sphere, its circumference and thus its radius could be determined through geodesy, as was done historically even before Newton. The acceleration of an object, and thus the average force exerted on the object, is easy to compute and was done so by Galileo and others. With these facts, the earth's mass could be calculated. We can use Kepler's laws and geometry to determine the earth-sun distance, or parallax. Since we obviously know the period, from this, we can easily determine the sun's mass. Finally, as for determing the distances to other space bodies, for planets we use Kepler's laws and geometry or parallax and for other bodies in modern times we use more sophisticated apparatus.
{ "domain": "physics.stackexchange", "id": 22071, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astronomy, history, solar-system", "url": null }
# Math Help - Inequality Application 1. ## Inequality Application A charter airline finds that on its Saturday flights from Philadelphia to London, all 120 seats will be sold if the ticket price is $200. However, for each$3 increase in ticket price, the number of seats sold decreases by one. a) Find a formula for the number of seats sold if the ticket price is P dollars. The answer for a is $-\frac{1}{3}P + \frac{560}{3}$. However, I do not see how they arrived at that answer. Any help will be greatly appreciated. 2. Originally Posted by mathgeek777 The answer for a is $-\frac{1}{3}P + \frac{560}{3}$. However, I do not see how they arrived at that answer. Any help will be greatly appreciated. do you realize that we have a linear relationship between the number of seats filled and the ticket price? since each changes at a constant rate with respect to each other. lets think of this graphically so that you get the idea. we want a function of price, so put that on the x-axis. the number of seats on the y-axis. now, plot a few points: $\begin{array}{c|c} S & P \\ \hline 120 & 200 \\ 119 & 203 \\ 118 & 206 \\ . & . \\ . & . \\ . & . \end{array}$ S is the number of seats, P is the price. S goes down by 1 when P goes up by 3 all we need to do is find the straight line that passes through these points. can you do that? 3. Ok. I see where the $-\frac{1}{3}$ came from, but i still don't know how you get $\frac{560}{3)$ 4. Originally Posted by mathgeek777 Ok. I see where the $-\frac{1}{3}$ came from, but i still don't know how you get $\frac{560}{3}$ the equation of a line in the slope-intercept form is $y = mx + b$, where $m$ is the slope and $b$, is the y-intercept.
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682468025242, "lm_q1q2_score": 0.8012947684942827, "lm_q2_score": 0.8104789155369048, "openwebmath_perplexity": 367.96348155989284, "openwebmath_score": 0.7770495414733887, "tags": null, "url": "http://mathhelpforum.com/algebra/46521-inequality-application.html" }
special-relativity, time, reference-frames, relativity $$\mathrm ds^2 = -c^2\mathrm d\tau^2 = -c^2\mathrm dt^2 + \mathrm dx^2 \tag{1} $$ To calculate the length of the red curve we use the cunning trick of noting that velocity is defined by $v = \mathrm dx/\mathrm dt$ so $\mathrm dx = v\,\mathrm dt$, and if we take equation (1) and substitute for $\mathrm dx$ we end up with: $$ \mathrm d\tau = \sqrt{1 - \frac{v^2(t)}{c^2}}\,\mathrm dt $$ So the elapsed time $\tau_{AB}$ is given by the integral: $$ \tau_{AB} = \int_{t_A}^{t_B} \, \sqrt{1 - \frac{v^2(t)}{c^2}} \,\mathrm dt \tag{2} $$ where $v(t)$ is your velocity as a function of time. The exact form of $v(t)$ will depend on how you choose to accelerate, but since $v^2$ is always positive that means the term inside the square root is always less than or equal to one: $$ 1 - \frac{v^2(t)}{c^2} \le 1 $$ And therefore the integral from $t_A$ to $t_B$ must be less than or equal to $t_B-t_A$. This means your elapsed time $\tau_{AB}$ must be less than my elapsed time $t_{AB}$ i.e. when we meet again you have aged less than I have. So far so good, but the paradox is that we could draw the spacetime diagram in figure 1 using your coordinates, i.e. the coordinates in which you are at rest, to give something like:
{ "domain": "physics.stackexchange", "id": 89835, "lm_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, time, reference-frames, relativity", "url": null }
We are assuming $$A\vect{x}=B\vect{x}$$ for all $$\vect{x}\in\complex{n}\text{,}$$ so we can employ this equality for any choice of the vector $$\vect{x}\text{.}$$ However, we will limit our use of this equality to the standard unit vectors, $$\vect{e}_j\text{,}$$ $$1\leq j\leq n$$ (Definition SUV). For all $$1\leq j\leq n\text{,}$$ $$1\leq i\leq m\text{,}$$
{ "domain": "runestone.academy", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682441314384, "lm_q1q2_score": 0.80129475275188, "lm_q2_score": 0.8104789018037399, "openwebmath_perplexity": 552.7782355881624, "openwebmath_score": 0.9809508919715881, "tags": null, "url": "https://runestone.academy/ns/books/published/fcla/section-MM.html" }
general-relativity, differential-geometry Title: What is the meaning of non-coordinate basis? I mean how the co-frame field $e^I(x)$ differs from the coordinate vector basis for co-vector $dx^\mu$. How to interpret them? Does it means for coordinate vector we can find the integral curves? Integral curves of non-coordinate (anholonomic) basis vectors also exist, they just don't form a coordinate system. This might be a bit difficult to swallow, but the heart of the issue in a coordinate system, the coordinates are independent. Here's a direct example: Consider polar coordinates in $\mathbb{R}^2$. These are given by $$ x=r\cos\varphi \\ y=r\sin\varphi. $$ The coordinate basis vectors are $$ \partial_r=\cos\varphi\partial_x+\sin\varphi\partial_y \\ \partial_\varphi=-r\sin\varphi\partial_x+r\cos\varphi\partial_y. $$ These are orthogonal, but not orthonormal. We can also norm these vectors and get $$ \hat{e}_r=\partial_r=\cos\varphi\partial_x+\sin\varphi\partial_y \\ \hat{e}_\varphi=\frac{1}{r}\partial_\varphi=-\sin\varphi\partial_x+\cos\varphi\partial_y. $$ The first set is holonomic, the second isn't, you can calculate $ [\hat{e}_r,\hat{e}_\varphi]$ to ascertain this. To try to interpret what it means for the integral curves of the anholonomic set not forming coordinates, consider that for the holonomic polar coordinate vectors, the $\partial_\varphi$ vector is longer, the further you are away from the origin. This is expected, $\varphi$ is an angular coordinate, the same angular displacement corresponds to larger and larger actual displacements the further you are away from the origin.
{ "domain": "physics.stackexchange", "id": 38102, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "general-relativity, differential-geometry", "url": null }
graph-algorithms, shortest-path Title: What's wrong with my linear programming formulation of longest path? I have a directed graph which has cycles. Each edge has a positive weight. Now given two vertices $u$ and $v$, I want to find the longest simple path from $u$ to $v$. Simple means the path has no repetition in vertices. I understand this problem is NP-hard in general. But I am wondering what's wrong in my following linear programming formulation. Let us add a source vertex $s$, which is connected to $u$ by an edge with capacity $1$. Let v be connected to a sink vertex $t$ with capacity 1 too. Denote the new edge set as $E$. Use $w_{ij} = 1$ to represent that the edge $(i,j)$ is in the path, and $w_{ij} = 0$ if not. So $w_{ij} \in \{0,1\}$. Then a simple path from $s$ to $t$ needs to satisfy Conservation constraints: for all vertices $i$ (except $s$ and $t$), $\sum_{k: (k, i) \in E} w_{ki} = \sum_{j: (i,j) \in E} w_{ij}$. Let us call this common quantity as $w_i$. No repetition of vertex: add a vertex capacity 1 on each vertex: $w_i \in \{0,1\}$.
{ "domain": "cstheory.stackexchange", "id": 2306, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "graph-algorithms, shortest-path", "url": null }
evolution Title: What was there before the Paleolithic and where really did life start for us humans, not like homo? I am asking myself something very interesting for me (I am not expert in this topic). I read many websites about human history and every website says that there are some periods in the human history. For example: periods Paleolithic Mesolithic Neolithic Bronze Age Iron Age etc.
{ "domain": "earthscience.stackexchange", "id": 1951, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution", "url": null }
homework-and-exercises, electric-circuits, electric-current, harmonic-oscillator Title: What is the similarity between the LCR circuit and a forced damped oscillation? In my physics class, my teacher told me this equation $$L\frac{d^2q}{dt^2} + R\frac{dq}{dt} + \frac{q}{C} = \nu \sin \omega t$$ where $L$ is the self inductance and $\omega$ is the driving frequency. It represents an LCR circuit applied to an AC voltage. It is extremely similar to the equation of forced damped oscillations $$m\frac{d^2 x}{dt^2} + b\frac{dx}{dt} + kx = F \cos \omega t$$ where $b$ is the damping constant and $\omega$ is the driving frequency of oscillations. Is there a similarity between these two physical phenomenon? Charge oscillates between inductor and capacitor which is known as LC oscillation and where the resistance do the damping work here by dissipating it . Same as a damped oscillation in SHM it's the damped charge oscillation of LCR circuit. Here is a rough graph
{ "domain": "physics.stackexchange", "id": 82597, "lm_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, electric-circuits, electric-current, harmonic-oscillator", "url": null }
sampling, variance, bias, bootstraping Title: Understanding bootstrapping in bias variance decomposition I was going through bias and variance tradeoff article and it makes use of bias_variance_decomp function from mlxtend library. This method takes a parameter called num_rounds which is described in API docs as follows: num_rounds : int (default=200) Number of bootstrap rounds (sampling from the training set) for performing the bias-variance decomposition. Each bootstrap sample has the same size as the original training set. I was guessing what exactly is it? Given a training set, how many times to run the model on it by sampling the training set? My understanding was, given a training set of say 1 million data points, it will randomly sample "some of" these data points 200 times and train/test model on them. Q1. Am I correct with it? Q2. Also what is the value of "some of" - I mean how it is determined how much data poitns to sample? The doc says "Each bootstrap sample has the same size as the original training set." Does it mean simply select all of 1 million data points? If yes then how is it even sampling (I feel sampling is randomly selecting some data points)? Also this will give same training set each time. I am sure am missing some basic understanding. What is it? In bootstrapping, the sampling is done with replacement. So although each sample is the same size as the original training set, it will contain some duplicated instances and omit other instances. This explains how each bootstrapped sample is both the same size as the training set, but they will all be different. On average, about 63% of instances will be included in each bootstrap sample, and 37% excluded. These excludes instances (the out of bag samples) become the test set for that bootstrapped sample. The overview on this page of the mlxtend documentation tells you a bit more about this.
{ "domain": "datascience.stackexchange", "id": 11317, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "sampling, variance, bias, bootstraping", "url": null }
quantum-mechanics, quantum-information, quantum-entanglement, bells-inequality Title: How does using a Bell state lead to a $\cos \left(\frac{1}{8}\pi \right)$ probability of winning in the CHSH game? I have trouble understanding how the CHSH (which stands for John Clauser, Michael Horne, Abner Shimony, and Richard Holt) game, as described in this paper (and shortly explained in this post), works. I understand that $75\%$ is the maximum probability of winning in a classical system. The following Bell state $$\frac{\left| 00 \right> + \left| 11 \right>}{\sqrt{2}}$$ can be interpreted as having $50\%$ chance that both qubits are $\left| 0\right>$ and $50\%$ chance that they are both $\left| 1 \right>$. This state can be prepared using the following gate
{ "domain": "physics.stackexchange", "id": 35978, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-information, quantum-entanglement, bells-inequality", "url": null }
c++, algorithm, c++20 -9.00354e-15 4.20641e-15 8.98126e-15 -4.09273e-15 -1.13687e-15 2.04636e-15 1.81899e-15 4.54747e-15 -1.53477e-15 8.78231e-15 -1.80875e-14 -4.20641e-15 5.91172e-15 6.25278e-15 8.18545e-15 6.82121e-16 3.97904e-15 -2.84217e-16 -8.78231e-15 4.23483e-15 -1.17368e-14 4.66116e-15 5.45697e-15 -6.0254e-15 -1.36424e-15 2.50111e-15 6.82121e-16 5.74119e-15 1.93268e-15 4.50484e-15 4.22041e-15 1.93268e-15 -6.82121e-16 1.93268e-15 1.13687e-16 4.54747e-16 1.98952e-16 -5.3717e-15 1.15676e-14 -2.07478e-15 9.305e-15 -1.19371e-15 4.66116e-15 4.74643e-15 3.32534e-15 3.35376e-15 6.79279e-15 3.90799e-15 -1.8332e-15 -3.41061e-16
{ "domain": "codereview.stackexchange", "id": 42617, "lm_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, c++20", "url": null }
Proof of Lemma 1 Suppose the space $Y$ satisfies condition 1. Let $H$ and $K$ be disjoint closed subsets of the space $Y$. Consider $H \subset U=Y \backslash K$. Using condition 1, there exists a sequence $U_1,U_2,U_3,\cdots$ of open subsets of the space $Y$ such that $H \subset \bigcup_{i=1}^\infty U_i$ and $\overline{U_i} \cap K=\varnothing$ for each $i$. Consider $K \subset V=Y \backslash H$. Similarly, there exists a sequence $V_1,V_2,V_3,\cdots$ of open subsets of the space $Y$ such that $K \subset \bigcup_{i=1}^\infty V_i$ and $\overline{V_i} \cap H=\varnothing$ for each $i$. For each positive integer $n$, define the open sets $U_n^*$ and $V_n^*$ as follows: $U_n^*=U_n \backslash \bigcup_{k=1}^n \overline{V_k}$ $V_n^*=V_n \backslash \bigcup_{k=1}^n \overline{U_k}$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9907319885346244, "lm_q1q2_score": 0.8076769075174758, "lm_q2_score": 0.8152324915965392, "openwebmath_perplexity": 2702.333109678335, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://dantopology.wordpress.com/tag/metrizable-spaces/" }
phase, wave, hilbert-transform Title: Instantaneous phase calculation problems I am currently struggling with a problem when calculating the instantaneous phase of a wavefield using a 1D Hilbert transformation. The scheme is as follows. 1D Hilbert transformation of wave field $U(x,z)$ $$ q_z(x,z) = H_z[U(x,z)] = \int_R U(x-\xi,z)\frac{d\xi}{\xi} $$ Calculation of the instantaneous phase $\phi(x,z)$ $$ \phi(x,z) = arctan\left(\frac{q_z(x,z)}{U(x,z}\right), $$ where $x$ and $z$ are the coordinates and $H_z$ is the 1D Hilbert transformation over the vertical direction. My problem is, that $\phi(x,z)$ which is implemented using the intrinsic function $atan2()$ contains phase shifts [$\pi \rightarrow -\pi$]. Using the instantaneous phase for further calculations in which its gradient is derived hence leads to imaging artifacts as shown in the attached pictures: TOP LEFT: input wavefield $U(x,z)$ TOP RIGHT: Hilbert transformed wavefield $q_z(x,z) = H_z[U(x,z)]$ BOTTOM LEFT: instantaneous phase $\phi(x,z)$ BOTTOM RIGHT: derived propagation angle with artifacts . My question: I am able to overcome this problem using Gauss filtering or Median filtering. Yet this does not wotrk properly for more complicated wavefields and higher frequencies. Is there another way to overcome those sharp transitions in the area of my wavefield? (not the noise around) Thanks alot! One way to overcome this problem is phase unwrapping, which is also implemented by the Matlab function unwrap. But I believe that the best option for obtaining the derivative of the phase is to avoid a direct computation, but instead start out from the complex function itself. To simplify notation, let's use $U$ (without arguments): $$U=re^{j\phi}=a+ib$$
{ "domain": "dsp.stackexchange", "id": 2125, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "phase, wave, hilbert-transform", "url": null }
qiskit, measurement Be aware though that this will return the complete system, including the qubit which has been measured. For instance, if outcome is equal to '1', then your resulting state would be $\frac{|001\rangle-|111\rangle}{\sqrt{2}}=\frac{|00\rangle-|11\rangle}{\sqrt{2}}\otimes|1\rangle$.
{ "domain": "quantumcomputing.stackexchange", "id": 4319, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "qiskit, measurement", "url": null }
matlab, kalman-filters, estimation, filtering, bayesian-estimation We have shown a range of coordinated turn (CT) models using either Cartesian or polar velocity and how to use them in a Kalman filtering framework for maneuvering target tracking. The results of the conducted simulation study are in favor of polar velocity. This confirms the results of the previous study [11] and extends it to the case of varying target speed. For polar CT models, the performance in terms of position RMSE of the predicted state appears to be comparable for EKF and UKF. As the UKF does not require the derivation and implementation of Jacobians it might be more straightforward to implement. The RMSE provided by the Cartesian velocity EKF and UKF turned out slightly worse. Interestingly, the sensitivity of the RMSE with respect to the noise parameters was decreased by using EKF2 and UKF in the Cartesian case. This, in addition to the simpler implementation and lower computational cost of UKF over EKF2 results in a recommendation for UKF if Cartesian CT models are preferred. Basically telling you, don't bother with Jacobians, just use the simpler UKF. Another comparison is made at Implementation of the Unscented Kalman Filter and a simple Augmentation System for GNSS SDR receivers with: As can be seen, UKF implementation does not require linearization (state transition function and measurements functions are directly applied to sigma points) and it can also work in presence of discontinuities. The prediction only consists of linear algebra operations. All such advantages are fundamental for minimizing computational load in an SDR implementation. While the classical Kalman Filter implies the propagation of n components for the state vector and n2 /2+n/2 components for the Covariance matrix, the UKF requires the propagation of 2n+1 sigma points only. Furthermore, UKF is more insensitive to initial conditions with respect to EKF. It has been demonstrated that UKF rapidly converge also in presence of an initial position error of several Kilometers.
{ "domain": "dsp.stackexchange", "id": 6614, "lm_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, kalman-filters, estimation, filtering, bayesian-estimation", "url": null }
electrostatics, charge, potential, potential-energy $$\int_{0}^{2\pi}\int_{0}^{\pi}\frac{\sin(\theta)d\theta d\phi}{\sqrt{2-2\cos(\theta)}}=4\pi$$
{ "domain": "physics.stackexchange", "id": 81112, "lm_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, charge, potential, potential-energy", "url": null }
c record_preferences(ranks); printf("\n"); } add_pairs(); sort_pairs(); lock_pairs(); print_winner(); return 0; } bool vote(int rank, string name, int ranks[]){ // Update ranks given a new vote // TODO for(int i = 0; i < candidate_count; i++){ if(strcmp(candidates[i], name) == 0){ ranks[rank] = i; return true; } } return false; } void record_preferences(int ranks[]){ // Update preferences given one voter's ranks for(int i = 0; i < candidate_count; i++){ //Cycle through candidates for(int j = 0; j < candidate_count; j++){ //Cycle through rank list if((i == ranks[j]) && (j != candidate_count - 1)){ //If found and not last candidate for(int k = j + 1; k < candidate_count; k++){ preferences[i][ranks[k]]++; } } } } return; } void add_pairs(void){ // Record pairs of candidates where one is preferred over the other // TODO return; } void sort_pairs(void){ // Sort pairs in decreasing order by strength of victory // TODO return; } void lock_pairs(void){ // Lock pairs into the candidate graph in order, without creating cycles // TODO return; }
{ "domain": "codereview.stackexchange", "id": 38847, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c", "url": null }
python, performance, array, random Functions: consider to encapsulate the code in a function, it is easier to reuse and test. Exit condition: this part: if is_same: continue else: break Can be simplified to: if not is_same: break binary vs integer sequence: probably you know it, but the result is a "sequence" of integers, not a binary sequence as the title says. Collisions: the suggested approach can become very slow for some configurations of dim and batch_size. For example, if the input is dim=10 and batch_size=1024 the result contains all configurations of 10 "bits", which are the binary representations of the numbers from 0 to 1023. During the generation, as the size of the set sequences grows close to 1024, the number of collisions increases, slowing down the function. In these cases, generating all configurations (as numbers) and shuffling them would be more efficient. Edge case: for dim=10 and batch_size=1025 the function never ends. Consider to validate the input.
{ "domain": "codereview.stackexchange", "id": 40394, "lm_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, array, random", "url": null }
# Does every statistic have a sampling distribution, not just the sample mean? I am curious because most basic undergraduate statistics reference just start out Inferential Statistics by mentioning sampling distributions and the sampling distribution of the mean. My question is that does every statistic have one? Even the sample proportion, sample variance and standard deviation? Edit: What would they be like? • Not only does every statistic have a distribution, but, as statistics themselves, so do those distributions, and those distributions' distributions,... Aug 4 '20 at 18:02 • @berniethejet do you mean that the empirical distributions (as opposed to the true distributions) of the sample statistics have a distribution? Aug 7 '20 at 5:32 • @Adrian: Take a histogram, for example. A histogram is a list of 'statistics' if we are interpreting it as an estimate of probabilities of some data over some ranges. But each of those individual probability estimates within the list also has its own 'true' as well as 'empirical' distribution. If we then did bootstrapping, for example, dropping observations and reestimating the histogram, then we could see the list of probabilities change. - Aug 7 '20 at 20:37 • ...Collecting these lists of estimated probabilities we could then continue estimating separate histograms on each of those sublists. We could derive all sorts of statistics on the probability estimates, say 95% CI, based on these 'sub-histograms'. But why stop there? We could also continue on, doing sub-sub-histograms with all of their corresponding sub-sub-statistics. Aug 7 '20 at 20:37 • Right, but the histogram is describing an empirical distribution (which is noisy), rather than a "true" distribution (which is fixed, albeit unknown/unobservable) Aug 8 '20 at 1:33 Yes, every statistic has a sampling distribution (though some may be degenerate). What would they be like? The sampling distribution of a statistic - just as with the mean - will in general depend on the population distribution you start with (and the sample size, naturally).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9669140216112958, "lm_q1q2_score": 0.8199119191647692, "lm_q2_score": 0.8479677622198946, "openwebmath_perplexity": 613.1661994177646, "openwebmath_score": 0.7447248697280884, "tags": null, "url": "https://stats.stackexchange.com/questions/481411/does-every-statistic-have-a-sampling-distribution-not-just-the-sample-mean" }
• Very nicely and succinctly put! – fleablood Apr 26 '16 at 7:26 $a_n\bmod 2$ depends only on $a_{n-1}\bmod 2$, $a_{n-2}\bmod 2$, and $n\bmod 2$. We can describe the transition $(n\bmod 2,a_{n}\bmod 2,a_{n-1}\bmod 2)\mapsto (n+1\bmod 2,a_{n+1}\bmod 2,a_{n}\bmod 2)$ by the following table $$\begin{matrix}(0,0,0)&\mapsto&(1,1,0)\\(0,0,1)&\mapsto&(1,0,0)\\ (0,1,0)&\mapsto&(1,0,1)\\ (0,1,1)&\mapsto&(1,0,1)\\ (1,0,0)&\mapsto&(0,0,0)\\ (1,0,1)&\mapsto&(0,1,0)\\ (1,1,0)&\mapsto&(0,1,1)\\ (1,1,1)&\mapsto&(0,1,1)\\\end{matrix}$$ and we start with $(1,1,1)$. The sequence will be eventually periodic and this allows you to predict the triple (and hence parity of $a_n$) belonging to $n=2011$. Claim: for $n\ge 4$, $a_n$ is odd if n is odd and even if n is even. We can verify directly $a_4$ is even as $a_2=a_0a_1+2=odd*odd+even=odd$ while $a_3=a_1*a_2+3=odd*odd+odd=even$ so $a_4=a_2*a_3+4=a_2*even +even =even$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.983596967483837, "lm_q1q2_score": 0.834058511885449, "lm_q2_score": 0.8479677545357568, "openwebmath_perplexity": 102.1604508834433, "openwebmath_score": 0.8577583432197571, "tags": null, "url": "https://math.stackexchange.com/questions/1759109/is-the-2011th-term-odd-for-this-sequence-and-why-so" }
navigation, kinect, turtlebot, costmap, gmapping Title: Sensor raytrace error when maps set to voxel Hello, I am trying to run navigation on a Turtlebot 2 with Kinect on ROS Groovy and Ubuntu 12.04 64 bit. I have previously been able to run the gmapping demo to create maps just fine, and have been using it to experiment with the "explore" algorithm. My issue thus far as been that, while I have been able to get explore working with 2D costmaps, this is not enough because the Kinect cannot locate some obstacles on the ground and has been crashing into things. I would like to have gmapping also take the bump sensor on the Kobuki into account, and it seems the only reasonable way to do that is by using voxel maps instead of 2d costmaps, as per this question: http://answers.ros.org/question/58111/bumper-in-the-gmapping-costmap-turtlebot/ I have changed my gmapping parameter files to do this. I then run the following: roslaunch turtlebot_bringup minimal.launch roslaunch turtlebot_navigation gmapping_demo.launch After gmapping launches, I immediately get this repeated error: Registering First Scan [ INFO] [1378838179.754750699]: Still waiting on map... [ INFO] [1378838180.763781769]: Received a 320 X 512 map at 0.050000 m/pix
{ "domain": "robotics.stackexchange", "id": 15484, "lm_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, kinect, turtlebot, costmap, gmapping", "url": null }
navigation, ros-kinetic, costmap, scan, global-costmap Title: local costmap remember past obstacles A bit of background about my setup: I have a robot with a lidar sensor at about 4 feet off the ground and a kinect sensor at about 1.5 feet off the ground. the two sensors are directly above each other with the kinect pointing forward. this was done in a attempt to give the robot a full 360 degree view of the room while also giving it a view of lower objects like table legs. i am using depthimage_to_laserscan to get a laser scan out of the kinect. then im using laser_merge to combine the scan from the lidar and the scan from the kinect into a single laser scan. what results is a lasercan of the room that shows data from whatever sensor sees a closer object. The Problem: Because the kinect has a small field of view, a couple degrees of rotation from the robot is enough for an object to go out of view. this results in the robot adding objects to the local costmap as it approaches but then clearing them as it rotates to go around. often it will then cut the corner really hard because it thinks there's nothing there and it hits the object. at this point it is often too close for the kinect to detect anything. Is there a way to have some sort of buffer where the local costmap remembers for a short period that something was there even when it leaves its view? and if not do you all have any suggestions of how i can prevent my robot from hitting things? Thanks! EDIT: Here are my config files common params footprint: [[0.5, 0.35], [0.5, -0.35], [-0.5, -0.35], [-0.5, 0.35]] observation_sources: laser_scan_sensor laser_scan_sensor: {sensor_frame: camera_link, data_type: LaserScan, topic: scan, marking: true, clearing: true} local params local_costmap: global_frame: /odom robot_base_frame: base_link rolling_window: true global params global_costmap: global_frame: /map robot_base_frame: base_link static_map: true transform tolerance: 0.5
{ "domain": "robotics.stackexchange", "id": 33884, "lm_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-kinetic, costmap, scan, global-costmap", "url": null }
c#, entity-framework, asp.net-mvc, repository public UnitOfWork() : this(new PropertyInfoEntities()) { } public UnitOfWork(PropertyInfoEntities context) { _context = context; InitRepositories(); } private void InitRepositories() { XXXXXRepository = new XXXXXRepository(_context); PersonRepository = new PersonRepository(_context); PersonLoginRepository = new PersonLoginRepository(_context); PropertyApplicationRepository = new PropertyApplicationRepository(_context); SaleTypeRepository = new SaleTypeRepository(_context); StatusRepository = new StatusRepository(_context); TownRepository = new TownRepository(_context); TypeRepository = new TypeRepository(_context); } public void Save() { _context.SaveChanges(); } #region IDisposable Members public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing == true) { _context = null; } } ~UnitOfWork() { Dispose(false); } #endregion } public interface IUnitOfWork : IDisposable { IXXXXXRepository XXXXXRepository { get; set; } IPersonRepository PersonRepository { get; set; } IPersonLoginRepository PersonLoginRepository { get; set; } IPropertyApplicationRepository PropertyApplicationRepository { get; set; } ISaleTypeRepository SaleTypeRepository { get; set; } IStatusRepository StatusRepository { get; set; } ITownRepository TownRepository { get; set; } ITypeRepository TypeRepository { get; set; } void Save(); }
{ "domain": "codereview.stackexchange", "id": 7065, "lm_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#, entity-framework, asp.net-mvc, repository", "url": null }
This definition is adequate for most applications of the theory. ## Also presented as Lines may if desired be drawn between rows and columns of an array in order to clarify its sections, for example: $\sqbrk {\begin {array} {ccc|cc} a_{11} & a_{12} & a_{13} & b_{11} & b_{11} \\ a_{21} & a_{22} & a_{23} & b_{21} & b_{21} \\ \hline c_{11} & c_{12} & c_{13} & d_{11} & d_{12} \\ c_{21} & c_{22} & c_{23} & d_{21} & d_{22} \\ c_{31} & c_{32} & c_{33} & d_{31} & d_{32} \\ \end {array} }$ ## Also known as Some older sources use the term array instead of matrix, but see above: the usual convention nowadays is to reserve the term array for the written-down denotation of a matrix. The notation $\mathbf A = \sqbrk a_{m n}$ is a notation which is not yet seen frequently. $\mathbf A = \paren {a_{i j} }_{m \times n}$ or $\mathbf A = \paren {a_{i j} }$ are more common. However, the notation $\sqbrk a_{m n}$ is gaining in popularity because it better encapsulates the actual dimensions of the matrix itself in the notational form. Some use the similar notation $\sqbrk {a_{m n} }$, moving the subscripts into the brackets. Some sources use round brackets to encompass the array, thus:
{ "domain": "proofwiki.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9859363696508799, "lm_q1q2_score": 0.8060764131687803, "lm_q2_score": 0.817574478416099, "openwebmath_perplexity": 268.0570593674152, "openwebmath_score": 0.9386361837387085, "tags": null, "url": "https://www.proofwiki.org/wiki/Definition:Matrix" }
algorithms, graphs, network-flow, ford-fulkerson Title: How to find a crticial edge in a flow network? The complete question is as follows: An edge of a flow network is called critical if decreasing the capacity of this edge results in a decrease in the maximum flow. Give an efficient algorithm that finds a critical edge in a network. I believe some variation of Ford-Fulkerson would have to be used over here, however I am not too sure. Also I am a little confused by the wording of the question. What does efficient mean? In linear time i.e. $O(|V| + |E|)$? By the max-flow min-cut theorem the (maximum) flow $f$ between two vertices $s$ and $t$ in the network is equal to the overall weight of the edges in a minimum $s$-$t$-cut $C$. The means that it suffices to find a minimum $s$-$t$-cut $C$ and return any edge $e \in C$ (decreasing the capacity $e$ reduces the weight of the minimum cut and hence the flow from $s$ to $t$). A way to find $C$ using again the relation with the maximum flow is as follows: find a maximum flow from $s$ to $t$ (using the algorithm of your choice) and let $S$ be the set of saturated edges, i.e., edges such that the flow across them matches their capacity. Choose $C$ as the set of all edges $(u,v)$ such that $u$ is reachable from $s$ and $v$ can reach $t$ in $G-S$.
{ "domain": "cs.stackexchange", "id": 20308, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, graphs, network-flow, ford-fulkerson", "url": null }
Take $$x_{0} \geq 0$$ and, for $$x > x_{0}$$, define $$g(x) = x^{\alpha} - x_{0}^{\alpha} - (x-x_{0})^{\alpha}.$$ Then $$g'(x) = \alpha x^{\alpha-1} - \alpha(x-x_{0})^{\alpha-1}.$$ Since $$\alpha - 1 < 0$$ and $$x > x_{0}$$, $$g'(x) \le 0$$. So, $$g'$$ is decreasing with $$g(x_{0}) = 0$$, for $$x > x_{0}$$. Can you continue? • Yes, I think I can continue. Since $g'$ is decreasing for $x>x_0$, with $g(x_0)=0$, it implies that $g'\leq 0$ for $x>x_0$. Using this we can conclude that $g(x) \leq g(x_0) = 0$ for $x>x_0$. I think that should imply the result with $c=1$. Apr 26 '19 at 1:23
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969636371975, "lm_q1q2_score": 0.8018601989772992, "lm_q2_score": 0.8152324871074608, "openwebmath_perplexity": 54.20571572763714, "openwebmath_score": 0.9747045636177063, "tags": null, "url": "https://math.stackexchange.com/questions/3202662/x-alpha-as-an-example-of-an-alpha-h%c3%b6lder-continuous-function" }
• Mark, is this common factor b-3 found by dividing the second quadratic by the first quadratic in your second equation? not too sure how you found it. – inya Jan 1 '16 at 18:26 • @inya Well I factorised the first quadratic as $(b-3)(b-12)$ and tried $b=3$ in the second. But I could just have solved the second too, or used Euclid's algorithm for polynomials to find the common factor. – Mark Bennet Jan 1 '16 at 18:29 • So I think I'm right in thinking that in essence, we have b=3 so thats where $z^2=3$ comes from, since $z^2=-b$. However, what 'happens' to b = 12? Why isn't that in the second factor and how come it doesn't contribute to another root of the equation? Thanks. – inya Jan 1 '16 at 23:05 • @inya $b=12$ is an extraneous root as is $b=\frac 83$ from the second equation - substituting them in gives a false equation. If there were no common root, the assertion of purely imaginary roots would be false. – Mark Bennet Jan 1 '16 at 23:10 • I understood your answer intuitively best, although the other answers also provided great insight. Thanks. – inya Jan 1 '16 at 23:51 Your polynomial $f$ has real coefficients. Therefore, if $r$ is one root of $f$, $\overline r$ will be another. If $r$ is also imaginary, then $\overline r = -r$. Thus if there is an imaginary root $r$ of $f$, then we must have $f(r)=f(-r)=0$, in other words, the polynomials $f(x)$ and $f(-x)$ have at least one common root, namely $r$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.985718068592224, "lm_q1q2_score": 0.8104466881976673, "lm_q2_score": 0.8221891370573388, "openwebmath_perplexity": 246.33484809477483, "openwebmath_score": 0.8609429597854614, "tags": null, "url": "https://math.stackexchange.com/questions/1596214/prove-the-roots-of-a-complex-polynomial-are-imaginary" }
python, opencv2 svm = cv2.SVM(training_data, responses) Originally posted by Pi Robot on ROS Answers with karma: 4046 on 2011-06-26 Post score: 1 OK, it only took me about 5 hours of trial and error to finally figure this out. Turns out the SVM class requires the training data to be of type numpy.float32. Since my training data was in regular Python arrays, I had to convert them like this: training_data = np.array(python_training_data, dtype=np.float32) responses = np.array(python_responses, dtype=np.float32) Now all is well. --patrick Originally posted by Pi Robot with karma: 4046 on 2011-06-26 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 5963, "lm_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, opencv2", "url": null }
c++, role-playing-game system("pause"); Calling external programs like that is not a good thing, it opens up a security hole in your application instead use std::getline or similar. You forgot to initialize some variables e.g. int gold; <--- int sword; gold = gold + 20; Always make it a habit to initialize variables when you declare them. Don't call main(). It makes the program flow difficult to follow, instead have a loop in main() if you want to allow restart of the game.
{ "domain": "codereview.stackexchange", "id": 12158, "lm_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++, role-playing-game", "url": null }
python, algorithm, programming-challenge, numbers-to-words if 100 <= num <= 999: if num % 100 == 0: letters += numbersDict[int(num / 100)] + "hundred" else: digit = int(num / 100) num = num - digit * 100 if 0 < num <= 20: letters += numbersDict[digit] + "hundredand" + numbersDict[num] if 21 <= num <= 99: a,b = divmod(num, 10) if b == 0: letters += numbersDict[digit] + "hundredand" + numbersDict[a*10] else: letters += numbersDict[digit] + "hundredand" + numbersDict[a*10] + numbersDict[b] if num == 1000: letters += "onethousand" return letters for i in range(1,1001): addList.append(len(numberLetters(i))) print(sum(addList)) Aside from the repetitive logic in the code to handle numbers greater than a hundred, the solution is not bad. There are many observations that could lead to improvements, though. You don't need to build the strings themselves; you just need to sum their lengths. In particular, since strings are immutable, += is relatively costly. (Your solution is still fast enough, though.) The challenge never requires you to treat 0 as "zero". You can therefore simplify some logic by mapping 0 to an empty string. The ranges 0 < num <= 20, 21 <= num <= 99, 100 <= num <= 999, and num == 1000 are mutually exclusive. You can reduce repetition by using recursion. Solution numbers_dict = { n: len(word) for (n, word) in { 0: "", 1: "one", 2: "two", 3: "three", 4: "four", 5: "five", 6: "six", 7: "seven", 8: "eight", 9: "nine", 10: "ten", 11: "eleven", # ... 90: "ninety", }.iteritems() }
{ "domain": "codereview.stackexchange", "id": 16230, "lm_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, programming-challenge, numbers-to-words", "url": null }
error-correction, surface-code Title: Quantum Error Correction on a hexagonal lattice I have an exercise in QEC, where I have given a hexagonal lattice with periodic boundary conditions (wrapped around a torus), with a qubit at each vertex. I have also given the Stabilizer generators $X \otimes Y \otimes Z \otimes X \otimes Y \otimes Z$ and $Z \otimes Z$ on the vertical lines of the hexagon. So how is it possible to deduce the logical operator $X$ and $Z$ on both logical qubits. Or a in a more general way, how can I find by a given lattice and stabilizer generators the logical operations? In the lecture we have just looked at some QEC like the surface Code (and a version of the surface Code where it is wrapped around the torus) and we have put some lines through the lattice and named it the logical X and Z. If I understood it right we used some stabilizers to change some of the code-qubit values such that it represents the same logical value in the logical qubits. So how can I use this Information to create the logical X and Z operation? For topological codes like this, you can find logical operators by placing down a single seed Pauli. It will anticommute with some of the stabilizers. Try placing a Pauli to fix one of those anticommutations. That will create a new anticommutation, but in a different spot. Keep doing this and you'll realize you can sort of push the anticommutation problem around the grid. Try pushing it into a boundary or pushing it all the way around the donut to make it terminate. That will reveal the observables. Programmaticaly, you can use stim.Tableau.from_stabilizers([...], allow_underconstrained=True) to solve for the degrees of freedom not covered by the stabilizers (these are typically the logical observables). It won't give you insight into what the observable is, topologically speaking, but it can give you something valid to start from.
{ "domain": "quantumcomputing.stackexchange", "id": 5324, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "error-correction, surface-code", "url": null }
group-theory, representation-theory As a final note, I spoke in this about the action of $\mathrm{SO}(3)$ on $\mathfrak{so}(3)$, not $\mathfrak{su}(2)$; however, it is not difficult to show that these two Lie algebras are isomorphic, with the linear isomorphism $L_i \leftrightarrow \frac{1}{2}\sigma_i$. We ordinarily do not distinguish between them for this reason; $\mathrm{Ad}(R)$ can be understood as a linear map $\mathfrak{su}(2)\rightarrow\mathfrak{su}(2)$ with the same components as above, i.e. $$\big[\mathrm{Ad}(R)\big](\sigma_k) = R^j_{\ \ k} \sigma_j$$ Along similar lines, because $\mathrm{SO}(3)$ is compact and connected, we can write any $R$ as $e^A$ for some $A\in \mathfrak{so}(3)$. Mapping this $A = A^\mu L_\mu \mapsto \frac{1}{2}A^\mu \sigma_\mu = \tilde A\in \mathfrak{su}(2)$, we exponentiate to obtain the unitary matrices $U(R) = e^{i\tilde A}$.
{ "domain": "physics.stackexchange", "id": 84164, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "group-theory, representation-theory", "url": null }
c++, linked-list Did that comment tell me anything I could not understand by simply reading the name of the function insertNext() and the two lines of code! Design You have implemented a singly linked list. Sure but this is actually harder to do than implement a doubly linked list. As a result I am sure I will find a bug. The tiny amount of extra design will simplify your code tremendously. You have implemented the list using null to mark the terminator. If you look up a technique called Sentinel List you will find a technique that removes the need for null. By removing the need for null your code will be highly simplified as you don't need to special case inserting into an empty list or and the head/tail of a list it is all simply an insertion into the list. You maintain state about the internal "current" position. Could not see any errors but it seemed all a bit doggey and makes the code complex. I would dump this functionality and just ask the user to pass a position for insertion/deleting/getting. High Level Code Making it as a top level type you have exposed an implementation detail of the class. This is bad design as it locks you into using that implementation. Also because you have made it a top level type you have overcomplicated it (presumably to prevent abuse). But a class that should have been 6 lines top takes a 100 lines of vertical space. That's an unnecessary cognitive load to put on the maintainer. Idioms Your linked list holds pointers. But I don't see you obeying the rule of 3/5. You should look it up and read it. But without reading the code I bet the following does strange things. MyList<int> listA; listA.insertHead(1); MyList<int> listB; listB = listA; // Uses the compiler generated copy assignment // If you don't define one the compiler does. // When you'r class has pointers make sure // you define the methods the compiler may // generate automatic implantations off. listB.insertHead(2); How many items are in listA? What is The Rule of Three? Rule-of-Three becomes Rule-of-Five with C++11?
{ "domain": "codereview.stackexchange", "id": 35685, "lm_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++, linked-list", "url": null }
evolution, sociality Based on the foundations above, why would someone behave altruistically to someone only 'similar' to you? The biggest difficulty is knowing that we understand all the costs and benefits involved, most of the time we only know some of them and its impossible that you can know all of them because you can't know what you don't know. Humans have effectively 'bootstrapped' behaviours which are 'for the good of society' building on from previously developed behaviours. However we are still fundamentally asking a question about Hamilton's Rule. Being seen as a part of society induces altruistic behaviour towards you (because you are seen as worth something), this is good for you and the costs associated with being altruistic are usually low. Thus you would never rationally die for 1000 unrelated individuals unless you had at least had all the children you were going to have and raised them to be independent. But you would vote, by voting you suffer a tiny cost, your time, for a huge benefit. Benefits might include:
{ "domain": "biology.stackexchange", "id": 339, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, sociality", "url": null }
lambda-calculus The renaming in your example $ \lambda y. (x\,y) [x:=y] = \lambda z.(y\,z)$ is needed because the $y$ in the substitution is a free variable (possibly taking a value in whatever environment or substitution may be provided). Without the renaming, it would be undistinguisable from the bound variable of the $\lambda$-abstraction once the substitution is performed. To avoid that, the bound variable is renamed, since renaming it does not matter. Contrarily, in the expression $(x\,y)[x:=y]$, both occurences of $y$ stand for the same free variable $y$ in the current environment. There is no reason to try distinguishing them.
{ "domain": "cs.stackexchange", "id": 3099, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lambda-calculus", "url": null }
validation, asynchronous, f#, finance, entity-framework-core if remainder = 1 then Ok iban else Error TypingError let format iban = Regex.Replace (iban, ".{4}", "$0 ") |> Ok let validate = checkCharacters >=> cleanup >=> checkLength >=> checkRemainder >=> format // Is not that I am a big fun of point free functions, but I've seen many F# validation examples written in this style, by using composition with the monadic >=> fish operator. The code that create module Rm.Iban.App.IbanRetrieval open System open System.Linq open Microsoft.FSharp.Data open Domain open Microsoft.EntityFrameworkCore type RequestError = | AlreadyRequested type MeetRequestError = | RequestNotFound | IbanInvalid of IbanValidation.ValidationError [<AutoOpen>] module private Impl = let memberIbansWith (context: DbContext.IbanDbContext) memberId ibanState = query { for iban in context.Ibans do where ( iban.MemberId = memberId && iban.State = ibanState) } let requested (context: DbContext.IbanDbContext) memberId = let requested = memberIbansWith context memberId IbanState.Requested requested.Select(fun iban -> Some iban) .SingleOrDefaultAsync() |> Async.AwaitTask // The async workflow is not really needed here. let avoidDuplicateRequest (context: DbContext.IbanDbContext) memberId = async { let! exists = context.Ibans.AnyAsync(fun iban -> iban.MemberId = memberId && iban.State = IbanState.Requested) |> Async.AwaitTask if exists then return Error AlreadyRequested else return Ok (context, memberId) }
{ "domain": "codereview.stackexchange", "id": 35383, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "validation, asynchronous, f#, finance, entity-framework-core", "url": null }
electrochemistry, nanotechnology, colloids Title: Generating colloids / nano-particles from palladium and platinum wire I know I can generate colloidal silver from the following link generate colloidal silver I now have 2 palladium and 2 platinum wires and would like to make one colloidal solution of palladium and one colloidal solution of platinum both in distilled water. I watched a video on doing this making platinum nanoparticles link but no specifics were given on how it was made, did they use AC / DC voltage, what was the amperage used, and can it be made in distilled water and if so how? Anyone have suggestions or steps I should follow? A reliable method to obtain metallic nanoparticles in general is to reduce a metallic ion in presence of a capping agent. For a example, a traditional method to obtain gold nanoparticles (AuNPs) is to reduce a gold salt in presence of dodecanothiol. For example, here is a method to obtain Pd nanoparticles by thermal decomposition, still the precursor is a Pd complex and the method requires a capping agent. (TOP stands for trioctylphosphine)
{ "domain": "chemistry.stackexchange", "id": 15734, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrochemistry, nanotechnology, colloids", "url": null }
Overcounting cricketer combinations Following this, Navneet had a new problem: I am stuck on another problem: A team of 11 is to be selected out of 10 batsmen, 5 bowlers, and 2 keepers such that in the team at least 4 bowlers should be included. Find the number of possible ways of selection. I tried to solve this question like this: First select 4 bowlers out of 5 = 5C1 Then, remaining candidates = 10+2+(5-4) = 13 Hence, select the remaining 7 players out of 13 = 13C7 So, my final answer is 5C4*13C7 But, this is a wrong answer. The correct answer given is (5C4*12C7)+(5C5*12C6) Please explain me where I am doing the error? Also, can you please tell me what should I check or do in order to avoid such errors in future? Again, a well-asked question, showing his thinking along with the problem and the provided answer, so we have all we need. He got 8580, while they say 4884. Why? Doctor Rick responded: I thought first of the same approach you took. Then I considered it more carefully, looking to see if I had missed any possibilities or if I had counted any selection more than once. I then realized that I was overcounting, and here’s why: You’re selecting four bowlers to include first, and then maybe the fifth bowler will be among the remaining 7 players you choose. But if you chose a different set of four bowlers to start, and then the fifth bowler, you’d end up with the same set of 11 players — you just picked all five bowlers in a different order. More specifically:
{ "domain": "themathdoctors.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.971992476960077, "lm_q1q2_score": 0.8141603048815165, "lm_q2_score": 0.8376199653600372, "openwebmath_perplexity": 476.1485358101222, "openwebmath_score": 0.7988244295120239, "tags": null, "url": "https://www.themathdoctors.org/permutations-and-combinations_undercounts_and_overcounts/" }
javascript, css options += '>' + currentNumber + '</option>\n'; } countOfStrings.innerHTML = options; })(); /* Creates a stringified array. This array contains * strings as elements. Each string is made out * of one or multiple random-words. * * @param { array } words - An array with strings. * @param { number } countOfStrings - Count of strings * within the array. * @min { number } [min = 1] - Minimal count of random-words. * @max { number } [max = 1] - Maximal count of random-words. * @param { string } [separator = '-'] - Separator between the * random-words. * @param { boolean } [linebreak = false] - Add a linebreak * after each element. * @param { string } [arrayName = 'testData'] - The name to the * returned array. * * @returns { string } - Stringified array in case of success. * Empty string in case of failure. */ function getArrayWithTestStrings( words, countOfStrings, min, max, separator, linebreak, arrayName ) { var ret = []; var i; // -- Helper-functions ------- var checkIfNumber = function(num) { return typeof num === 'number' && !isNaN(num); } var getTestStrings = function() { var size = Math.floor(min + (Math.random() * (max + 1 - min))); var ret = ''; var i; for (i = 0; i < size; i++) { ret += words[Math.floor(Math.random() * words.length)] + separator; } return ret.slice(0, ret.length - 1); } // -- Param-checks ------------ if ( !words || !Array.isArray(words) || !words.length ) { return ''; }
{ "domain": "codereview.stackexchange", "id": 21321, "lm_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, css", "url": null }
programming-languages Title: How to resolve issue of circular definition for an `If` statement I am trying to define an If statement, but am stuck because the definition/implementation of If is circular from what I have tried. For example, here is one definition: class If { provide: Condition provide: TrueBlock body: If (Condition) { call(TrueBlock) } } You can then use it like this: If (true) { Something() } But the thing is, the definition itself uses If to define it: class If { ... If (Condition) { call(TrueBlock) } } The only other way I can think of defining it is by saying that an If statement is an "atomic statement", and so it doesn't have an implementation. (The compiler or whatever would then have special instructions to treat it uniquely). class If { provide: Condition provide: TrueBlock } That would be the whole definition of If. No implementation required. Wondering if this is sort of the right approach to this problem. The problem being that you can't really implement an If statement without resorting to using If itself. And so you define it as atomic. One general rule of Turing completeness is that you need some form of conditional branching built into your model. A Turing machine, for example, can transition to a new state based on what it sees on the tape. Programming-language-wise, a while loop works, as does an infinite loop with a conditional break statement, or if and goto. As such, if you have no form of conditional branching built into your model already, you can't create one out of nowhere—if your model isn't Turing complete, you'll need to add something else from outside to the model to make it so. An "atomic" if statement will do the trick, certainly, as will something like Lisp's conditional. But whatever it is, it'll have to be implemented by the compiler or interpreter, rather than being created within the language itself.
{ "domain": "cs.stackexchange", "id": 11683, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "programming-languages", "url": null }
quantum-field-theory, statistical-mechanics, renormalization, effective-field-theory, critical-phenomena Q4: Yes. An RG trajectory (for a discrete RG transformation $R$ rather than flow) is a bi-infinite sequence of forward and backward iterates $(R^n(P))_{n\in\mathbb{Z}}$ of some point $P$, inside the space $T$. Granting the existence of the limits $P_{\pm}=\lim_{n\rightarrow \pm\infty}R^n(P)$, these have to be RG fixed points. So one can say that the trajectory "starts" at $P_{-\infty}$ and "ends" at $P_{\infty}$. Careful though: if one is exactly at $P_{-\infty}$ one stays there forever, i.e., one cannot "start" to go anywhere else. For more on this see: What is the Wilsonian definition of renormalizability? Q5: Yes. For instance if $R$ corresponds to zooming out by a factor of $2$, then the new correlation length (after applying the RG transformation $R$) is exactly the old one divided by $2$.
{ "domain": "physics.stackexchange", "id": 56186, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-field-theory, statistical-mechanics, renormalization, effective-field-theory, critical-phenomena", "url": null }
(A) 7 (B) 8 (C) 9 (D) 10 (E) 11 Ans: A Solution: lets say avg is x so total is (xn): now with the first condition (nx+39)/n+1 = x+2 2n+x = 37 Eq.1 with second condition (nx+15)/n+1 = x-1 x-n = 16 Eq.2 by solving Eq1 and Eq2 we can find out n=7 _________________ -------------------------------------------------------------------- The Mind is Everything, What we Think we Become. Kudos will encourage many others, like me. Thanks Kudos [?]: 121 [0], given: 24 Senior Manager Joined: 28 Feb 2014 Posts: 295 Kudos [?]: 146 [3], given: 133 Location: United States Concentration: Strategy, General Management When a person aged 39 is added to a group of n people, the average age [#permalink] ### Show Tags 19 Aug 2015, 10:29 3 KUDOS 3 This post was BOOKMARKED When a person aged 39 is added to a group of n people, the average age increases by 2. (Sum+39)/(n+1) = avg+2 When a person aged 15 is added instead, the average age decreases by 1. (Sum+15)/(n+1) = avg-1 We can take the 1st equation and subtract from the 2nd equation to isolate n. 24=3n+3 n=7 (A) 7 Kudos [?]: 146 [3], given: 133 Current Student Joined: 21 Nov 2014 Posts: 40 Kudos [?]: 10 [2], given: 35 Location: India Concentration: General Management, Strategy GMAT 1: 750 Q51 V40 WE: Operations (Energy and Utilities) Re: When a person aged 39 is added to a group of n people, the average age [#permalink]
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 1, "lm_q1q2_score": 0.8152324871074608, "lm_q2_score": 0.8152324871074608, "openwebmath_perplexity": 3196.62081075151, "openwebmath_score": 0.5637390613555908, "tags": null, "url": "https://gmatclub.com/forum/when-a-person-aged-39-is-added-to-a-group-of-n-people-the-average-age-203965.html" }
evolution, taxonomy, phylogenetics, history You could argue that a (dead) llama is a big animal, but one can describe an animal using just its bones, or even just some of its bones. Besides that, it's worth mentioning that Owen received a whole mammoth in UK to study and describe! So, sometimes, size is not a problem. Answering your second and third questions, a good deal of the animals he described he never actually saw in the wild or alive. Estimating the precise fraction is way more complicated. The same may be said regarding plants, but I guess that the fraction here is smaller: live plants are easier to maintain, seeds are easy to be transported and sown etc. Besides that, botany was Linnaeus' area of expertise. The same link above says... Linnaeus was also deeply involved with ways to make the Swedish economy more self-sufficient and less dependent on foreign trade, either by acclimatizing valuable plants to grow in Sweden, or by finding native substitutes. Unfortunately, Linnaeus's attempts to grow cacao, coffee, tea, bananas, rice, and mulberries proved unsuccessful in Sweden's cold climate. His attempts to boost the economy (and to prevent the famines that still struck Sweden at the time) by finding native Swedish plants that could be used as tea, coffee, flour, and fodder were also not generally successful. ... which shows us that he dealt with live exotic plants. Regarding your fourth question ("did he name species based on other people description but without ever seeing one dead or alive?"), the answer is yes, specially for plants and insects: there are several specimens that Linnaeus described based just on drawings or paintings (which may be considered other people's description), without ever seeing the actual organism. Two examples are Dysdercus andreae (an animal) and Porella (a plant). PS: Not related to this question or to biology, but this is (unfortunately) quite common in sciences: some of Freud's patients, among them his most famous cases (Anna O., little Hans, etc...), he never actually met or even saw at the distance! He "diagnosed" them using just descriptions and hearsay... ✻ According to RHA comment below, there is a third way: sending people to collect the specimens for you.
{ "domain": "biology.stackexchange", "id": 7890, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "evolution, taxonomy, phylogenetics, history", "url": null }
ros-melodic Title: catkin only generates setup files every other build For some reason, catkin build does not always generate the various setup.sh files when I run it. Running catkin build once, the contents of the devel directory is as follows: cmake.lock etc include lib share Running catkin build again: cmake.lock include local_setup.sh setup.sh share env.sh lib local_setup.zsh _setup_util.py etc local_setup.bash setup.bash setup.zsh Running catkin build yet again: cmake.lock etc include lib share Why is this happening? I am using catkin_tools 0.6.1 with ROS melodic. Edit 2 (SSCCE) Create and cd to an empty directory catkin config -s . catkin build ls devel, observe that various setup files are created catkin build again ls devel, observe that setup files are gone Running the following seems to solve the issue rm -r .catkin_tools mkdir src catkin build ls devel, observe that various setup files are created catkin build again ls devel, setup files are still present Originally posted by Rufus on ROS Answers with karma: 1083 on 2020-07-08 Post score: 0
{ "domain": "robotics.stackexchange", "id": 35245, "lm_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-melodic", "url": null }
which can be simplified to give the desired answer. - From Jensen's inequality, the mean of the square root is less than the square root of the mean, unless the numbers are equal. This is true for more than two numbers as well. - $\sqrt{1001}+\sqrt{1000}>\sqrt{1000}+\sqrt{999} \\ \implies \dfrac{1}{\sqrt{1001}-\sqrt{1000}}>\dfrac{1}{\sqrt{1000}-\sqrt{999}}\\ \implies\sqrt{1000}-\sqrt{999}>\sqrt{1001}-\sqrt{1000} \\ \implies 2\sqrt{1000}>\sqrt{999}+\sqrt{1001}$ - some one already give same answer btw +1 for your effort –  iostream007 May 17 '13 at 17:10 @iostream007: I post my answer and then notify that. –  Argha May 17 '13 at 18:04 $\sqrt x$ is a concave function, therefore $\alpha \sqrt x + (1-\alpha) \sqrt y < \sqrt {x+y }.$ Substitute $\alpha = \frac12, x=999, \text{and } y=1001$ -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9838471647042429, "lm_q1q2_score": 0.808908451344491, "lm_q2_score": 0.8221891370573388, "openwebmath_perplexity": 547.3880004499648, "openwebmath_score": 0.9553602933883667, "tags": null, "url": "http://math.stackexchange.com/questions/394648/comparing-sqrt1001-sqrt999-2-sqrt1000/394771" }
python, cs50 extract validation helper shares = int(shares) In a few places you check for fractional shares. Consider creating a helper that would let you write shares = need_whole_number(shares) and in the error case it would raise a FractionalSharesError to let a top-level try report the appropriate apology(). selling stock you don't own I don't understand the [0] dereference: cur_shares = db.execute( """ SELECT SUM(shares_amount) AS total FROM transactions WHERE user_id = ? AND symbol = ? """, session["user_id"], symbol, ) if not cur_shares[0]["total"] If symbol is some non-existant XYZZY, then we get zero result rows and the [0] leads to IndexError. standard time zone In record_transaction we record now() in the transactions table. It's not obvious to me that we're recording UTC seconds since 1970. Maybe we are? There's no comments or unit tests to help me understand whether running the webserver in EDT or PDT time zone would affect what's stored in the database. It's common to develop against sqlite and then later deploy in production against e.g. postgres, where different clients may be in diverse geographic locations / timezones, hence the concern. This codebase appears to achieve its design goals. I would be willing to delegate or accept maintenance tasks on it.
{ "domain": "codereview.stackexchange", "id": 45084, "lm_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, cs50", "url": null }
c++ Now in the constructor of the object you would pass one of these values (by reference). Variable pressure(15, "Bar", PresureType, myConversions, myUnits); If I was to use a reference wouldn't I have to assign it on deceleration. Is there something I'm missing here? Not sure what you mean. You are already passing it to the cosntructor. There is no change. I'm passing a string that I've already got from another Variable it's a function that's meant to be called solely from within the class but I can see why this is confusing/bad design. Yes get rid of it. Methods are actions that can be performed on your object (any method that does not look like a verb is probably not really part of the class). I thought the reference was to a copied instance of the lhs which has been += to the rhs. I was also under the impression using the default copy constructor was fine as only value and unit need to be unique. Is this wrong? You are returning a reference to a local variable. That variable goes out of scope and will be destroyed at the end of the method. If you turn on your compiler warnings it will tell you about this.
{ "domain": "codereview.stackexchange", "id": 921, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++", "url": null }
$f\prime \left(c\right)=\frac{f\left(b\right)-f\left(a\right)}{b-a}.$ ## Proof The proof follows from Rolle’s theorem by introducing an appropriate function that satisfies the criteria of Rolle’s theorem. Consider the line connecting $\left(a,f\left(a\right)\right)$ and $\left(b,f\left(b\right)\right).$ Since the slope of that line is $\frac{f\left(b\right)-f\left(a\right)}{b-a}$ and the line passes through the point $\left(a,f\left(a\right)\right),$ the equation of that line can be written as $y=\frac{f\left(b\right)-f\left(a\right)}{b-a}\left(x-a\right)+f\left(a\right).$ Let $g\left(x\right)$ denote the vertical difference between the point $\left(x,f\left(x\right)\right)$ and the point $\left(x,y\right)$ on that line. Therefore, $g\left(x\right)=f\left(x\right)-\left[\frac{f\left(b\right)-f\left(a\right)}{b-a}\left(x-a\right)+f\left(a\right)\right]\text{.}$
{ "domain": "quizover.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9916842202936827, "lm_q1q2_score": 0.8616018092163845, "lm_q2_score": 0.8688267813328976, "openwebmath_perplexity": 389.4692698291522, "openwebmath_score": 0.8189693689346313, "tags": null, "url": "https://www.quizover.com/calculus/section/the-mean-value-theorem-and-its-meaning-by-openstax" }
## Inverse The inverse of a tridiagonal matrix is full, in general. For example, $\notag T_5(-1,3,-1)^{-1} = \left[\begin{array}{rrrrr} 3 & -1 & 0 & 0 & 0\\ -1 & 3 & -1 & 0 & 0\\ 0 & -1 & 3 & -1 & 0\\ 0 & 0 & -1 & 3 & -1\\ 0 & 0 & 0 & -1 & 3 \end{array}\right]^{-1} = \frac{1}{144} \left[\begin{array}{ccccc} 55 & 21 & 8 & 3 & 1 \\ 21 & 63 & 24 & 9 & 3 \\ 8 & 24 & 64 & 24 & 8 \\ 3 & 9 & 24 & 63 & 21\\ 1 & 3 & 8 & 21 & 55 \end{array}\right].$ Since an $n\times n$ tridiagonal matrix depends on only $3n-2$ parameters, the same must be true of its inverse, meaning that there must be relations between the elements of the inverse. Indeed, in $T_5(-1,3,-1)^{-1}$ any $2\times 2$ submatrix whose elements lie in the upper triangle is singular, and the $(1:3,3:5)$ submatrix is also singular. The next result explains this special structure. We note that a tridiagonal matrix is irreducible if $a_{i+1,i}$ and $a_{i,i+1}$ are nonzero for all $i$. Theorem 3. If $A\in\mathbb{C}^{n\times n}$ is tridiagonal, nonsingular, and irreducible then there are vectors $u$, $v$, $x$, and $y$, all of whose elements are nonzero, such that
{ "domain": "nhigham.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.99058741207965, "lm_q1q2_score": 0.8121760112647906, "lm_q2_score": 0.8198933293122507, "openwebmath_perplexity": 245.0137884704531, "openwebmath_score": 0.9666736125946045, "tags": null, "url": "https://nhigham.com/2022/01/10/what-is-a-tridiagonal-matrix/?shared=email&msg=fail" }
performance, asynchronous, animation, vb.net Title: My 3D to 2D graphics algorithm is being a bit slow With my VB.Net Windows Forms application, I would like to rotate and project a 3D object. The program works so far, which is why I'm reporting here and not Stack Overflow, but it's slow. I've already made two optimizations: 1.) All points that are on the back of the object, i.e. that cannot be seen, are not drawn. Understandably, this effect does not occur when I look at the hemisphere from above, and with a 90° rotation around the x-axis (side view) 50% of the points are not drawn. 2.) The calculation runs asynchronously. 2.1) Since you cannot draw in the PictureBox from another thread, I did some research. This has shown that you draw in a bitmap and assign it to the PictureBox. 3.) I have already removed the procedure that computes the Cartesian x, y and z and displays it to the user. Overall, the program runs a little faster; but is still too slow. I would like to leave the step size when calculating the surface points for the first time at 0.5, otherwise you will see gaps. I know that results in 130,320 points on a very small area. That's why I came up with the idea not to draw the back. What's the point? I wanted to code the creation and projection of the object myself, without 3rd party libraries. I also want to add a grid in the future, but for that the program has to be faster first. Maybe you can help me save a few clock cycles. Ah, and by the way: I've found that the percentages don't make 100% sense. As you can see here, 49.6% of all points are not drawn (instead of 50%) in the side view.
{ "domain": "codereview.stackexchange", "id": 41782, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "performance, asynchronous, animation, vb.net", "url": null }
urdf, xacro Edit 2: Full urdf xacro. <?xml version="1.0"?> <robot name="macroed" xmlns:xacro="http://ros.org/wiki/xacro"> <robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor" xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller" xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" name="macroed"> <!-- Convert to xacro--> <xacro:property name="width" value="0.2" /> <xacro:property name="leglen" value="0.6" /> <xacro:property name="polelen" value="0.2" /> <xacro:property name="bodylen" value="0.6" /> <xacro:property name="baselen" value="0.4" /> <xacro:property name="wheeldiam" value="0.07" /> <xacro:property name="pi" value="3.1415" /> <material name="blue"> <color rgba="0 0 0.8 1"/> </material> <material name="white"> <color rgba="1 1 1 1"/> </material> <material name="black"> <color rgba="0 0 0 1"/> </material>
{ "domain": "robotics.stackexchange", "id": 26189, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "urdf, xacro", "url": null }
electromagnetism, general-relativity, astrophysics, astronomy, gamma-rays Title: Collision or impact of a gamma-ray burst against the magnetic bubbles at Solar System's edge I'm going to ask* about what should be the effect/interaction, if any, when a gamma-ray burst crashes or hits against the magnetic bubbles at Solar System's edge. These magnetic bubbles are explained in [1] from YouTube. I add also as reference this Wikipedia Gamma-ray burst. Question. Is it possible to say anything about the interaction, the physics, of an impact of a great gamma-ray burst against/going through the magnetic bubbles of a solar system similar than ours? And, additionally, as a secondary question, what happens if the gamma-ray burst does not collide/impact, but passes near the magnetic bubbles, let's say tangentially? Many thanks. I hope that it is possible say something about it (I evoke what work can be done to elucidate something about my questions). If you know references about what should to be the effect of the expected phenomenom or physics after a collisions of a gamma-ray burst and this kind magnetic bubbles of planetary systems similar than ours, feel free to refer it and I try to search and read it from the literature. References: [1] NASA |Voyager Finds Magnetic Bubbles at Solar System's Edge, from the official channel NASA Goddard of YouTube (June, 9th 2011). First, be careful with popular science or press release reports and their terminology. Second, gamma-rays are at such high frequencies (i.e., orders of magnitude above the plasma frequency), they do not care about the low density plasma or it's magnetic field at the edge of the heliosphere. I do not know what the cross-sections are, off hand, between gamma-rays and thermal electrons or protons, but I can't imagine they are large enough for anything statistically meaningful to happen. That is, a few interactions may occur and may cause a few particles to gain energy (or some other particle production but I'm not a particle physicist so I defer to the experts on that) but only a few particles. The point is that one could observe the gamma-rays and one could observe the particles, but I very much doubt anything interesting would occur.
{ "domain": "physics.stackexchange", "id": 70820, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, general-relativity, astrophysics, astronomy, gamma-rays", "url": null }
object-oriented, statistics, constructor, kotlin fun withData(a: Int, b: Double): CDFBuilder { // verification and stuff cdfData[a] = b return this } fun build(): CDF { return CDF(map.toSortedMap()) } } }
{ "domain": "codereview.stackexchange", "id": 33768, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "object-oriented, statistics, constructor, kotlin", "url": null }
algorithm, rust Title: Longest increasing subsequence algorithm I'm just getting into Rust, and I've decided to implement the longest increasing subsequence algorithm suggested in the related Wikipedia page. Though this program compiles and returns the expected sequence for what's passed to lis, I am wondering if more experienced Rust programmers would have written this same algorithm in a different way? fn lis(x: Vec<i32>)-> Vec<i32> { let n = x.len(); let mut m = vec![0; n]; let mut p = vec![0; n]; let mut l = 0; for i in 0..n { let mut lo = 1; let mut hi = l; while lo <= hi { let mut mid = (lo + hi) / 2; if x[m[mid]] <= x[i] { lo = mid + 1; } else { hi = mid - 1; } } let mut new_l = lo; p[i] = m[new_l - 1]; m[new_l] = i; if new_l > l { l = new_l; } } let mut o = vec![0; l]; let mut k = m[l]; for i in (0..l).rev() { o[i] = x[k]; k = p[k]; } o }
{ "domain": "codereview.stackexchange", "id": 29401, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm, rust", "url": null }
algorithms, computer-algebra Title: Solve modulus with constraints for multiple equations I'm trying write a program to solve equations from the following form: $$ \begin{align} a \bmod x &= t_1 \\ b \bmod x &= t_2 \\ \end{align} $$ where $a$, $b$, $t_1$ and $t_2$ are known values. I have multiple equations of the same form and I'd like to solve them for $x$. Assuming I have constraints on $t_1$ and on $t_2$ for some constant $C$: $$ \begin{align} 0 \le t_1 \lt C \\ 0 \le t_2 \lt C \\ \end{align} $$ e.g : for $a=150$, $b=50$, $t1=2$, $t_2=1$: $$ \begin{align} 150 \bmod x &= 2 \\ 50 \bmod x &= 1 \\ 1, 2 \lt 5 \\ \end{align} $$ What would be the most efficient way to program such a thing? As user8962 explains, an equation of the form $a \pmod{x} = b$ is equivalent to $x | a-b$ and $x > b$. Now suppose you have equations $a_i \pmod{x} = b_i$ for $i=1,\ldots,n$. You first compute $g = \gcd(a_1-b_1,\ldots,a_n-b_n)$ (you do that iteratively: $\gcd(x,y,z) = \gcd(\gcd(x,y),z)$ and so on); we know that $x$ is a divisor of $g$ satisfying $x > B = \max_{i=1}^n b_i$. If $B \geq g$ then there is no solution. Otherwise, $g$ is one solution, and there may be other solutions: all divisors of $g$ larger than $B$.
{ "domain": "cs.stackexchange", "id": 1557, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, computer-algebra", "url": null }
# Simplifying compound fraction: $\frac{3}{\sqrt{5}/5}$ I'm trying to simplify the following: $$\frac{3}{\ \frac{\sqrt{5}}{5} \ }.$$ I know it is a very simple question but I am stuck. I followed through some instructions on Wolfram which suggests that I multiply the numerator by the reciprocal of the denominator. The problem is I interpreted that as: $$\frac{3}{\ \frac{\sqrt{5}}{5} \ } \times \frac{5}{\sqrt{5}},$$ Which I believe is: $$\frac{15}{\ \frac{5}{5} \ } = \frac{15}{1}.$$ What am I doing wrong? • You should multiply both numerator and denominator by that constant! – Mahdi Khosravi Jul 23 '13 at 9:50 • Or you can exchange the numerator and denominator of the whole denominator and move it to whole numerator! – Mahdi Khosravi Jul 23 '13 at 9:51 • I know this an old question, but if you had simply changed your √5/5 to a √5/√5, you would've got 3√5÷5/5 and gotten your answer. The whole point of multiplying a complex faction by a number to simplify it is to times it by 1 (√5/√5 in this case) because multiplying anything by 1 is the same thing. – Gᴇᴏᴍᴇᴛᴇʀ Sep 7 '14 at 19:44 • "The problem is I interpreted that as:" .... remember that the numerator is 3. – John Joy Jan 4 at 17:58
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575142422757, "lm_q1q2_score": 0.8588311634968874, "lm_q2_score": 0.87407724336544, "openwebmath_perplexity": 905.0839646469799, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://math.stackexchange.com/questions/450158/simplifying-compound-fraction-frac3-sqrt5-5" }
c#, beginner, selenium, integration-testing, webdriver But, if you want to stick to this existence check API then I would suggest: static bool CheckElementExistence(this IWebDriver driver, string elementXPath, byte waitUntilInSeconds = 10) I've renamed your xpath parameter to a more meaningful one The waitingTimes in my opinion is really bad parameter You have to know some implementation detail (Thread.Sleep(1000)) to be able to determine this parameter's value That's why I would suggest to use some other concept, like waitUntil It is usually a good practice to include the time unit in the name as well to be able to use the API without scrutinizing the documentation (whether it is a milliseconds or seconds) IsElementExists(driver, xpath) == false: I know some people does not like the usage of logical negation operator because it is easy to oversee, but you can rewrite your loop to avoid the usage of == false private static bool CheckElementExistence(this IWebDriver driver, string elementXPath, byte waitUntilInSeconds = 10) { log.Info("Checking existence of " + elementXPath); byte remainingSeconds = waitUntilInSeconds; while (remainingSeconds > 0) { if (DoesElementExist(driver, elementXPath)) return true; Thread.Sleep(1000); remainingSeconds--; } return false; } It might make sense to make your method async and use Task.Delay rather than Thread.Sleep IsElementExists I would suggest to rename your method to DoesElementExist I would also recommend to handle only NoSuchElementException rather than any Exception. For example if the provided xpath is malformed or null the FindElement might throw ArgumentException (that's just an assumption, I don't know). You can handle that case differently var element: if you are not using this variable then you can simple use the discard operator
{ "domain": "codereview.stackexchange", "id": 41987, "lm_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, selenium, integration-testing, webdriver", "url": null }
formal-languages, context-free \end{align}$$ If you try this for, say $ab,ba,bb$, you'll find that they're all in $L$ which prompts a guess that this grammar generates all strings over the alphabet $\{a,b\}$. This isn't too hard to show, by induction on the length of a string in the language. The proof goes like this: Base. Show that the length-0 string, $\epsilon\in L(G)$. (We've done this already.) Induction. Let $w$ be any string of length $n>0$. Our inductive hypothesis is that any shorter string, $z$ is in $L(G)$, i.e., there is a derivation $S\stackrel{*}{\Longrightarrow}z$. Now either $w=za$ or $w=zb$. We'll do one case and leave the rest to you: $$ S\stackrel{1}{\Longrightarrow}SA\stackrel{3}{\Longrightarrow}SaS\stackrel{2}{\Longrightarrow}Sa\stackrel{*}{\Longrightarrow}za = w $$ so $w\in L(G)$, as required.
{ "domain": "cs.stackexchange", "id": 5635, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "formal-languages, context-free", "url": null }
c++, beginner, game cout << "\t\t\t\t | |Attack + Dodge: 2| |Healing: 4| |\n"; cout << "\t\t\t\t | |=================| |============| |\n"; cout << "\t\t\t\t | |\n"; cout << "\t\t\t\t |__ __|\n"; cout << "\t\t\t\t BOSS\n"; cout << "\t\t\t\t kind: " << boss_kind << "\n"; cout << "\t\t\t\t\n"; cout << "\t\t\t\t hp : " << boss_fight_hp << "\n"; cout << "\t\t\t\t power : " << boss_damage << "\n"; cout << "\t\t\t\t shield : " << boss_shield << "\n"; cout << "\t\t\t\t\t| |\n"; cout << "\t\t\t\t\t| |\n"; cout << "\t\t\t\t\t|_______________________________________|\n"; char choose; cin >> choose; switch (choose) { case '1': //attack
{ "domain": "codereview.stackexchange", "id": 41277, "lm_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", "url": null }
• Thanks a lot for this, however as a check I tried 'Partition[x, 3, 1] // Counts' which shows that I have 3 AAA instead of 5, this happens all over the table my worry is that the state ordering and data which you defined are not matched, for example in ordering E has value of 5, while in data it is 2. – Wiliam Aug 8 '18 at 10:28 • @William, re ordering of states, that's why we sort them using ordering so that 2 corresponds to E. Re the discrepancy between Partition[x, 3, 1] // Counts and the Prob[A|AA] in the table above, i think it is because table is based on the TransitionMatrix of estproc and estproc is based on one-step transitions (Partition[x,2,1]). – kglr Aug 8 '18 at 10:39 • So basically DiscreteMarkovProcess doesn't have a memory, because in second order the transition is remembering the two steps behind that's why it is AA,A and not for example A,A,A, interesting. – Wiliam Aug 8 '18 at 10:51 • @William, please see the update. – kglr Aug 8 '18 at 12:26 • thank you @kglr, it indeed works fine and is shorter yet if you change the variable in Partition[data, 3, 1] for example to Partition[data, 2, 1] or else, the final table will not come out appropriate. I think hector's answer is good because you can change the order – Wiliam Aug 8 '18 at 12:37 As a variant of my answer to the linked question, the following should work correctly and efficiently. Some random data to work with: x = RandomChoice[Alphabet["English", "IndexCharacters"], 1000000]; Creating the probability tensor P:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9736446463891303, "lm_q1q2_score": 0.8027329344690407, "lm_q2_score": 0.8244619199068831, "openwebmath_perplexity": 4115.875956951746, "openwebmath_score": 0.33302542567253113, "tags": null, "url": "https://mathematica.stackexchange.com/questions/179684/constructing-higher-order-transition-probability-matrix" }
machine-learning, classification, decision-trees, information-theory Title: Why we use information gain over accuracy as splitting criterion in decision tree? In decision tree classifier most of the algorithms use Information gain as spiting criterion. We select the feature with maximum information gain to split on. I think that using accuracy instead of information gain is simpler approach. Is there any scenario where accuracy doesn't work and information gain does? Can anyone explain what are the advantages of using Information gain over accuracy as splitting criterion? Decision trees are generally prone to over-fitting and accuracy doesn't generalize well to unseen data. One advantage of information gain is that -- due to the factor $-p*log(p)$ in the entropy definition -- leafs with a small number of instances are assigned less weight ($lim_{p \rightarrow 0^{+} } p*log(p) = 0$) and it favors dividing data into bigger but homogeneous groups. This approach is usually more stable and also chooses the most impactful features close to the root of the tree. EDIT: Accuracy is usually problematic with unbalanced data. Consider this toy example: Weather Wind Outcome Sunny Weak YES Sunny Weak YES Rainy Weak YES Cloudy Medium YES Rainy Medium NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO Rainy Strong NO
{ "domain": "datascience.stackexchange", "id": 1155, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, classification, decision-trees, information-theory", "url": null }
c, graphics, unix, x11 while (*s == '\t') *s++ = '\0'; if (*s != '\0' && *s != '\n') output = s; while (*s != '\0' && *s != '\n') s++; if (*s == '\n') *s = '\0'; item = allocitem(count, label, output); if (prevmenu == NULL) { /* there is no menu yet */ menu = allocmenu(NULL, item, level); rootmenu = menu; prevmenu = menu; count = 1; } else if (level < prevmenu->level) { /* item is continuation of previous menu*/ for (menu = prevmenu, i = level; menu != NULL && i < prevmenu->level; menu = menu->parent, i++) ; if (menu == NULL) errx(1, "reached NULL menu"); for (p = menu->list; p->next != NULL; p = p->next) ; p->next = item; prevmenu = menu; } else if (level == prevmenu->level) { for (p = prevmenu->list; p->next != NULL; p = p->next) ; p->next = item; } else if (level > prevmenu->level) { menu = allocmenu(prevmenu, item, level); for (p = prevmenu->list; p->next != NULL; p = p->next) ; p->submenu = menu; prevmenu = menu; } } } /* calculate screen geometry */ static void calcscreengeom(void) { Window w1, w2; /* unused variables */ int a, b; /* unused variables */ unsigned mask; /* unused variable */
{ "domain": "codereview.stackexchange", "id": 38237, "lm_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, graphics, unix, x11", "url": null }
machine-learning Title: Do data points mean Eigenfaces in higher dimensional space? I saw the following animation at making sense of PCA , which shows blue data points. I am reading a paper on Eigenfaces which says that: "a typical image of size 256 by 256 becomes a vector of dimension 65536 or equivalently a point in 65536 dimensional space" The paper is available at the following link: Eigenfaces for Recognition My question is that in the context of Eigenfaces is each blue point an image? Somebody please guide me. Zulfi. Each blue data point in the animated picture stands for an image of a face whose dimension is much higher in the context of Eigenfaces for Recognition. They are the original data points. It does NOT mean Eigenfaces. When the long swinging black solid rod becomes still under the "viscous friction" exerted by the red lines, its direction is the most significant eigenface in that context, which is defined as an eigenvector of the biggest eigenvalue of the covariance matrix of the face images. The projection of the blue points onto that long black rod viewed as vectors starting from the center of the blue points is the first principal component.
{ "domain": "cs.stackexchange", "id": 12543, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning", "url": null }
newtonian-mechanics, kinematics, orbital-motion, velocity, coordinate-systems Title: Radial component of velocity at extreme distances Suppose I am given that a planet's position with respect to some star is of the form $\textbf{r} = r\textbf{e}_{r}$. Then of course $\textbf{v} = \dot{r}\textbf{e}_{r} + r\dot{\theta}\textbf{e}_{\theta}$. Is it correct to say that, when the planet is at its closest and at its furthest from the star, the radial component of the velocity vector will always be zero, i.e. $\dot{r}=0$? In which case, the planet will still have some velocity purely in the $\textbf{e}_{\theta}$ direction? Yes, the radial component of the velocity vector $\dot{r}$ is 0, since the distance between the planet and the origin is simply $r$. Assuming the planet is not on a purely radial trajectory, i.e. $\dot{\theta}$ is not zero at any point, the planet will also have velocity purely in the $e_\theta$ direction at this point.
{ "domain": "physics.stackexchange", "id": 58314, "lm_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, kinematics, orbital-motion, velocity, coordinate-systems", "url": null }
electric-circuits, electrical-resistance, singularities, inductance, laplace-transform For the inductor on the upper right, note that I plugged in the value of $i(0^{-})$ that is, $3A$, as that was the current that was flowing through it when the switch was closed for a long time (as $\frac{12 V}{4\Omega}=3A$). The loop equation thus turns out to be: $$\frac{12}{s}-4I(s)-2sI(s)+6-sI(s)-4I(s)=0$$ $$\implies I(s)=\frac{12+6s}{8s+3s^2}$$ Which on Inverse Laplace transform gives me the actual loop current in time domain as $i(t)=\frac{3}{2}+\frac{1}{2}e^{-8t/3}$. Clearly, $i(0^{+}) = \lim_{t\to 0^{+}}i(t)=\frac{3}{2}+\frac{1}{2}=2$. Thus, $i(0^{+})$ is quite different from $i(0^{-})$, which is $3$ (in amperes). Can we logically explain the sudden jump in current when an active inductor is connected in series with an inactive inductor? Or, is my conclusion wrong? You have a current of $3$ A passing though the switch and no current through the lower resistor and inductor combination. The switch is opened and that current of $3$ A cannot change instantaneously through the top resistor and inductor combination and the current in the bottom resistor and inductor combination cannot change from zero instantaneously. The act of opening the switch means that the parasitic interwinding capacitance of the inductors becomes significant and that capacitor starts to charge up with the initial charging current being $3$ A. The capacitance of the windings of the inductor allows for “smooth” changes in the currents which flow in the circuit.
{ "domain": "physics.stackexchange", "id": 48327, "lm_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, electrical-resistance, singularities, inductance, laplace-transform", "url": null }
particle-physics, conventions, parity, mesons Title: Why does the parity of a meson have a "+1" in it? The parity of a meson is defined as $ P = (-1)^{L+1} $ where $L$ is the angular momentum. What does the "1" in the exponent represent? This answer will consider mesons, as requested in a comment. We need to consider both the intrinsic parity and the "regular" parity: $$ \pi_\text{total} = \pi_\text{intrinsic} \times\pi $$ Since a meson contains a quark and an antiquark, the intrinsic parity is $\pi_\text{intrinsic}=-1$. This is because particle and antiparticle have opposite intrinsic parities. Whether you assign the particle $+1$ or $-1$ does not matter since $(+1)(-1)=(-1)(+1)=-1$. As for the "regular" parity, we need to investigate the corresponding spherical harmonic of the wave function. This is $(-1)^L$. Now, together: $$ \pi = (-1) \times (-1)^L = (-1)^{L+1} $$ For more information, see Wikipedia.
{ "domain": "physics.stackexchange", "id": 60543, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "particle-physics, conventions, parity, mesons", "url": null }
Basecase: $n=1$ $1=\frac{1-x}{1-x}\Leftrightarrow 1=\frac{1}{1-x}-\frac{x}{1-x}\Leftrightarrow 1+\frac{x}{1-x}=\frac{1}{1-x}$ Let $a,b\in \mathbb{R_{>0}}$ and $0>b>1$ Then $\left[ a>ab \right]\Leftrightarrow \left[a<\frac{a}{b}\right]$. Thus $\left[ 0<x<1\right] \Rightarrow \left[ x<\frac{x}{1-x}\right]$ Thus $1+\frac{x}{1-x}=\frac{1}{1-x} \Rightarrow 1+x<\frac{1}{1-x} \square$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9711290963960278, "lm_q1q2_score": 0.8292595237854129, "lm_q2_score": 0.8539127566694178, "openwebmath_perplexity": 193.17166296660048, "openwebmath_score": 0.9749858379364014, "tags": null, "url": "https://math.stackexchange.com/questions/2078342/a-simpler-proof-of-1-xn-frac11nx" }
forces, pressure Title: Ping-pong ball pontoon Imagine a vertical pipe (both ends opened) in the water. Drop several ping-pong balls into pipe and cover them with a cylinder. When you have enough balls, the cylinder will float. Now start adding weight into the top of a cylinder, and simultaneously start adding ping-pong balls via the bottom of pipe, to compensate the increasing weight. At the some weight (and balls columns height) the topmost row of balls start crunching due the buoyancy pressure. In this question @mms answered than one ping-pong ball can withstand 3 atmosphere pressure. The question is: how to approximate the maximum height of ball column (or maximum weight is possible float) for the pipe radius R before the topmost row of balls start crunching? Or, maybe will start crunching not the topmost row, but somewhere else because the sum of buoyancy pressure (from the balls below) and water pressure will be more the 3 atm. How to determine? In order to avoid ambiguity: I'll define the crushing pressure of a layer balls operationally: take a flat*, rigid surface (optionally, you could corrugate it in the manner of a layer of dense-packed balls). collect a single layer of balls (arrange them as they would be in the cylinder) on the rigid surface. Place a flat slab on top of the balls. Add weight until the balls collapse. Take the net weight above the balls, divide by the area and obtain the crushing pressure. The top layer of balls will collapse when the weight added to the top of the cylinder produces the crushing pressure defined above. The logic is that: as long as the top layer of balls remains stationary at the surface of the water, the problem with the floating cylinder is exactly the same as for the fixed, rigid table.
{ "domain": "physics.stackexchange", "id": 4046, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "forces, pressure", "url": null }
hokuyo Title: Hokuyo URG-04LX-UG01 Measuring area I am tying to use the Hokuyo node to get scan data from the Hokuyo laser URG-04LX-UG01. When I visualized the laser scan in rviz, I only have a measuring area from -90° to 90°, and the measuring area of the laser should be 240°. So I tried to change the parameters min_angle and max_angle of the hokuyo node but the maximum measuring area that I get is from -120° to +90°. Do you have any idea why I can't get data between 90° and 120° ? Thanks for help, Caroline Originally posted by CarolineQ on ROS Answers with karma: 395 on 2013-03-24 Post score: 1 What are the values you are setting as min- and max-angle? And are you setting them through dynamic reconfigure or in the launch file? Please provide some more information and the console output of the hokuyo_node. Try setting them to some values slightly larger than the actual max-angles. Like -2.1 for min_angle and 2.1 for max_angle. If it is not too far off, the hokuyo_node should automatically set them to the maximum allowed values. (3 would be too much...) Originally posted by Ben_S with karma: 2510 on 2013-03-24 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by Gav on 2013-03-25: +1 to this. The default behavior of hokuyo_node is to have min and max angles which are smaller than your scanner's field of view. You can either change the launch file or change them via dynamic reconfigure at runtime. Comment by CarolineQ on 2013-03-25: I put the values you said and it works now. Thanks for help.
{ "domain": "robotics.stackexchange", "id": 13517, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "hokuyo", "url": null }
algorithms, np and the bijection is $a(1)=2,a(2)=3,a(3)=1$. The matrix $\mathbf{G}$ will be: $$\mathbf{G}=\begin{bmatrix} 3 & 2 & 1 \\ 7 & 1 & 4 \\ 9 & 5 & 7 \\ \end{bmatrix}.$$ Now, the constraint says that $\alpha\min\limits_{v}g_{vv}\geqslant\max\limits_{v\neq w}g_{vw}$. With the same example, if $\alpha=1$, the bijection $a$ does not satisfy the constraint since $\alpha\min\limits_{v}g_{vv}=1$ and there exists some $w\neq v$ such that $g_{vw}>1$. In summary, I would like to find a bijection between $V$ and $W$, $a:V\to W$, such that $$\alpha\min\limits_{v}g_{vv}\geqslant\max\limits_{v\neq w}g_{vw},$$ where $g_{vw}$ is defined previously. We consider three different cases: $\alpha < 1$, $\alpha = 1$, and $\alpha > 1$. Suppose first that $\alpha < 1$. Arrange the $n^2$ elements in the matrix in non-increasing order: $x_1,x_2,\ldots$. Note that $x_1,\ldots,x_n$ must belong to the diagonal, and moreover $\alpha x_n \geq x_{n+1}$. Hence the instance is solvable iff $\alpha x_n \geq x_{n+1}$ and $x_1,\ldots,x_n$ belong to different rows and columns.
{ "domain": "cs.stackexchange", "id": 6332, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, np", "url": null }
filters, filter-design, finite-impulse-response With $N \le 3$, a maxflat stopband minimizes stopband energy, but for $N > 3$ that is not generally true. Let's look at the $N = 3$ case. We use the weakest possible pass band specification $H(0) = 1$ to normalize the filter. We see from Eq. $\eqref{15347-3}$ that the frequency response is always flat at $\omega = 0$ and at $\omega = \pi$. We argue that $H(\pi) = 0$ because that is the only case for which we cannot bring the frequency response closer to zero everywhere in $0 < \omega \le \pi$ by "stretching" the response vertically by adjusting the coefficients in the response defined by Eq. $\eqref{15347-1}$. The operation does not affect the monotonicity or non-negativity of the frequency response and would reduce the pass band error for any cutoff frequency and any reasonable definition of pass band error, including least squares (that is, minimum stopband energy). It must then be that for the optimal filter, $H(\pi) = 0$. That's already two constraints in total, so we have only one more degree of freedom left to adjust. For easier analysis, we can convert Eq. $\eqref{15347-1}$, which is a sum of cosine terms, into a polynomial by a monotonicity preserving change of variables $\omega = \operatorname{acos}(x)$, giving a mapping from $\omega \in [0\ldots\pi]$ to $x \in [1\ldots-1]$ (note the change in direction), and by using the relation $T_i\left(\cos\left(\omega\right)\right) = \cos\left(i\omega\right)$, where $T_i$ is a Chebyshev polynomial of the first kind. Each term for $i>0$ is rewritten using:
{ "domain": "dsp.stackexchange", "id": 11775, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "filters, filter-design, finite-impulse-response", "url": null }
c++, beginner, homework Title: Output digits of a number This is a simple C++ program I had to write for class. It prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits. How do I improve this? For example: Input: 3456 Output: 3 4 5 6 Sum of all digits: 19 Input: 1234 Output: 1 2 3 4 Sum of all digits: 10 #include <iostream> #include <iomanip> using namespace std; int main() { int base; int first; int second; int third; int fourth; int sum; cout << " Please enter a whole number." << endl; cin >> base ; first = base / 1000; second = base / 100 % 10; third = base / 10 % 10; fourth = base % 10; sum = first + second + third + fourth; cout << first << " " << second << " " << third<< " " << fourth << " " << endl; cout << "Sum of the digits: " << sum << endl; return 0; } Please stop using using namespace std. Read this Consider using a std::vector to hold the digits of a number. Here it seems as though you can assume the user is inputting a number with four digits. But that might not always be the case. A vector is dynamic. This is...uh, well: first = base / 1000; second = base / 100 % 10; third = base / 10 % 10; fourth = base % 10; Consider using a while loop to get all digits of the number. while(number) { digits.push_back(number%10); number /= 10; } Note the digits will be in reverse. You can use std::reverse() to reverse the digits such that the first element in the vector is the first digit of the number. Use std::accumulate() to obtain the sum of all digits. You don't have to do this in the while loop. Here is everything together. Ideally, you would want to put the while loop and summing operation in another function. #include <iostream> #include <vector> #include <algorithm>
{ "domain": "codereview.stackexchange", "id": 15582, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, homework", "url": null }
grovers-algorithm, oracles In addition, after all this, you should actually find that everything has went backwards and the probabilities of 000, 001, and 010 have increased while the others have lowered. This is, unfortunately, an inherent quirk of Grover's Algorithm that is caused by there being more right than wrong answers: with more marked than unmarked, the mean will be negative and thus the inversion across the mean will increase the amplitude of the unmarked states instead. In practical cases, this is normally not a big deal since Grover's Algorithm is a search algorithm and if there are more correct answers than wrong answers one could simply guess and will be more than 50% likely to be right.
{ "domain": "quantumcomputing.stackexchange", "id": 3277, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "grovers-algorithm, oracles", "url": null }
varies over another length-$$2\pi$$ interval the monotinicity division details are different, but any choice requires at least one such cut, succumbs to the above technique, and gets the same answer. Let's check another example from $$t_1=-\pi/2$$ to $$t_1=3\pi/2$$, giving two pieces (meeting at $$t=\pi/2$$) where the $$\pm$$ are $$+-$$:$$\int_{-1}^1\frac{2dt_2}{\sqrt{1-t_2^2}}-\int_1^{-1}\frac{2dt_2}{\sqrt{1-t_2^2}}\color{red}{=4\int_{-1}^1\frac{dt_2}{\sqrt{1-t_2^2}}}\color{blue}{=\left(\int_{-\pi/2}^{\pi/2}+\int_{\pi/2}^{3\pi/2}\right)2dt_1}.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105273220726, "lm_q1q2_score": 0.870684502919323, "lm_q2_score": 0.8918110360927155, "openwebmath_perplexity": 378.31346148141955, "openwebmath_score": 0.854271411895752, "tags": null, "url": "https://math.stackexchange.com/questions/3994373/how-to-be-sure-about-any-parameterization" }
on the interval, x ∈ [a, b], and consider a uniform grid with ∆x = (b−a)/N,. A natural next step is to consider extensions of the methods for various variants of the one-dimensional wave equation to two-dimensional (2D) and three-dimensional (3D) versions of the wave equation. The first condition,. Crawford ∗Y. Solution of this equation, in a domain, requires the specification of certain conditions that the unknown function must satisfy at the boundary of the domain. I would be surprised that no analytical solution to the same problem with Dirichlet conditions does not exist, although I don't manage to. As the Neumann conditions are purely additive contributions to the right-hand side, they can contain any function of variables: time, coordinates, or parameter. This report considers only boundary conditions that apply to saturated ground-water systems. Heat flow with sources and nonhomogeneous boundary conditions We consider first the heat equation without sources and constant nonhomogeneous boundary conditions. Now let's consider a different boundary condition at the right end. Kiwne [1] used Neumann and Dirichlet boundary conditions to obtain the solution of Laplace equation. Neumann Boundary Conditions Robin Boundary Conditions Remarks At any given time, the average temperature in the bar is u(t) = 1 L Z L 0 u(x,t)dx. We are interested in solving the heat equation with mass being created at a random point chosed with distribution in Dand dissipated on the boundary in such a way that the total mass increases in time, leading to a super-critical regime. > In my case, I have a fixed bed of granular and there can be convection where is no granular, but no diffusion. Heat Equation Boundary Conditions Cartesian coordinates cylindrical coordinates spherical coordinates coefficient of thermal conductivity thermal diffusivity (x,y,z) (r,f,z) (r,f,q) Dirichlet Neumann Robin I III II classification of linearized boundary condtions: perfectly insulated surface (no flux thru the wall) constant surface temperature. The heat equation, the variable limits, the Robin boundary conditions, and the initial condition are defined as:. The stability condition (1. Generic solver of parabolic equations via finite difference schemes. Then the gene. As of now a small portion of possible inputs is implemented; one can change: - the mesh file
{ "domain": "auit.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9886682478041813, "lm_q1q2_score": 0.8128722891905571, "lm_q2_score": 0.8221891327004133, "openwebmath_perplexity": 666.6580393036137, "openwebmath_score": 0.8180767297744751, "tags": null, "url": "http://qxvy.auit.pw/2d-heat-equation-neumann-boundary-conditions.html" }
matlab, discrete-signals, signal-analysis, correlation Title: Tied rank adjustment for Spearman Correlation I have two 16 sample vectors, a and b as listed below: a = 345.86 349.83 257.84 438.43 195.03 0 341.39 0 0 0 0 0 0 0 0 0 b = 313.30 349.83 0 394.07 195.03 257.84 0 0 0 0 0 341.39 0 0 0 0 My aim is to calculate the Spearman correlation between the two vectors. I know that it can be done easily in MATLAB by using the function: corr(a,b,'Type','Spearman'); However, my aim is to calculate this step by step, i.e. Calculating the ranks of vectors a and b Applying the formula $C=1−\frac{6\Sigma(R_x−R_y)^2}{n(n^2−1)}$ Adjusting the tied ranks (most important part) Firstly, using the function corr(a,b,'Type','Spearman') I get the correlation coefficient as 0.5845. Now as to calculate the same step by step, I am using the tiedrank function to calculate the ranks for the vectors a and b. From The Mathworks documentation: [R,TIEADJ] = tiedrank(X) computes the ranks of the values in the vector X. If any X values are tied, tiedrank computes their average rank. The return value TIEADJ is an adjustment for ties required by the nonparametric tests signrank and ranksum, and for the computation of Spearman's rank correlation. Using this for the above example, I get the following: Rank_a = 14 15 12 16 11 5.5 13 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 Rank_b = 13 15 5.5 16 11 12 5.5 5.5 5.5 5.5 5.5 14 5.5 5.5 5.5 5.5 And the Tied Adjustments that I get: TIEDADJ_a = 495 TIEDADJ_b = 495
{ "domain": "dsp.stackexchange", "id": 4368, "lm_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, discrete-signals, signal-analysis, correlation", "url": null }