text
stringlengths
49
10.4k
source
dict
${a_n}$ for a sequence containing no zeroes Take the sequence of Natural numbers which do not contain the digit zero. 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12 ... Can we find an expression for ${a_n}$ ? • @JackV, I thought that too... but you skip numbers like 10, or 103 because they contain a 0. – TravisJ May 6 '15 at 1:04 • Yup ${a_{10}}$ = 11 not 10 – Adeetya May 6 '15 at 1:04 • @Adeetya Oh my apologies i misunderstood – JackV May 6 '15 at 1:05 • You could probably write something nasty involving $\log_{10}$, floor, etc. But why, when it's simpler to describe it in English? – aschepler May 6 '15 at 1:05 • Do you need this in some sort of code. What is the purpose. – Ilaya Raja S May 13 '15 at 18:58 There are $9^m$ members of $\{a_n\}$ with $m$ digits. After that, the $(m+1)$-digit members of $\{a_n\}$ follow the rule that $a_n = a_{\left(n-9^m\right)} + 10^m.$ And then the pattern repeats. • I have got the following expression for $a_n$ in the AoPS link artofproblemsolving.com/community/c6h474012p2654654 by user BISHAL_DEB #8 $$a_n=n +\sum_{i=1}^\infty 10^{i-1}\times[\frac{n-(9^i-1)/8}{9^i}]$$ where [] is the floor function I have no idea on how to prove this.can you throw some light on this.Thanks – Navin May 11 '17 at 21:27
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407137099625, "lm_q1q2_score": 0.8067569953761883, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 325.7316546968215, "openwebmath_score": 0.7884500622749329, "tags": null, "url": "https://math.stackexchange.com/questions/1269098/a-n-for-a-sequence-containing-no-zeroes" }
image-processing, python, image-segmentation rem = morphology.remove_small_holes(resth, 2) # entropy = filters.rank.entropy(resth, SE) # print(seg.shape) plt.figure(num='PProc') # 1 plt.subplot('335') plt.imshow(rem,cmap='gray') plt.title('rem') plt.axis('off') # 2 plt.subplot('336') plt.imshow(dilation,cmap='gray') plt.title('dilation') plt.axis('off') # 3 plt.subplot('337') plt.imshow(opening,cmap='gray') plt.title('opening') plt.axis('off') # 4 plt.subplot('338') plt.imshow(closing,cmap='gray') plt.title('closing') plt.axis('off') # 5 plt.subplot('332') plt.imshow(seg,cmap='gray') plt.title('segmented') plt.axis('off') # 6 plt.subplot('333') plt.imshow(resf,cmap='gray') plt.title('meijering') plt.axis('off') # 7 # 8 plt.subplot('334') plt.imshow(resth,cmap='gray') plt.title('threshold_otsu') plt.axis('off') # 9 plt.subplot('339') plt.imshow(erosion,cmap='gray') plt.title('erosion') plt.axis('off') # plt.show() The answer is down from the question on StackOverflow website, thanks for Paul Brodersen the credit of the answer is for him. #!/usr/bin/env python """ Determine areas in image of ring.
{ "domain": "dsp.stackexchange", "id": 8813, "lm_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, python, image-segmentation", "url": null }
Blue: Sine, Cosine, Sign, Cosine, Sine Cosine, Cosine, Co-Sign, Sine, Sine The first line encapsulates the sine formulas; the second, cosine. Just drop the angles in (in order $$\alpha, \beta, \alpha, \beta$$ in each line), and know that "Sign" means to use the same sign as in the compound argument ("+" for angle sum, "-" for angle difference), while "Co-Sign" means to use the opposite sign. Together, I think this makes a pretty good game plan for tackling trig. For a little more fun, see Antinous' awesome answer. Stan's answer will probably do a better job than mine; while running the risk of repeating information: memorize $\sin^2(x)$ $+$ $\cos^2(x)$ $=$ $1$, dividing through by $\cos^2(x)$ will yield the identity $\tan^2(x)$ + $1$ $=$ $\sec^2(x)$. Additionally, dividing through by $\sin^2(x)$ will yield $1 +$ $\cot^2(x)$ = $\csc^2(x)$. Furthermore, intuitively understanding the graphs of $\sin(x)$ and $\cos(x)$ will make life easier. Finally, going through the unit circle derivations of many trigonometric identities will prove useful in being able to "unstick" yourself should you get stuck. Edit: Of course, also knowing the basics: $\tan(x)$ $=$ $\frac{\sin(x)}{\cos(x)}$, $\csc(x)$ $=$ $\frac 1{sin(x)}$, $\sec(x)$ $=$ $\frac 1{cos(x)}$ is fundamental. A systematic way to implement what pbs wrote, is mentioned in the book A = B in section 1.5:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9621075722839015, "lm_q1q2_score": 0.8341816666410301, "lm_q2_score": 0.8670357563664174, "openwebmath_perplexity": 671.8585654117908, "openwebmath_score": 0.8596847653388977, "tags": null, "url": "https://math.stackexchange.com/questions/1352996/how-to-remember-trig-identities/1353577" }
cosmology, distance \end{equation} where $\Omega_m = 1$ because it's a single component universe (is that correct?): \begin{equation} d_A(z) = \frac{c}{H_0 (\frac{1}{2} 1(1+3\omega_m))^2} \frac{z(\frac{1}{2} 1(1+3\omega_m)) + (\frac{1}{2} 1(1+3\omega_m)-1)(\sqrt{2 \cdot \frac{1}{2} 1(1+3\omega_m)+1} -1)}{(1+z)^2} \end{equation} and then derive this according to $z$ and replace the derivative with zero to find the solution. However I am not sure this is the right idea, The derivative will get really ugly, and I don't understand how the $\omega>-1$ conditions is relevant... And I don't know how to use the equation of state for ma calculation...Could anyone help me ? In most general way, the equation can be written as \begin{equation} \frac{H^2(z)}{H_0^2} = \sum_i \Omega_{i,0}~\text{exp}({3\int_0^z\frac{1+w_{i}(z)}{1+z}dz}) + \Omega_{k,0}a^{-2} \end{equation} Let me call that fluid $g$ in this case you can write \begin{equation} \frac{H^2(z)}{H_0^2} = \Omega_{\rm g,0}~e^{3(1+w_{\rm g})ln(1+z)} \end{equation} \begin{equation} \frac{H^2(z)}{H_0^2} = \Omega_{\rm g,0}~(1+z)^{3(1+w_{\rm g})}
{ "domain": "physics.stackexchange", "id": 73772, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, distance", "url": null }
That we would like to rotate to lie on the x-axis: $\vec{v}_\text{rot} = \begin{pmatrix} |\vec{v}| \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}$ then our axis and angle of rotation are: $\vec{k} = \dfrac{\vec{v}\times\vec{v}_\text{rot}}{|\vec{v}\times\vec{v}_\text{rot}|} = \begin{pmatrix} 0 \\ \sqrt{2}/2 \\ \sqrt{2}/2 \end{pmatrix}\>\>\>\>, \>\>\theta = \cos^{-1}\left( \dfrac{\vec{v}\cdot\vec{v}_\text{rot}}{|\vec{v}||\vec{v}_\text{rot}|}\right) = 0.95532 \text{rad}$ The "vector notation" statement above does indeed give the expected answer (I've implemented it in Python with NumPy): import numpy as np v = np.array([1/3, 1/3, 1/3])**(1/2) vr_desired = np.array([1, 0, 0]) theta = np.arccos(np.dot(v, vr_desired) / np.linalg.norm(v)*np.linalg.norm(vr_desired)) k = np.cross(v, vr_desired) / np.linalg.norm(np.cross(v, vr_desired))
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9511422241476944, "lm_q1q2_score": 0.8140361582201813, "lm_q2_score": 0.8558511414521923, "openwebmath_perplexity": 1301.6684959750332, "openwebmath_score": 0.6865902543067932, "tags": null, "url": "https://math.stackexchange.com/questions/2828802/angle-definition-confusion-in-rodrigues-rotation-matrix" }
energy Title: Difference between solar consumption and production in BP Review of World Energy The BP Statistical Review of World Energy provides a lot of interesting data. Personally, I was interested in plotting the energy consumption by source as a function of time for different sources similar to: . Looking into the BP report, there is for example Solar Consumption in EJ and also Solar Generation in TWh, respectively for each year. I seem to miss something fundamentally here, but why is the first larger than the latter? As an example, take the Solar Consumption in EJ from 2021, which is for the total world 9.73 EJ. This calculates to $$\frac{9.73\cdot10^{18}\,\mathrm{Ws}}{3600\cdot1000} \approx 2701\,\mathrm{TWh}. $$ Looking again at the table, the Solar Generation in TWh for 2021 for the total world is 1032.5 TWh, so more than a factor of 2 lower. For me, it would make more sense if it would be the other way. So, obviously, I am missing something fundamental here. Any ideas? From the first paragraph of the Methodology section: Primary energy Traditionally, in bp’s Statistical Review of World Energy, the primary energy of non-fossil based electricity (nuclear, hydro, wind, solar, geothermal, biomass in power and other renewables sources) has been calculated on an ‘input-equivalent’ basis – i.e. based on the equivalent amount of fossil fuel input required to generate that amount of electricity in a standard thermal power plant. For example, if nuclear power output for a country was 100 TWh, and the efficiency of a standard thermal power plant was 38%, the input- equivalent primary energy would be 100/0.38 = 263 TWh or about 0.95 EJ.
{ "domain": "earthscience.stackexchange", "id": 2658, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "energy", "url": null }
pixelFormat The first paramter of the set method defines the pixel format. The two most important are OSG_RGB_PF and OSG_RGBA_PF. If you are using RGB pixel format, you need to provide three components for each pixel, so in our example we have four pixels from black to white each consisting of three values for the color channels Red, Green and Blue. RGBA adds a fourth component Alpha" which defines the opacity of the pixel. A value of zero is a fully transparent (i.e. invisible) pixel where as 255 is not transparent at all. width, height, depth These parameters define the size of the image. The image class is capable to store 1D, 2D as well as 3D images. The dimensions you do not need should be set to one (not zero!). That is, a 1D image should have the width of your choice and height and depth set to one. mipmapCount If you do not know what mipmapping actually is, then leave this paramter as it is! ;) If you want to know more about mipmapping, have a look at http://www.sgi.com/software/opengl/advanced98/notes/node35.html. frameCount, frameDelay These parameters are used for animated textures. The frameCount defines how much images will be used and the delay says where to start. A setting of 0.0 here means of course to start from the beginning. data This one is carrying the actual data. Please notice that you have to pay special attention to this: The number of arguments you pass here must be exact. You will need width*height*depth*frameCount*{3,4} values. The last digit have to be three in RGB and four in RGBA mode. If this number is not exact, your application will crash or at least it will do something different as you want. The data is stored row after row beginning at the bottom left corner, just like OpenGL! The following figure illustrates this: "The direction in which the pixels are stored in memory" You need to remember this, whenever you provide the image data "by hand", if you do not your image is displayed mirrored. Tutorial - Using textures
{ "domain": "opensg.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.960951703918909, "lm_q1q2_score": 0.8007846957492477, "lm_q2_score": 0.8333246015211008, "openwebmath_perplexity": 1165.5234625527432, "openwebmath_score": 0.3680899441242218, "tags": null, "url": "http://opensg.org/wiki/Tutorial/OpenSG2/Basics" }
javascript, game, node.js, playing-cards Results in console: Player A added to the game Player B added to the game Player C added to the game Game reset ========== STARTING GAME ========== Player A gets card : As & 4c Player B gets card : Th & 2s Player C gets card : 5c & 7s Player A is the dealer Player B pays small blind : 1000 Player C pays big blind : 2000 Now its player A's turn ========== Round DEAL ========== Player A CALL : 2000 cannot begin next round Player B CALL : 1000 cannot begin next round Player C Raises : 2000 cannot begin next round Player A Raises : 4000 cannot begin next round Player B FOLD cannot begin next round Player C CALL : 2000 begin next round Total Pot : 14000 ========== Round FLOP ========== Community cards : Ad, Qh, 6h Player A CHECK cannot begin next round Player C Raises : 1000 cannot begin next round Player A CALL : 1000 begin next round Total Pot : 16000 ========== Round TURN ========== Community cards : Ad, Qh, 6h, 3d Player C CHECK cannot begin next round Player A Raises : 3000 cannot begin next round Player C CALL : 3000 begin next round Total Pot : 22000 ========== Round RIVER ========== Community cards : Ad, Qh, 6h, 3d, 8d Player A CHECK cannot begin next round Player C CHECK begin next round Total Pot : 22000 ========== SHOWDOWN ========== Community cards : Ad, Qh, 6h, 3d, 8d Player A : As, 4c | strength : 10972 | one pair Player B : Th, 2s | strength : 5165 | high card Player C : 5c, 7s | strength : 5124 | high card Player A wins with one pair game.js module.exports = Game;
{ "domain": "codereview.stackexchange", "id": 10998, "lm_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, game, node.js, playing-cards", "url": null }
electrical-resistance, si-units The product of two or more units may be indicated in either of the following ways: $\mathrm{N\cdot m}$ $\quad$ or $\quad$ $\mathrm{N\,m}$ The formally correct way to typeset this is using a thin space between the two unit names, $\rho \sim 0.8 \: \mathrm{m\Omega\,cm}$ though this can be traded for a centered dot if desired: $\rho \sim 0.8 \: \mathrm{m\Omega \cdot cm}$ The indication of a multiplication using a hyphen is generally clear enough, particularly for units that see a lot of everyday usage in a given field, but it is still strongly discouraged by the usual style rules. Journal typesetting tends to be good, but it need not be perfect; just because it's in a published paper doesn't mean it is right.
{ "domain": "physics.stackexchange", "id": 46426, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrical-resistance, si-units", "url": null }
### Question 3.37 What is the Galois group of $$x^7 - 1$$ over the rationals? ### Question 3.38 What is the Galois group of the polynomial $$x^n - 1$$ over $${\mathbb{Q}}$$? ### Question 3.39 Describe the Galois theory of cyclotomic extensions. ### Question 3.40 What is the maximal real field in a cyclotomic extension $${\mathbb{Q}}(\zeta_n)/{\mathbb{Q}}$$? ### Question 3.41 Compute the Galois group of $$p(x) = x^7 - 3$$. ### Question 3.42 What Galois stuff can you say about $$x^{2n} - 2$$? ### Question 3.43 What are the cyclic extensions of (prime) order $$p$$? ### Question 3.44 Can you give me a polynomial whose Galois group is $${\mathbb{Z}}/3{\mathbb{Z}}$$? ### Question 3.45 Which groups of order 4 can be realised as a Galois group over $${\mathbb{Q}}$$? ### Question 3.46 Give a polynomial with $$S_3$$ as its Galois group. ### Question 3.47 Give an example of a cubic with Galois group $$S_3$$. ### Question 3.48 How do you construct a polynomial over $${\mathbb{Q}}$$ whose Galois group is $$S_n$$? Do it for $$n = 7$$ in particular. ### Question 3.49 What’s a Galois group that’s not $$S_n$$ or $$A_n$$? ### Question 3.50 Which finite groups are Galois groups for some field extension? ### Question 3.51 What Galois group would you expect a cubic to have? ### Question 3.52 Draw the subgroup lattice for $$S_3$$. ### Question 3.53
{ "domain": "dzackgarza.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9908743636887527, "lm_q1q2_score": 0.8030827774478073, "lm_q2_score": 0.8104789132480439, "openwebmath_perplexity": 362.4303021135475, "openwebmath_score": 0.9997151494026184, "tags": null, "url": "https://quals.dzackgarza.com/10_Algebra/TexDocs/QualAlgebra_stripped.html" }
quantum-mechanics, operators, commutator Title: Commutator with exponential $[A, \exp(B)]$ How can I tell if $A$ and $\exp(B)$ commute? For $[A, B]$ it's simply $AB-BA$ and for $[\exp(A), \exp(B)]$ I think it'd be $\exp(A)\exp(B) - \exp(B)\exp(A) = \exp(A+B) - \exp(B+A) = 0$. Update: it's not generally true. Is there a 'simple' way to find $[A, \exp(B)]$? Or is this one of those problems where, if you encounter them at all, you are probably doing something wrong? The example I am encountering is $[\vec{S}, \exp(S_z)]$). If OP wants to evaluate $[A,e^B]$ in terms of $[A,B]$, there is a formula $$\tag{1} [A,e^B] ~=~\int_0^1 \! ds~ e^{(1-s)B} [A,B] e^{sB}. $$ Proof of eq.(1): The identity (1) follows by setting $t=1$ in the following identity $$\tag{2} e^{-tB} [A,e^{tB}] ~=~ \int_0^t\!ds~e^{-sB}[A,B]e^{sB} .$$ To prove equation (2), first note that (2) is trivially true for $t=0$. Secondly, note that a differentiation wrt. $t$ on both sides of (2) produces the same expression $$\tag{3} e^{-tB}[A,B]e^{tB},$$ where we use the fact that $$\tag{4}\frac{d}{dt}e^{tB}~=~Be^{tB}~=~e^{tB}B.$$
{ "domain": "physics.stackexchange", "id": 6154, "lm_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, operators, commutator", "url": null }
quantum-field-theory, s-matrix-theory, poincare-symmetry, lorentz-symmetry From (3), it immediately entails: $$ \langle \Phi_{\{\Lambda q_i\}}|S\Phi_{\{\Lambda p_i\}}\rangle = \langle \Phi_{\{q_i\}}|S\Phi_{\{p_i\}}\rangle\:.\qquad(4)$$ If $U_\Lambda$ is the unitary representation of $O(3,1)\uparrow$ on free states, so that $\Phi_{\{\Lambda p_i\}}= U_\Lambda \Phi_{\{p_i\}}$, we therefore have: $$\langle U_\Lambda \Phi_{\{ q_i\}}|S U_\Lambda\Phi_{\{p_i\}}\rangle = \langle \Phi_{\{q_i\}}|S\Phi_{\{p_i\}}\rangle\:,$$ that is $$\langle \Phi_{\{ q_i\}}|U^\dagger_\Lambda S U_\Lambda\Phi_{\{p_i\}}\rangle = \langle \Phi_{\{q_i\}}|S\Phi_{\{p_i\}}\rangle\:,$$ and so: $$\langle \Phi_{\{ q_i\}}| \left( U^\dagger_\Lambda S U_\Lambda - S\right) \Phi_{\{p_i\}}\rangle = 0\:,$$ Since the set of vectors $\Phi_{\{p_i\}}$ forms a basis of the Hilbert space (of the free theory) in view of the asymptotic completeness hypotheses, we conclude that: $$U^\dagger_\Lambda S U_\Lambda - S=0$$ i.e.
{ "domain": "physics.stackexchange", "id": 13257, "lm_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, s-matrix-theory, poincare-symmetry, lorentz-symmetry", "url": null }
Proof : We begin by showing that if $$f$$ is bounded on $$V$$ then both quantities are finite. Let $$|f(t)| on $$V$$ : then $$\sup_{t,s \in V}|f(t)-f(s)| < 2M$$ therefore $$Osc(f,(x,y)) < 2M$$. On the other hand, let $$(x_n,y_n) \to (x,y)$$ with $$f(x_n,y_n)$$ convergent to a point $$L$$. By definition, there exists $$N$$ such that $$n>N$$ implies $$(x_n,y_n) \in V$$ , which implies that $$|f(x_n,y_n)| < M$$. Consequently, $$|L| and $$\inf S_{(x,y)}- \sup S_{(x,y)} < 2M$$. Finiteness of both quantities are proved. Note that $$f$$ being continuous at $$(x,y)$$ is equivalent to both $$Osc(f,(x,y))=0$$ and $$S_{(x,y)} = \{f(x,y)\}$$ by the sequential definition of continuity. In this case the equality is obvious. Therefore, we will now assume that both are positive finite quantities and prove that both are greater than or equal to the other. We will first assume that $$\sup S_{(x,y)} = X$$ and $$\inf S_{(x,y)} = Y$$. Let $$X-Y>\epsilon>0$$ be arbitrary. There exist $$X',Y' \in S_{(x,y)}$$ with $$X-X'<\frac \epsilon 4, Y'-Y< \frac\epsilon 4$$. In particular, by the triangle inequality, $$|X'-Y'| > X-Y - \frac \epsilon 2$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357567351325, "lm_q1q2_score": 0.8241774134811237, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 86.49996366766179, "openwebmath_score": 0.9839914441108704, "tags": null, "url": "https://math.stackexchange.com/questions/4399723/oscillation-of-the-function-at-each-point/4407333#4407333" }
computability, turing-machines The fact that $P$ is decidable means there is a total computable map $valid : \mathbb{N} \to \{0,1\}$ such that $valid(n) = 1 \iff n \in P$. Informally, we are saying that it is possible to tell whether a given string is a valid piece of code. The function $ev$ is essentially an interpreter for our language: $ev(m,n)$ runs code $m$ on input $n$ – the result may be undefined. We can now introduce some terminology: A language is total if $n \mapsto ev(m,n)$ is a total function for all $m \in P$. A language $L_1 = (P_1, ev_1)$ interprets language $L_2 = (P_2, ev_2)$ if there exists $u \in P_1$ such that $ev_1(u, \langle n, m \rangle) \simeq ev_2(n, m)$ for all $n \in P_2$ and $m \in \mathbb{N}$. Here $u$ is the simulator for $L_2$ implemented in $L_1$. It is also known as the universal program for $L_2$. Other definitions of "$L_1$ interprets $L_2$" are possible, but let me not get into this now. We say that $L_1$ and $L_2$ are equivalent if they interpret each other. There is "the most powerful" language $T = (\mathbb{N}, \varphi)$ of Turing machines (which you refer to as "a Turing machine") in which $n \in \mathbb{N}$ is an encoding of a Turing machine and $\varphi(n,m)$ is the partial computable function that "runs the Turing machine encoded by $n$ on input $m$". This language can interpret all other languages, obviously since we required $ev$ to be computable. Our definition of programming languages is very relaxed. For the following to go through, let us require three more conditions:
{ "domain": "cstheory.stackexchange", "id": 2733, "lm_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", "url": null }
homework-and-exercises, electromagnetism, vector-fields $\nabla_T\times H_T = j\mu\epsilon E_z \hat{z} (3)$ $\nabla_T\times \hat{z}H_z + \hat{z} \frac{\partial H_T}{\partial z} = j\mu\epsilon E_T (4)$ Aplying $ \hat{z} \times \frac{\partial}{\partial z} $ to (2) and multiplying (4) by $-j\mu\omega$ then adding up them and canceling $H_T$ :
{ "domain": "physics.stackexchange", "id": 19524, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, electromagnetism, vector-fields", "url": null }
want to go through their proves then click particular property also called an adjugate matrix are going to solution... This website uses cookies to ensure you get the best experience questions 1 we are going see! Is the submatrix of a obtained from a by removing the i-th row and column... See solution of question 1 based on the topic ad-joint of matrix regarding adjoint matrix! For each element of the matrix replacing each element of the matrix obtained replacing. We strongly recommend you to refer below as a prerequisite of this important properties regarding adjoint matrix! Matrices > matrix Types > adjoint matrix Cofactor matrix … Algebra > Linear Algebra Linear. We have to follow the procedure a ) calculate Minor for each element by its Cofactor i-th row and column... Of question 1 based on the topic ad-joint of matrix we have to adjoint of a matrix the procedure a ) calculate for. Called an adjugate matrix matrices as adjoint is only valid for square matrices as is! Have to follow the procedure a ) calculate Minor for each element by its Cofactor Form matrix... Uses cookies to ensure you get the best experience these properties are valid! Transpose of the matrix the i-th row and j-th column is dedicated to some important regarding!
{ "domain": "republikbola.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.952574129515172, "lm_q1q2_score": 0.8170877007415694, "lm_q2_score": 0.8577680995361899, "openwebmath_perplexity": 674.7701928113153, "openwebmath_score": 0.5679025650024414, "tags": null, "url": "http://republikbola.net/o6ckna/e55c2a-adjoint-of-a-matrix" }
beginner, php, security, authentication, codeigniter $this->session->set_flashdata("login_failure_activation", "Your account has not been activated yet."); redirect('login'); } } else { // If we do NOT find a user $this->session->set_flashdata("login_failure_incorrect", "Incorrect email or password."); redirect('login'); } } else { $this->index(); } }
{ "domain": "codereview.stackexchange", "id": 35806, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, php, security, authentication, codeigniter", "url": null }
ros Title: P2OS Debian Release: Travis Build Failing Still having issues with this whole packaging for release thing... rosdistro: DEBUG: Load package.xml file from url "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_driver1.0.0/package.xml" rosdistro: DEBUG: - failed (HTTP Error 404: Not Found), trying "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_driver1.0.0/package.xml" rosdistro: DEBUG: Could not shallow clone repository "https://github.com/ros-gbp/p2os-release.git" rosdistro: DEBUG: Load package.xml file from url "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_launch1.0.0/package.xml" rosdistro: DEBUG: - failed (HTTP Error 404: Not Found), trying "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_launch1.0.0/package.xml" rosdistro: DEBUG: Could not shallow clone repository "https://github.com/ros-gbp/p2os-release.git" rosdistro: DEBUG: Load package.xml file from url "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_teleop1.0.0/package.xml" rosdistro: DEBUG: - failed (HTTP Error 404: Not Found), trying "https://raw.github.com/ros-gbp/p2os-release/release/groovy/p2os_teleop1.0.0/package.xml"
{ "domain": "robotics.stackexchange", "id": 14624, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
organic-chemistry Title: Why are enthalpy of combustion and molar mass of organic compounds proportional? I noticed that when you graph heat of combustion against molar mass, you get a completely straight line with a correlation of 1. I know that the longer the chain is, the stronger the LDF get, so it is expected to see an increase in heat of combustion if molar mass increases. Though, I don't know why the curve is completely straight. You can see heat of combustion against molar mass of alkanes in the graph below. Data source: Organic Compounds: Physical and Thermochemical Data The biggest contributor to the heat of combustion is the difference in covalent bond energy of reactants and products. The intermolecular forces that have to be overcome for combustion of liquids (with products all gases) are an order of magnitude lower (adapted from https://chemistry.stackexchange.com/a/125013): $$ \begin{array}{lrr} \hline n\text{-Alkane} & T_\mathrm{b}/\pu{K} & \Delta_\mathrm{vap}H(T_\mathrm{b})/\pu{J mol-1}\\\hline \text{Methane} & 112 & 8176\\ \text{Ethane} & 184 & 14640\\ \text{Propane} & 231 & 18832\\ n\text{-Butane} & 273 & 22390\\ n\text{-Pentane} & 309 & 26352\\ n\text{-Hexane} & 342 & 28850\\ n\text{-Heptane} & 372 & 31800\\ n\text{-Octane} & 399 & 33972\\ n\text{-Nonane} & 424 & 36910\\ n\text{-Decane} & 447 & 38750\\ \hline \end{array} $$ [OP] I know that the longer the chain is, the stronger the LDF get, so it is expected to see an increase in heat of combustion if molar mass increases.
{ "domain": "chemistry.stackexchange", "id": 15332, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry", "url": null }
$$a + bx + cx^2 + dx^3 + \ldots \equiv a + bx + cx^2 \pmod{x^3}$$ For multivariate polynomial rings, you need the idea of a Gröbner basis to do similar things. As a general principle, univariate polynomial rings over fields (especially finite fields) are extremely similar to the integers in terms of their algebraic properties; most notions you have about one sort can be translated to the other. Possibly interestingly, another interpretation is available here. We can view elements of $\mathbb{R}[x] / (x^3)$ as second-order approximations to real power series (whether you mean formal power series, or the notion of convergent power series from calculus). So, we can view its elements as analytic functions, where we allow ourselves to have errors in the third order. This is sometimes rather useful. I've seen some calculations greatly simplified in $\mathbb{R}[x] / (x^2)$ by rewriting $$1 + a x \equiv \exp(ax) \pmod{x^2}$$ and other similar sorts of things, although I don't recall any examples at the moment. - You would imagine $\mathbb{R}[x]/(x^3)$ as an unitary ring generated by $y$ with a single defining relation $y^3=0$. - Hint $\$ Because one can divide with unique remainder by any monic polynomial $\rm\,f,\,$ the coset $\rm\: g +(f) \in R[x]/(f)\:$ may be uniquely represented by its least degree element, the remainder $\rm\:g\ mod\ f\, =\, g - hf.\:$ Therefore the polynomials of degree $\rm < deg\, f\,$ form a complete system of representatives of $\rm\,R[x]/(f).\,$ Thus we can represent the ring by these normal forms, and pullback the ring operations to the normal form reps (transport of structure), e.g. $\rm\: g * h := gh\ mod\ f.\:$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9678992951349231, "lm_q1q2_score": 0.8127779173518483, "lm_q2_score": 0.83973396967765, "openwebmath_perplexity": 256.0856581673186, "openwebmath_score": 0.8432583212852478, "tags": null, "url": "http://math.stackexchange.com/questions/313927/understanding-the-quotient-ring-mathbbrx-x3" }
There are many strategies to tackle these problems, and it is probably best to try the second approach first. AM-GM is a nice trick that often works. It is really important, however, that the fact that the iterated limit, for an $m\in\mathbb{R}$ $$\lim_{x\to0}\lim_{y\to mx}f(x,y)=L,$$ does not imply the limit exists. For example, the limit of $f(x,y)=\frac{x^2y}{x^4+y^2}$ as $(x,y)\to(0,0)$ exists along every straight line approaching the origin but not along the parabola $y=x^2$. You might consider a slightly more general case: Claim. Let $\displaystyle f(x) = \frac{p(x)}{|x|^{r}}$ be an application of $\mathbb{R}^{n}$ to $\mathbb{R}$ (i.e, $x = (x_{1},...,x_{n}$)), with $p(x)$ a monomial in $m$ variables ($n\geq m$) such $\deg (p(x)) > r$. Then $$\lim_{x\to 0}f(x) = 0.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9783846621952494, "lm_q1q2_score": 0.8276571095627168, "lm_q2_score": 0.8459424411924673, "openwebmath_perplexity": 97.17956637989883, "openwebmath_score": 0.9740707278251648, "tags": null, "url": "https://math.stackexchange.com/questions/2798234/continuity-of-a-multivariable-function2" }
# Total Population Divided By Life Expectancy I've a general question: Can you take the population of the U.S. and divide it by average life expectancy (both female and male) in the U.S. to get the average number of deaths per year? The number I get is too high, and yet it seems this basic division should give me a closer result. Thanks! Addition: This is from the Columbia Common Core class Frontiers of Science http://ccnmtl.columbia.edu/projects/mmt/frontiers/web/index2.html [14:] I frequently use envelope backs to debunk, or place in perspective, sensationalized news stories. For example, every few years the media gets excited about "killer sharks." By the beginning of fall term a few years ago, despite weeks of headline coverage concerning the "shark menace," precisely two people had died in the US from shark bites. What fraction is that, you might ask yourself, of all the people who have died during the year? The answer can be easily determined as follows: [15:] There are about $300$ million ($3 \times 10^8$) people in the US, and the average life expectancy in this country is about $75$ years (averaging men and women -- note that average life expectancy is just what we want here because it tells us how long the average person lives). This means that: [16:] $3.0 \times 10^8 \text{ people} / 75 \text{ years} = 4.0 \times 10^6$ people die each year.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.978712649448364, "lm_q1q2_score": 0.8218582504441218, "lm_q2_score": 0.8397339616560072, "openwebmath_perplexity": 862.531590711716, "openwebmath_score": 0.5586103200912476, "tags": null, "url": "https://math.stackexchange.com/questions/2221017/total-population-divided-by-life-expectancy" }
# Laurent Series of $~\tan(z)~$ expanded in $\frac{\pi}{2} < |z| < \frac{3\pi}{2}~$? As we know, we can get Laurent series of $$~\tan(z)~$$ expanded in $$~0 \le |z| \lt \frac{\pi}{2}~$$ by dividing Taylor series expansion of $$~\sin(z)~$$ by Taylor series expansion of $$~\cos(z)~$$, and we'll get $$\tan(z) = \frac{\sin(z)}{\cos(z)} = \frac{z-\frac{z^3}{3!}+\frac{z^5}{5!}+\dots}{1-\frac{z^2}{2!}+\frac{z^4}{4!}+\dots} = z+\frac{z^3}{3}+\frac{2z^5}{15}+\dots$$ Now I am curious about the Laurent series of $$~\tan(z)~$$ expanded in $$~\frac{\pi}{2}~< |z| < \frac{3\pi}{2}$$. Since Taylor series of $$~\sin(z)~$$ and $$~\cos(z)~$$ is valid everywhere on the complex plane, I originally think the answer will be the same as above. But one exercise on Brown&Churchill's Complex variables and applications states that value of the integral $$\oint\limits_C \tan(z)\,dz = -4\pi i$$ where path $$~C~$$ is the positively oriented circle $$~|z| = 2~$$, which lies in the domain $$~\frac{\pi}{2}~ < |z| < \frac{3\pi}{2}~$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018383629826, "lm_q1q2_score": 0.8209499187808371, "lm_q2_score": 0.8418256472515683, "openwebmath_perplexity": 113.97985668645723, "openwebmath_score": 0.956649899482727, "tags": null, "url": "https://math.stackexchange.com/questions/3290088/laurent-series-of-tanz-expanded-in-frac-pi2-z-frac3-pi2" }
(cos), tangent (tan), cosecant (csc), secant (sec), and cotangent (cot). The distance from the foot of the tree to the point where the top touches the ground is 5 m. Now, let us have a look at the concepts discussed in this chapter. The maximum absolute value of cosine is 1. Maths Important Questions Class 12 are given below. Their reciprocals are respectively the cosecant, the secant, and the cotangent, which are less used in modern mathematics. It is also possible to find the trigonometric ratios of negative angles, multiple and sub multiple of an angle or compound angles. Formulas of Multiple Angles in Trigonometric Functions sin(2x) = 2 sin x cos x sin(3x) = 3 sin x - 4 sin 3 x = sin x ( - 1 + 4 cos 2 x ) sin(4x) = cos x ( 4 sin x - 8 sin 3 x ) = sin x ( - 4 cos x + 8 cos 3 x ). In the accompanying diagram of right. The minimum value of 3tan 2 q +12 cot 2 q is (a) 6. A new feature ‘Multiple Choice Questions’ has been added in every chapter of ML Aggarwal Solutions Class 9 Maths Chapter 17 Trigonometric Ratios Pdf. org < > < Browse by: Teacher | Date | Popularity | Language. Find the value of y. Compare and apply single and multiple transformations. Review of Algebra. recruitmentresult. the aim of this booklet is to give a sense of the kinds of questions examinees will face and their level of difficulty. Notice: Undefined index: HTTP_REFERER in /home/zaiwae2kt6q5/public_html/i0kab/3ok9. Powerpoint with multiple choice questions testing students' knowledge of trigonometric ratios (click image to download file): Skip to content. org < > < Browse by: Teacher | Date | Popularity | Language. Law of Cosines. Solving for an angle in a right triangle using the trigonometric ratios. Choose your answers to the questions and click 'Next' to see the next set of questions. Their reciprocals are respectively the cosecant, the secant, and the cotangent, which are less used in modern mathematics.
{ "domain": "casaralli-allevamento.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232909876816, "lm_q1q2_score": 0.8211326754760375, "lm_q2_score": 0.8354835330070839, "openwebmath_perplexity": 1886.9795827056453, "openwebmath_score": 0.4650905430316925, "tags": null, "url": "http://casaralli-allevamento.it/qcnj/multiple-choice-questions-on-trigonometric-ratios.html" }
homework-and-exercises, newtonian-mechanics, forces, classical-mechanics Title: Pulley getting pulled I cannot seem to figure out the mistake in my work when attempting to solve this problem. I have drawn out the force vectors in this image Now, based on intuition, I know that the block on top will move faster than the block on the bottom, which will force the pulley to move a bit faster (kinda slipping across the rope) than it would be moving normally (with respect to the heavier block). Thus I generated this equation: $a_{n}=a_{m}+a_{2m}$ Now, the acceleration of the lower block can be found by: $3mg-2mg=2m*a_{2m}$ $\frac{g}{2}=a_{2m}$ We can find the acceleration of the upper block through another set of equations. $3mg-mg=m*a_{m}$ $2g=a_{m}$ Thus the net acceleration should be equal to: $a_{n}=\frac{g}{2}+2g=\frac{5g}{2}$ However, this isn't even an answer choice. Can someone provide some sort of hint that can aid me in solving the problem? Thanks! Here are some hints: If the pulley is moving with acceleration a, neither block is moving with this acceleration. If the m block is moving with acceleration $\delta$ relative to the pulley, the 2m block is moving with acceleration -$\delta$ relative to the pulley. So the m block has absolute acceleration $a+\delta$ and the 2m block has acceleration $a-\delta$. The normal force from table on the 2m block is not 2mg.
{ "domain": "physics.stackexchange", "id": 59394, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, forces, classical-mechanics", "url": null }
c++, performance, random, console, boost } catch(...) { std::cerr << "error: exception of unknown type!\n"; return returnID::other_err; } } Further suggestions If we are testing prefix and suffix, we stringify the value for both tests - perhaps we can do that only once? Does a non-zero precision make any sense if any of the truncation options are in force? Could you fix boost::program_options so that it rejects negative arguments to options taking unsigned types? Then we get a better error message when we use unsigned long long for number and unsigned int for precision, as we really would like to. Perhaps some validation of prefix, suffix and contains, rather than accepting any string value? Additional statistics - sample and population standard deviations could be interesting tests. You will want to take particular care to keep numeric precision - a good introduction is Tony Finch's introduction to Incremental calculation of weighted mean and variance (you don't need to read all the way through to pick up the essential points - and section 3 provides insight into improving the accuracy of calculating the mean; that's useful even without implementing the variance or deviation calculations).
{ "domain": "codereview.stackexchange", "id": 27096, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, performance, random, console, boost", "url": null }
## Double integral on a compact subset Calculate: $$\int \int _D \left(6x+2y^2 \right) dxdy$$ where D is a compact subset of $\mathbb{R}^2$ enclosed by a parabola $y=x^2$ and a line $x+y=2$. How to find that, how to find the limits of integration in this case? I think then i will manage to calculate the whole integral. I think the area is the … Read more ## What is the expansion in power series of {x \over \sin x}{x \over \sin x} How can I expand in power series the following function: {x \over \sin x} ? I know that: \sin x = x – {x^3 \over 3!} + {x^5 \over 5!} – \ldots, but a direct substitution does not give me a hint about how to continue. Answer A simple way is to manipulate the generating … Read more
{ "domain": "mathzsolution.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9854964198826467, "lm_q1q2_score": 0.8169162216555587, "lm_q2_score": 0.8289388019824946, "openwebmath_perplexity": 822.3556913106572, "openwebmath_score": 0.9954406023025513, "tags": null, "url": "https://mathzsolution.com/tag/analysis/" }
c++ std::cout << "\n\n" << std::flush; } bool division_by_zero( int memory[ memory_size ], unsigned operand ) { if ( memory[ operand ] == 0 ) { std::cout << std::setw( 5 ) << std::left << "***" << "Attempting division by zero" << std::setw( 5 ) << std::right << "***\n"; std::cout << std::setw( 5 ) << std::left << "***" << "Program terminated abnormally" << std::setw( 5 ) << std::right << "***\n"; std::cout << "\n"; return true; } return false; } main.cpp #include <iostream> #include <iomanip> #include "registers.h" #include "sml.h" int main() { int memory[ memory_size ]{}; size_t memory_size = sizeof( memory )/ sizeof( memory[ 0 ] ); int temp; display_welcome_message(); while( instruction_counter != memory_size ) { std::cout << std::setw( 2 ) << std::setfill( '0' ) << instruction_counter << " ? "; std::cin >> std::hex >> temp; if( temp == end ) { break; } if( temp >= -0xB3E8 && temp < 0xB3E8 ) memory[ instruction_counter++ ] = temp; else continue; }
{ "domain": "codereview.stackexchange", "id": 39756, "lm_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 }
object-oriented, ruby Title: Less-repetitive code for document-analyzer I've refactored my code such that every function has only one responsibility. Now I'd like like to work on making it DRY. I'm noticing a lot of duplication in the DocumentAnalyzer class. In nearly every function, I make a reference to @document. Should my one-statement functions be collapsed into one line? require 'set' class Document attr_reader :words def initialize(words) @words = words end end class DocumentAnalyzer def initialize(document) @document = document end def unique_words @document.words.to_set end def unique_words_count unique_words.count end def word_count @document.words.size end def total_characters total = 0.0 @document.words.each { |word| total += word.size } total end def average_word_length total_characters / word_count end end
{ "domain": "codereview.stackexchange", "id": 8241, "lm_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, ruby", "url": null }
python, beginner Title: Docker Swarm Constraint Service (Microservices) I've written my first "real" Python application. I've never worked much with Python before, so I'd like to receive feedback on how I can structure the application to make it follow the way Python programs usually are. This is very much from a "readability" perspective, but getting feedback on general structure as well as my use of classes, naming of methods and use of comments would be great to get other's opinion on. https://github.com/sbrattla/swarmconstraint The use case for this application is real. I manage a Docker Swarm, but I need a service (aka task in Docker Swarm) to only run in a couple of nodes participating in that swarm. However, if I use placement constraints (constraint a service to specific nodes) and the nodes which the service is constrained to go down - then the service goes down as well. So, the application will remove the placement constraints if specified nodes goes down so that the service can "fallback" to other nodes. #!/usr/bin/python3 import argparse import docker import json import logging import re import string import time class SwarmConstraint: def __init__(self, args): self.args = args self.initClient() self.logger = logging.getLogger(__name__) handler = logging.StreamHandler() formatter = logging.Formatter( '%(asctime)-25s %(levelname)-8s %(message)s') handler.setFormatter(formatter) self.logger.addHandler(handler) self.logger.setLevel(logging.DEBUG) if (not self.args['watch']): raise Exception('At least one node to watch must be provided.') if (not self.args['toggle']): raise Exception('At least one node to toggle must be provided.') if (not self.args['label']): raise Exception('At least one label must be provided.')
{ "domain": "codereview.stackexchange", "id": 39605, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner", "url": null }
organic-chemistry, stability Title: Stability of dialkyl substituted alkenes The stability order of alkyl substituted alkenes with respect to heat of hydrogenation was given as $$\ce{R_2C=CH2} > \ce{RHC=CHR}~(\textit{trans}) > \ce{RHC=CHR}~(\textit{cis}).$$ While I understand that trans alkene is generally more stable than cis, I don't understand why $\ce{R_2C=CH2}$ is the most stable. Shouldn't there be repulsion between the bulky alkyl groups which leads to decrease in stability? Following is an image of hyperconjugative effect. We can see a $\ce{\sigma}$-orbital delocalising electron pair with an empty $\ce{\pi^\ast}$-orbital. The explanation to your problem can be given by deciding whether the effect is "centralized" or "decentralized". Let me explain it by an example. A quick scene: Suppose, you and your friend is sitting across a boat ($\ce{C_{you}=C_{friend}}$) in the middle of a river, and both of you have to reach on either bank soon (a process similar to delocalization, probably). Assume the methyl groups to be oars you need to move across the river.
{ "domain": "chemistry.stackexchange", "id": 14132, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, stability", "url": null }
# difference between quotient rule and product rule Product rule : $$\frac{d}{dx} \big(f(x)\cdot g(x)\big)=f'(x)\cdot g(x)+f(x)\cdot g' (x)$$ Quotient rule : $$\frac{d}{dx} \frac{f(x)}{g(x)}=\frac{f'(x)\cdot g(x)-f(x)\cdot g'(x)}{[g(x)]^2}$$ Suppose, the following is given in question. $$y=\frac{2x^3+4x^2+2}{3x^2+2x^3}$$ Simply, this is looking like Quotient rule. But, if I follow arrange the equation following way $$y=(2x^3+4x^2+2)(3x^2+2x^3)^{-1}$$ Then, we can solve it using Product rule. As I was solving earlier problems in a pdf book using Product rule. I think both answers are correct. But, my question is, How does a Physicist and Mathematician solve this type question? Even, is it OK to use Product rule instead of Quotient rule in University and Real Life?
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.975946441508702, "lm_q1q2_score": 0.8892625902646404, "lm_q2_score": 0.9111797045849583, "openwebmath_perplexity": 532.4571520060127, "openwebmath_score": 0.8917396664619446, "tags": null, "url": "https://math.stackexchange.com/questions/4131809/difference-between-quotient-rule-and-product-rule" }
\begin{align} \sum_{k=0}^{n} a_{k}&=\sum_{\substack{k=0 \\ k \text{ is even }}}^{n} a_{k}+\sum_{\substack{k=0 \\ k \text{ is odd }}}^{n} a_{k}\\ &=\sum_{\substack{k=0 \\ k=2k' \text{ with } k'\in\mathbb{Z}}}^{n} a_{k}+\sum_{\substack{k=0 \\ k=2k'+1 \text{ with } k'\in\mathbb{Z}}}^{n} a_{k}\\ &=\sum_{\substack{k=0 \\ k'=\frac{k}{2} }}^{n} a_{2k'}+\sum_{\substack{k=0 \\ k'=\frac{k-1}{2} }}^{n} a_{2k'+1}\\ &=\sum_{\substack{k=0 \\ k'=\frac{k}{2}\\ k=0 \implies k'=0 \\ k=n \implies k'=\frac{n}{2}}}^{n} a_{2k'}+\sum_{\substack{k=0 \\ k'=\frac{k-1}{2}\\ \text{since k is odd can start with 1 and not 0 } k=1 \implies k'=0 \\ k=n \implies k'=\dfrac{n-1}{2} }}^{n} a_{2k'+1}\\ &=\sum_{k'=0}^{ n/2 } a_{2k'} + \sum_{k'=0}^{ (n-1)/2 }a_{2k'+1}\\ &\text{If
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9873750507184356, "lm_q1q2_score": 0.8578578856073074, "lm_q2_score": 0.8688267796346599, "openwebmath_perplexity": 434.2893351703029, "openwebmath_score": 0.9999791383743286, "tags": null, "url": "https://math.stackexchange.com/questions/1503360/sum-k-0n-a-k-sum-k-0-lfloor-n-2-rfloor-a-2k-sum-k-0-lflo" }
ros, robot-state-publisher, urdf-tutorial, launch-file Title: R2D2 Tutorial, Using urdf with robot_state_publisher Hi all, I am trying to follow the r2d2 tutorial (http://www.ros.org/wiki/urdf/Tutorials/Using%20urdf%20with%20robot_state_publisher). I ran roscreate-pkg r2d2 I added dependencies to roscpp rospy std_msgs and then I put the state_publisher.cpp file in r2d2/src. I added rosbuild_add_executable(state_publisher state_publisher.cpp) I added the launch file to the r2d2 directory as well. When I try to run rosmake I get a fatal error: 'tf/transform_broadcaster.h' No such file or directory. Although when I roscd to tf, I can find transform_broadcaster.cpp. My questions are: Do I have the r2d2 directory and files in the write places for how this tutorial should run or is there something I'm missing? Why is it not finding tf/transform_broadcaster.h? Originally posted by tangell on ROS Answers with karma: 15 on 2012-11-06 Post score: 1 1.launch file should be added to r2d2/launch directory. But this is not relevant to the problem. 2.Because you didn't depend this package on "tf".You can solve this problem by adding the dependency to manifest.xml. For example, your manifest.xml should looks like <package> <description brief="r2d2_try"> r2d2_try </description> <author>ROSfuerte</author> <license>BSD</license> <review status="unreviewed" notes=""/> <url>http://ros.org/wiki/r2d2_try</url> <depend package="roscpp"/> <depend package="rospy"/> <depend package="std_msgs"/> <depend package="tf"/> </package>
{ "domain": "robotics.stackexchange", "id": 11647, "lm_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, robot-state-publisher, urdf-tutorial, launch-file", "url": null }
javascript, physics, collision, svg, d3.js var circles = svg.selectAll(".disk") .data(init_data) .enter().append("circle") .attr("r", function(d) { return d[0] }) .attr("cx", function(d) { return d[1] }) .attr("cy", function(d) { return d[2] }) .attr("fill", c10);
{ "domain": "codereview.stackexchange", "id": 19708, "lm_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, physics, collision, svg, d3.js", "url": null }
haskell, comparative-review, monads Title: Monad Transformers I've run into the same scenario involving Monad Transformers a few times now, and I'm looking for some "best-practice" advice. Bear with the introduction, the issue itself is really simple: Say you're given a list of inputs, and you want to convert them into some aggregated form while handling the possibility of invalid inputs. In code, we could have something like: type Input = String type ProcessedInput = String type Output = S.Set ProcessedInput data Error = InvalidFormat Input | DuplicateInput ProcessedInput processInput :: Input -> Maybe ProcessedInput -- Useful later, not vital to the problem ifM :: Monad m => m Bool -> m a -> m a -> m a ifM cond t f = cond >>= \c -> if c then t else f and we want something like: buildInputs :: [Input] -> Either Error Output I've found that it's normally nicer to compute this inside a little isolated monad transformer stack (StateT around an Except, so we can build up our result and handle errors when needed) instead of doing a bunch of maps and any checks and aggregations. So the question: Is it "better" to express this computation as acting on single inputs, or acting on the entire input? Bearing in mind that this is an entirely self-contained computation, it won't need to be used as a subcomputation anywhere else. Using a "single-input" action requires some slightly unintuitive wrapping in buildInputs: buildInputs :: [Input] -> Either Error Output buildInputs is = runExcept $ execStateT builder S.empty where builder = sequence (map buildInputs' is) buildInputs' :: Input -> StateT Output (Except Error) () buildInputs' i = case processInput i of Nothing -> throwError (InvalidFormat i) Just p -> ifM (gets $ S.member p) (throwError $ DuplicateInput p) (modify $ S.insert p)
{ "domain": "codereview.stackexchange", "id": 29774, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "haskell, comparative-review, monads", "url": null }
quantum-mechanics, electromagnetism, dirac-equation, gauge-invariance, klein-gordon-equation Title: Dirac equation with minimal coupling derivation from Klein-Gordon equation I am wondering if the form of the Dirac equation given in the case of minimal coupling can be "squared" to give back the corresponding Klein-Gordon equation as in normally done in the field-free case. Specifically, I am trying to reproduce the equation, $$(\hat{H} - q\phi)^2 = c^2 (\hat{p}-q\vec{A})^2 + m^2c^4.$$ I am starting from the Dirac equation including minimal coupling motivated by the relativistic Hamiltonian written out as, $$\hat{H} - q\phi = \vec{\alpha} \cdot c(\hat{p} - q\vec{A} ) + \beta mc^2 $$ where $\vec{\alpha}$ is a vector of matrices with the same size as $\beta$ and $\phi$, $\vec{A}$ are the scalar and vector potentials, respectively. Then, once I square the equation in order to give the conditions on the various $\alpha_j$ and $\beta$ by consistency with the Klein-Gordon equation, I run into a problem where terms such as, $$\alpha_x \alpha_y (p-qA)_x (p-qA)_y + \alpha_y \alpha_x (p-qA)_y (p-qA)_x$$
{ "domain": "physics.stackexchange", "id": 75328, "lm_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, electromagnetism, dirac-equation, gauge-invariance, klein-gordon-equation", "url": null }
literature-request For as long as I can remember (okay, since 2002) the standard source of this type has been the Web of Science. It covers all sciences (and engineering, social science) so you have to restrict your search with sensible combinations of keywords, categories, and journal names, but it's the closest thing to a neutral database that we have. I don't find Google Scholar to be a good substitute. It doesn't have a very good signal to noise, you'll often get multiple hits to entries of the same article in different databases, but direct links to the actual journal article can appear quite low down on the list. I know this has been a problem for EGU/Copernicus journal articles, which appear much lower down than social network (e.g., ResearchGate) links. The problem with both of those tools though is the sheer volume of articles. So much is published these days that it's simply not possible for anyone to exhaust the search. My lab often recruits post-docs into Earth science positions from other disciplines (e.g., maths, physics) and knowing where to start or finish with the literature can be intimidating for them. What they need is for some experienced researchers in the field to filter the literature for them, which is why I normally recommend reading recent review articles as a way of gauging the knowledge boundaries. There are journals dedicated to review articles, e.g., Earth Science Reviews Review of Geophysics Nature Reviews Earth & Environment Encyclopedia of Geosciences and doubtlessly there are more than I've forgotten. Some publishers also curate collections of important articles from across their journals, e.g., Nature Collections AGU Grand Challenges Read the references you find in those and maybe go one level deeper and then you'll have done your due diligence. I still stumble across seams of papers I've missed in fields that I've worked in for years and it's never been a problem; no one expects you to be exhaustive in your search.
{ "domain": "earthscience.stackexchange", "id": 2040, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "literature-request", "url": null }
schroedinger-equation, integration, eigenvalue, molecules, vibrations To my reasoning some insight is gained by viewing the equation as a ratio: Pn/Pn+1 = EXP( Rn+1 * SQRT( Un+1 - E ) - Rn * SQRT( Un - E ) ) Thus we see that at some point (my instinct says when the potential crosses the trial eigenvalue) the term inside the EXP will become negative, the ratio becomes < 1.0 and the wave function begins decreasing. Though in practice I never see this without terms becoming complex. So my question is: Does anyone have any insight into this problem? Can anyone suggest any resources that I may have missed to help explain this solver to me? Many thanks.
{ "domain": "physics.stackexchange", "id": 23807, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "schroedinger-equation, integration, eigenvalue, molecules, vibrations", "url": null }
quantum-mechanics, quantum-spin, spinors, bloch-sphere where $\theta$ is the rotation angle and $\gamma_i$ the direction cosines of the rotation axis. The group acting on the spatial vectors is $SO(3)$ and the basis vectors of its Lie algebra are: $$i\,S_x = \left(\begin{array}{ccc}0&0&0\\0&0&-1\\0&1&0\end{array}\right);\quad i\,S_y = \left(\begin{array}{ccc}0&0&1\\0&0&0\\-1&0&0\end{array}\right);\quad i\,S_z = \left(\begin{array}{ccc}0&-1&0\\1&0&0\\0&0&0\end{array}\right)\tag{2}$$ As we do this, the quantum spin state $\psi$, when it is expressed as a $2\times 1$ column vector in the $z$-component angular momentum eigenstate basis as we did in Application 1, transforms by the image of $R$ under a projective or spinor representation (discussed in my answer here) as $\psi\mapsto\Sigma(\theta,\,\gamma_x,\,\gamma_y,\,\gamma_z)\,\psi$ where: $$\Sigma(\theta,\,\gamma_x,\,\gamma_y,\,\gamma_z) = \exp\left(i\,\frac{\theta}{2}\left(\gamma_x\,\sigma_x+\gamma_y\,\sigma_y+\gamma_z\,\sigma_z\right)\right)\tag{3}$$ Application 3: If a spin $\frac{1}{2}$ particle with a magnetic moment is steeped in a classical magnetic field with induction components $B_j$, then the time evolution operator on the quantum state discussed in Application 1 is defined by:
{ "domain": "physics.stackexchange", "id": 21455, "lm_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-spin, spinors, bloch-sphere", "url": null }
bash, git You name your usage function Help. This is not wrong of course, but a more traditional Unix-ish name would be usage. In the Help function, you call echo several times, which is clearly not so efficient (or well-looking). A traditional solution would be to use cat like this: cat << _EOF__ Usage .... .. _EOF__
{ "domain": "codereview.stackexchange", "id": 14863, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bash, git", "url": null }
of the graph; 1<x<7 or x<-2 is the complete range of x that satisfies the inequality. _________________ Manager Joined: 29 Sep 2008 Posts: 154 Followers: 2 Kudos [?]: 31 [8] , given: 1 Re: Inequalities trick [#permalink] 22 Oct 2010, 10:45 8 This post received KUDOS 3 This post was BOOKMARKED if = sign is included with < then <= will be there in solution like for (x+2)(x-1)(x-7)(x-4) <=0 the solution will be -2 <= x <= 1 or 4<= x <= 7 in case when factors are divided then the numerator will contain = sign like for (x + 2)(x - 1)/(x -4)(x - 7) < =0 the solution will be -2 <= x <= 1 or 4< x < 7 we cant make 4<=x<=7 as it will make the solution infinite correct me if i am wrong Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 4755 Location: Pune, India Followers: 1112 Kudos [?]: 5022 [4] , given: 164 Re: Inequalities trick [#permalink] 11 Mar 2011, 18:57 4 This post received KUDOS Expert's post vjsharma25 wrote: I understand the concept but not the starting point of the graph.How you decide about the graph to be a sine or cosine waveform?Meaning graph starts from the +ve Y-axis for four values and starts from -ve Y-axis for three values. What if the equation you mentioned is (x+2)(x-1)(x-7)<0,will the last two ranges be excluded or the graph will also change? Ok, look at this expression inequality: (x+2)(x-1)(x-7) < 0 Can I say the left hand side expression will always be positive for values greater than 7? (x+2) will be positive, (x - 1) will be positive and (x-7) will also be positive... so in the rightmost regions
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9597620619801096, "lm_q1q2_score": 0.860188072580374, "lm_q2_score": 0.8962513800615312, "openwebmath_perplexity": 2813.2556971947556, "openwebmath_score": 0.5333693623542786, "tags": null, "url": "http://gmatclub.com/forum/inequalities-trick-91482.html?kudos=1" }
We have $30$ pairs from which to choose the second pair. However, once we choose a pair, we need to get rid of $4$ other pairs with the same man (since there are $6-2=4$ women who haven't been picked yet) and the $5$ other pairs with the same woman (since there are $7-2=5$ men who haven't picked yet), leaving us with $30-1-4-5=20$ pairs left. We have $20$ pairs from which to choose the third pair, at which point we are done. This gives us an answer of: $$42*30*20=25200$$ Thus, both methods done correctly give us the same answer.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9732407152622597, "lm_q1q2_score": 0.8438344963401913, "lm_q2_score": 0.8670357529306639, "openwebmath_perplexity": 248.9260014770366, "openwebmath_score": 0.7460737228393555, "tags": null, "url": "https://math.stackexchange.com/questions/1823130/6-women-7-men-form-a-pair-of-1-woman-1-man-how-many-ways-can-we-select-3-pairs" }
depends on the parameters of the orbit ($$a, \epsilon, \omega$$, i) and the Earth's equatorial radius $$R_E$$ and its $$J_2$$ term. Let's use 6378137 meters for $$R_E$$ (from this answer) and 1.0826E-03 for $$J_2$$ (from this answer). The satellite's period $$T$$ in your data table is 15.59029 revolutions per day, or about 5542 seconds. Then use: $$\omega = \frac{2 \pi}{T} = 0.0011338 \ \text{sec}^{-1}.$$ $$a^3 = \frac{GM}{\omega^2}$$ where GM is Earth's standard gravitational parameter of about 3.986E+14 m^3/s^2. That makes $$a=$$ 6768601 meters, or an altitude of about 390 km. Plug those all in to the first equation, and we get $$\omega_p = -1.2149 \times 10^{-6} \ \text{sec}^{-1}$$ If we multiply that by 60 days or 5184000 seconds, we get -6.298 which is almost exactly $$-2 \pi$$ or one complete cycle, just what the plot shows! The argument of perihelion at first looks like it drifts steadily then flips by 180 degrees around day 85, but that's actually a smooth shape change since the eccentricity hits zero and bounces back. That looks like a natural precession as well, and not an orbital maneuver.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9559813526452771, "lm_q1q2_score": 0.8144509920155993, "lm_q2_score": 0.8519528019683105, "openwebmath_perplexity": 740.9362828408126, "openwebmath_score": 0.76578289270401, "tags": null, "url": "https://space.stackexchange.com/questions/35479/can-the-right-ascension-and-argument-of-perigee-of-a-spacecrafts-orbit-keep-var?noredirect=1" }
python, beginner, validation I was wondering if this is a readable and 'pythonic' way of doing this? If not, what would be better alternatives? Don't print promiscuously. You've broken your problem down into several small functions, which is a good general instinct. But you've undermined those functions by polluting them with side effects -- printing in this case. Whenever feasible, prefer program designs that rely mostly on data-oriented functions (take data as input and return data as output, without causing side effects). Try to consolidate your program's necessary side effects in just a few places -- for example, in a top-level main() function (or some equivalent) that coordinates the interaction with the user. Don't over-engineer. You have described a simple usage pattern: ? for help; N for select; >N for goto-page, and >S for goto-player (where N is an integer and S is a string of letters). Validating that kind of input could be done reasonably in various ways, but none of them require so much scaffolding. The small demo below uses (INPUT_CAT, REGEX) pairs. For more complex input scenarios, you could use callables (functions or classes) instead of regexes. Resist the temptation for fine-grained dialogue with users. My impression is that you want to give the user specific feedback when their input is invalid. For example, if the user enters ?foo, instead of providing a general error message (eg, "Invalid input") you say something specific ("Invalid input: when using '?', no other characters are allowed."). That specificity requires more coding on your part and reading/understanding on the part of users as you pepper them with different flavors of invalid-reply messages. But is it really worth it? I would suggest that the answer is no. Instead of fussing with all of those details, just provide clear documentation in your usage/help text. If a user provides bad input, tell them so in a general way and, optionally, remind them how to view the usage text. When feasible, let a data structure drive the algorithm rather than logic. Your current implementation is based heavily on conditional logic. With the right data structure (INPUT_RGXS in the demo below), the need for most of that logic disappears. import sys import re
{ "domain": "codereview.stackexchange", "id": 44711, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, validation", "url": null }
python, rospy Originally posted by PeterMilani with karma: 1493 on 2014-06-24 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by nckswt on 2014-06-24: Hmm, that'll demand a near-complete rework of my system. I assume that launching nodes in individual threads wouldn't work either. I'll keep looking into it and see if I can find an answer. Thanks. Comment by JaimeOrellana on 2017-07-11: Is there still no solution to this problem in 2017?
{ "domain": "robotics.stackexchange", "id": 18372, "lm_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, rospy", "url": null }
Is this solution correct? Thanks in advance. • It looks right to me :) – Milten Nov 2 '19 at 21:02 • Okay.. great to know :) – Abhirup Gupta Nov 2 '19 at 21:09 Just to check, it is fairly easy to count by cases that there are $$18$$ $$4$$-digit numbers that does contain $$888$$. Thus $$T(4)=9000-18=8982$$, which matches your recursive formula. Similarly, $$T(5)$$ should be $$90000-261=89739$$, which your formula also gives. We could check more with a program of course. I also found the closed form formula for your recursion: $$T(n) = 0.9015\cdot9.991^n - 0.0126 \cdot 0.949^n \cdot \cos(2.12\cdot n) - 0.0155\cdot 0.949^n\cdot \sin(2.12\cdot n) \\ = [0.9015\cdot9.991^n]$$ where $$[\cdot]$$ means rounded to nearest integer. (Exact algebraic values would involve roots of a cubic polynomial).
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9863631671237733, "lm_q1q2_score": 0.8017823776021445, "lm_q2_score": 0.8128673133042217, "openwebmath_perplexity": 287.5004369747273, "openwebmath_score": 0.745951235294342, "tags": null, "url": "https://math.stackexchange.com/questions/3419361/how-many-n-digit-numbers-are-there-such-that-no-three-consecutive-digits-are-8" }
ions, crystal-structure, ionic-compounds, solid-state-chemistry Title: How does NaCl maintain its crystalline structure? My understanding is that $\mathrm{NaCl}$ is an ionic compound, in which $\mathrm{Cl}$ becomes (effectively) $\mathrm{Cl^-}$ and $\mathrm{Na}$ becomes $\mathrm{Na^+}$. So I understand why I would get a "sea" of particles that would stick together. But why does the above mean that it will have a face centered cubic structure with the ions held in place so rigidly? Crystals have inspired a great many chemists because they are fascinating for a good reason. Not only are they aesthetically pleasing, but they serve as an excellent subject to tour a variety of theoretical subjects important for understanding high-level chemistry. Crystalline materials are made up of periodic structures. We’re only going to primarily focus on binary compounds where there is not a high degree of covalency. There are several ways to think about this problem, but let’s start with the melting of a crystal. We say that at some definite temperature a highly ordered crystal will melt into a liquid. Those of us familiar with the language of equilibrium thermodynamics might recognize that the change in free energy for this phase change can be written, at constant temperature, as, $$ G_\text{liquid} - G_\text{crystal} = H_\text{liquid} - H_\text{crystal} - T ( S_\text{liquid} - S_\text{crystal} ) $$ $$ \Delta G = \Delta H - T \Delta S $$ If we suppose that this process is spontaneous then we would say that the change in Gibbs’ free energy is negative, i.e. $\Delta G < 0$. This is true if and only if, $$\Delta H < T \Delta S$$
{ "domain": "chemistry.stackexchange", "id": 1181, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ions, crystal-structure, ionic-compounds, solid-state-chemistry", "url": null }
python, unit-testing What is the input? (string, path) Does it return anything? (no) Does it throw exceptions? (yes, because os.remove and shutil.rmtree may throw) What is the state after calling the function? (file/folder has been removed, except if there was a permission error or another error) Exceptions: Someone who calls removeanything("myfile") may expect that myfile does not exist anymore after the function call. However, in case of a permission error, it still does exist. I think this is an exceptional situation, so I recommend that you do not catch the PermissionError and instead propagate it to the caller. Output: Currently, the function communicates via print statements. This means that callers of the function have no way of finding out what actually happened. You could add a return value that indicates whether a file, a directory, or nothing was removed. Then you may think about removing the print statement, or enabling/disabling it via function argument, because users may want to remove files silently. Tests: It may be useful to separate the single test test_removeanything into multiple tests test_removeanything_deletes_file, test_removeanything_deletes_directory, test_removeanything_handles_permission_error. This way, if a test fails, the test name gives you some more information about what went wrong. Often, functions that remove directories require them to be non-empty. Therefore, it makes sense to test the removal of both empty and non-empty directories. If you change removeanything so that the PermissionError propagates to the user, you can use pytest.raises to test whether the exception was raised correctly. Misc: I think the name removeanything can be more specific. After all, the function does not remove a CD from my CD drive ;)
{ "domain": "codereview.stackexchange", "id": 37027, "lm_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, unit-testing", "url": null }
strings, sql, sql-server, t-sql, edit-distance Concerns: Errors at the start of the string have more impact than those later in the string. Results look quite good on my test data, but not sure how predictable this would be in reality. It would be nice to be able to weight the errors; e.g. O for 0 is very common; 6 for G or 8 for g less so; so the former should have a greater weighting (i.e. P0rtugal should be preferential to Portu8al; not just because of the character's position in the string). Why are you creating your own string similarity algorithm? You realise that casting to bigint means that only the first eight bytes are ever used? (first eight characters for varchar and first four for nvarchar in most collations)? And the characteristics are heavily dependant on the ASCII codes of the characters? This leads to some fairly odd (and asymmetrical) results. insert @t(solution) SELECT 'cat' UNION ALL SELECT 'dog' DECLARE @answer NVARCHAR(32) = 'Cat' Returns +----------+--------+ | solution | score | +----------+--------+ | cat | 0 | | dog | 196624 | +----------+--------+ which looks good so far. Searching for "Cat" matched "cat" with a perfect score. But reverse the search to look for "cat" with an entry for "Cat" in the data... insert @t(solution) SELECT 'Cat' UNION ALL SELECT 'dog' DECLARE @answer NVARCHAR(32) = 'cat' Returns +----------+---------+ | solution | score | +----------+---------+ | dog | 196624 | | Cat | 2097152 | +----------+---------+ I suggest using a tried and tested string similarity algorithm such as Levenshtein distance - possibly implemented as a CLR function.
{ "domain": "codereview.stackexchange", "id": 12297, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "strings, sql, sql-server, t-sql, edit-distance", "url": null }
Let $S$ be a set of LOST-sentences such that $\mathsf{ZFC} + S$ is consistent, and let $(\phi_{i})_{i \in [n]}$ be a finite list of sentences taken from $\mathsf{ZFC} + S$. Basic logic gives us $$\mathsf{ZFC} + S \vdash \bigwedge_{i = 1}^{n} \phi_{i}. \qquad (\clubsuit)$$ By the quoted result, we have $$\mathsf{ZFC} \vdash (\exists c) \! \left( “\text{ c is countable and transitive}” \land \left( \bigwedge_{i = 1}^{n} \phi_{i} \iff \left( \bigwedge_{i = 1}^{n} \phi_{i} \right)^{c} \right) \right).$$ This is equivalent to $$\mathsf{ZFC} \vdash (\exists c) \! \left( “\text{ c is countable and transitive}” \land \left( \bigwedge_{i = 1}^{n} \phi_{i} \iff \bigwedge_{i = 1}^{n} \phi_{i}^{c} \right) \right).$$ As $\mathsf{ZFC} + S$ is clearly at least as strong as $\mathsf{ZFC}$, it follows that $$\mathsf{ZFC} + S \vdash (\exists c) \! \left( “\text{ c is countable and transitive}” \land \left( \bigwedge_{i = 1}^{n} \phi_{i} \iff \bigwedge_{i = 1}^{n} \phi_{i}^{c} \right) \right). \qquad (\spadesuit)$$ Finally, applying modus ponens to $(\clubsuit)$ and $(\spadesuit)$, we obtain
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9648551515780319, "lm_q1q2_score": 0.8239021222706862, "lm_q2_score": 0.8539127566694178, "openwebmath_perplexity": 246.03844063922463, "openwebmath_score": 0.9047431945800781, "tags": null, "url": "https://math.stackexchange.com/questions/1904001/generalizing-the-reflection-principle-of-mathsfzfc" }
java, object-oriented, game BingoGame game = new BingoGame(4); for(int i=1; i<=25; i++) game.addEvent(Integer.toString(i)); game.startGame(); }//end main }//end class Initialize variables inline where you can, to reduce boilerplate: private String board[][] = new String[BOARD_DIM][BOARD_DIM];, etc. Don't use default scoping unless you really mean to. Prefer public or private, as appropriate. Delegate from one constructor to another, where you can. public BingoBoard(ArrayList<String> eventList) { this(); updateEvents(eventList); } If you are going to add per-method comments, might as well teach yourself javadoc while you're at it: /** * Chooses events and adds them to the board. */ public boolean randomizeEvents() { Putting Random rand = new Random(); inside the loop is wasteful of resources, and will occasionally cause nextInt() to return the same value on consecutive occasions due to reseting the random number generator, rather than getting the next number from the same generator. Move it up, outside the loop. This block deserves a comment, or better, to be moved to a self-documenting method. It looks like a bug to me (if BOARD_DIM is 5, then this is executed on the 12th event.. board[2][3] = FREE;.. really? Is that what you want to do?). if(count == MAX_SIZE/2) { board[count/BOARD_DIM][count%BOARD_DIM] = FREE; count++; }//end if
{ "domain": "codereview.stackexchange", "id": 5904, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, game", "url": null }
quantum-chemistry, electromagnetic-radiation, x-ray-diffraction Thus the calculation reduces to understanding the QM calculation for the polarisability. See for example Atkins & Friedmann 'Molecular Quantum Mechanics' Ch $12$. ( By considering that the x-ray is a plane wave the intensity of scattered radiation relative to that incident is given by $$ \frac{I}{I_0}= \frac{e^4}{m^2c^4R^2}P(\theta)$$ where R is the distance from the scattering centre to the detector, m the electron mass and $\theta$ the scattering angle and $P(\theta)=(1+\cos^2(\theta))/2$ is called the polarisation factor. This formula is sometimes named after Thomson. The $m^{-2}$ shows why significant scattering occurs only from electrons and not from protons. The book by Flygare 'Molecular Structure and Dynamics' section 8.5 gives a detailed description of x-ray scattering in general and details such as calculating atomic scattering factors. )
{ "domain": "chemistry.stackexchange", "id": 7540, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-chemistry, electromagnetic-radiation, x-ray-diffraction", "url": null }
newtonian-mechanics, classical-mechanics Title: Why is a $5-60 mph$ time slower than a $0-60 mph$ time for some automobiles? This doesn't make a lot of sense to me, from a physics 101 point of view. I've read a few blog entries on why this is, but none of them explain it well or are convincing. "something-something launch control. something-something computers." Nothing in physics terms or equations. For instance, Car and Driver magazine tested the Porsche Macan GTS. The $x-60$ times are: Rolling start, $5-60\; \mathrm{mph}: 5.4\;\mathrm{ s}$ $0-60\;\mathrm{mph}: 4.4\;\mathrm{s}$ That's a whole second - about $20$% faster from a dead stop than with some momentum - which seems rather huge. edit: here is the article for this particular example. But I've noticed this with many cars that are tested for $0-60$ and $5-60$ times. Here is another example - an SUV. Another example. And finally, interesting, even for the Tesla Model S (EV) where power doesn't depend on engine RPM, $0-60$ is still slightly faster than $5-60.$ Ok, from the link given by @count_to_10, I think the answer is clear from this response: You can launch from a dead stop at any RPM you want, whereas from 5 MPH it's assumed the car is already in gear at low RPMs. When you start from a standstill, you can rev the engine to any RPM you like before throwing the clutch to engage the axle. Maybe you could match the static friction of the surface to achieve the maximum possible acceleration. When they start at 5 mph, another answer on that site makes it clear that they assume your RPMs are matched to your motion: "What about rolling at 5mph and dropping the clutch like a regular launch? Wouldn't that help?" Yeah, but that's not how they test 5-60 or any other rolling acceleration tests. That's the point of them: to test how much passing power you have while already rolling, in gear without a clutch-drop. So the engine has to move through the entire range of RPMs, which takes more power.
{ "domain": "physics.stackexchange", "id": 33233, "lm_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, classical-mechanics", "url": null }
c, octree do { // This loop does 2 things: Find the insertion point for new branches, and offsets all the relevant indices in all the ancestry unsigned offset = state.offset[level]; while (++offset&7) { uint16_t *const node_ptr = (uint16_t *)octree->set+offset; if (*node_ptr&0x8000) { if (!set) set = (offset>>3)+(*node_ptr&0x7FFF); *node_ptr += state.level; } } } while (++level != 5); const unsigned offset = state.offset[state.level]; ((uint16_t *)octree->set)[offset] = (set // If no set was found, it means there is nothing to shift over, and the new data should be placed at the end of the tree ? (set_ptr += set, memmove(set_ptr+state.level, set_ptr, (prev_size-set)*sizeof(Node8)), set) : (set_ptr += prev_size, prev_size) )-(offset>>3)|0x8000; } uint16_t *node_ptr; Node4 node_dup; node_dup.x[1] = node_dup.x[0] = node; node_dup.z[1] = node_dup.z[0]; for (;;) { set_ptr->y[1] = set_ptr->y[0] = node_dup; node_ptr = (uint16_t *)set_ptr+octree_index(x, z, y, --state.level); if (state.level) { *node_ptr = 0x8001; ++set_ptr; continue; } break; } *node_ptr = new; } else { unsigned set; Node4 node_dup; node_dup.x[1] = node_dup.x[0] = new;
{ "domain": "codereview.stackexchange", "id": 45034, "lm_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, octree", "url": null }
rishi kesh TeethWhitener Gold Member But why is it true for radians only? The series expansion of ##\tan x## is ##\tan x = x + \frac{1}{3}x^3 + \frac{2}{15}x^5+\cdots##, where the powers of ##x## get bigger and bigger. This means for any value of ##x > 1##, the higher power terms in the series will contribute proportionally more than the lower terms. So the approximation only really works well when ##x\ll 1##, because then the higher order terms die out quickly. If you use degrees instead of radians, then you're effectively using ##d = \frac{180}{\pi}x## and calculating ##\tan d## instead of ##\tan x##. Since ##\frac{180}{\pi}\approx 57.2##, you should expect to get ##\tan d \approx \frac{1}{57.2}d##. Doing a quick calculation: $$0.12°\times \frac{1}{57.2} \approx 0.002098$$ in line with what you would expect. Mark44 Mentor Hi! In one of my textbook i saw the relation tan(x) = x where x is very small value and expressed in radians. No reputable book would say that tan(x) = x. The proper relationship is that ##\tan(x) \approx x## for values of x near 0 (and in radians). Khashishi But why is it true for radians only? Radians are the natural units for angles.
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9609517072737737, "lm_q1q2_score": 0.844817590225287, "lm_q2_score": 0.8791467706759584, "openwebmath_perplexity": 1083.5200391542446, "openwebmath_score": 0.9414845705032349, "tags": null, "url": "https://www.physicsforums.com/threads/why-tan-x-x-as-x-approaches-0.943522/" }
java, beginner, algorithm, programming-challenge When I used your sample input problem and wrote a (brute-force, not Ford-Fulkerson) implementation, it shows how the Java reference StreamSupport segments your search space: Split at depth 0, 4 -> 2, 2 Split at depth 0, 2 -> 1, 1 Split at depth 0, 2 -> 1, 1 Split at depth 1, 3 -> 1, 2 Split at depth 1, 3 -> 1, 2 Split at depth 1, 3 -> 1, 2 Split at depth 2, 3 -> 1, 2 Split at depth 1, 3 -> 1, 2 Split at depth 2, 3 -> 1, 2 Split at depth 1, 2 -> 1, 1 Split at depth 1, 2 -> 1, 1 Split at depth 1, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 2 -> 1, 1 Split at depth 2, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 2 -> 1, 1 Split at depth 1, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 3 -> 1, 2 Split at depth 2, 2 -> 1, 1 Split at depth 2, 2 -> 1, 1 Split at depth 3, 3 -> 1, 2 Split at depth 4, 4 -> 2, 2 Split at depth 3, 2 -> 1, 1 Split at depth 4, 2 -> 1, 1 Split at depth 4, 4 -> 2, 2 Split at depth 4, 2 -> 1, 1 Split at depth 5, 3 -> 1, 2
{ "domain": "codereview.stackexchange", "id": 42286, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, algorithm, programming-challenge", "url": null }
lisp, scheme, sicp Title: Writing a general purpose "split" function (for SICP's imaginary language) From SICP 2.2.4: The textbook has already defined a function (right-split ...) as follows: (define (right-split painter n) (if (= n 0) painter (let ((smaller (right-split painter (- n 1)))) (beside painter (below smaller smaller))))) and they have indicated that there exists a procedure (up-split ...) which has much the same structure. Exercise 2.45. Right-split and up-split can be expressed as instances of a general splitting operation. Define a procedure split with the property that evaluating (define right-split (split beside below)) (define up-split (split below beside)) produces procedures right-split and up-split with the same behaviors as the ones already defined. I wrote the following function, but I'm not sure the best way to test it. What do you think? (define (split step1 step2) (define (split-f painter n) (if (= n 0) painter (let ((smaller (split-f painter (- n 1)))) (step2 (step1 smaller smaller))))) split-f) (define right-split (split beside below)) (define up-split (split below beside)) In order to test it, you need to have definitions for things like beside and below. There's something strange in the text book code because the painter "smaller" is not actually scaled in the code, or is it indicated that "below" and "beside" scale their arguments? Anyway, you can just define (define (below a b) `(below ,a, b)) (define (beside a b) `(beside ,a ,b)) so e.g. (right-split 'apple 1) should produce as result '(beside apple (below apple apple)) You can verify from the structure of the terms that your code works correctly. Your (split ...) function has a bug, as "painter" is missing from the line where you call "step2". The code should read (step2 painter (step1 smaller smaller)) Otherwise it looks fine to me.
{ "domain": "codereview.stackexchange", "id": 263, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "lisp, scheme, sicp", "url": null }
robotic-arm, arduino, kinematics, c Fig 1. Solution A and solution B for point x,y Simple testing give result that configuration : q = [0 0 90 0 90 0] Didn't give position 224, 0, 280 (x,y,z) But it give HTM : -1 0 0 -1 0 1 0 0 0 0 -1 57 0 0 0 1 Read : -1, 0, 57 (x,y,z) while this configuration would give u the position u want : q = [ 0 0 0 -180 180 -180] q = [0 -84.3114 19.6625 0 65.1509 0] Additional note : for -224 in x axis, maybe u wanna check if ur code have additional minus symbol or anything that accidentally make the value of x is -1. Testing with another configuration may help.
{ "domain": "robotics.stackexchange", "id": 2345, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "robotic-arm, arduino, kinematics, c", "url": null }
#### CaptainBlack ##### Well-known member 2) $\int\frac{1}{x^{2}+x-6}dx$ Partial fractions: $\int\frac{1}{x^{2}+x-6}dx ={\Large{\int}} \left[-\frac{1}{5(x+3)}+\frac{1}{5(x-2)}\right]\; dx$ CB Last edited: #### soroban ##### Well-known member Hello, GreenGoblin! $2)\;\int\dfrac{1}{x^{2}+x-6}dx$ I believe this involves completing the square, I made the first step of doing this, rearranging to $\int\frac{1}{(x + \frac{1}{2})^{2}-\frac{25}{4}}dx$ but I am not entirely sure of the exact integration formula corresponding to this. You have the inverse secant form. Let $x+\frac{1}{2} \:=\:\frac{5}{2}\sec\theta \quad\Rightarrow\quad dx \:=\:\frac{5}{2}\sec\theta\tan\theta\,d\theta$ . . . And the denominator becomes: $\frac{25}{4}\tan^2\theta$ $\displaystyle\text{Substitute: }\:\int\dfrac{\frac{5}{2}\sec\theta\tan\theta\,d\theta}{\frac{25}{4}\tan^2\theta} \;=\;\tfrac{2}{5}\int\frac{d\theta}{\sin\theta}$
{ "domain": "mathhelpboards.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9496693659780477, "lm_q1q2_score": 0.8199365628345662, "lm_q2_score": 0.8633916099737806, "openwebmath_perplexity": 1025.2873347666816, "openwebmath_score": 0.8795494437217712, "tags": null, "url": "https://mathhelpboards.com/threads/evaluate-the-integrals.331/" }
gazebo Title: Controller Spawner couldn't reach controller_manager : Running hydro with Gazebo 1.9. Getting the following error: Controller Spawner: Waiting for service /my_robot/controller_manager/load_controller Controller Spawner couldn't reach controller_manager to load controllers Log files are given below: Not sure what to look for and help greatly apprecated. Do not know who should advertise this service. My launch file is: my_robot: joint1_position_controller: type: ros_controllers/JointStateController joint: joint1 pid: {p: 100.0, i: 0.01, d: 10.0} joint2_position_controller: type: ros_controllers/JointStateController joint: joint2 pid: {p: 100.0, i: 0.01, d: 10.0} Here is transimision lines in my_robot.xacro VelocityJointInterface 1
{ "domain": "robotics.stackexchange", "id": 3396, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo", "url": null }
Kudos [?]: 259 [0], given: 33 Intern Joined: 19 Feb 2012 Posts: 25 Kudos [?]: 7 [0], given: 7 Location: India Concentration: Technology, General Management Schools: WBS '15 GMAT 1: 700 Q48 V38 GPA: 3.36 WE: Analyst (Computer Software) Re: 12 Easy Pieces (or not?) [#permalink] ### Show Tags 17 May 2012, 02:22 good work pal keep them comming.... Kudos [?]: 7 [0], given: 7 Intern Joined: 19 Feb 2012 Posts: 25 Kudos [?]: 7 [0], given: 7 Location: India Concentration: Technology, General Management Schools: WBS '15 GMAT 1: 700 Q48 V38 GPA: 3.36 WE: Analyst (Computer Software) Re: 12 Easy Pieces (or not?) [#permalink] ### Show Tags 17 May 2012, 02:23 i wonder if any one got all 12 right.... Kudos [?]: 7 [0], given: 7 Intern Joined: 19 Feb 2012 Posts: 25 Kudos [?]: 7 [0], given: 7 Location: India Concentration: Technology, General Management Schools: WBS '15 GMAT 1: 700 Q48 V38 GPA: 3.36 WE: Analyst (Computer Software) Re: 12 Easy Pieces (or not?) [#permalink] ### Show Tags 17 May 2012, 02:56 the answers given are not in order... Kudos [?]: 7 [0], given: 7 Intern Joined: 25 Jun 2011 Posts: 47 Kudos [?]: 1 [0], given: 7 Location: Sydney Re: 12 Easy Pieces (or not?) [#permalink] ### Show Tags 14 Jul 2012, 15:56 Bunuel wrote: SOLUTIONS: Notice that most of the problems have short, easy and elegant solutions, since you've noticed a trick/trap hidden in the questions.
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9304582593509315, "lm_q1q2_score": 0.8033498447424943, "lm_q2_score": 0.863391599428538, "openwebmath_perplexity": 1998.3859770556626, "openwebmath_score": 0.7534072399139404, "tags": null, "url": "https://gmatclub.com/forum/12-easy-pieces-or-not-126366-20.html" }
ros2, roscore Title: Check ros2 node status When using ROS1, I am able to use ros::master::getNodes to check the nodes that is functioning through code usage. I wonder to know is there any way that ros2 can achieve the same functionality which is to get the functioning nodes. Originally posted by enyuin on ROS Answers with karma: 45 on 2021-05-22 Post score: 0 rclpy.Node.get_node_names() solves the problem!! Originally posted by enyuin with karma: 45 on 2021-05-29 This answer was ACCEPTED on the original site Post score: 2
{ "domain": "robotics.stackexchange", "id": 36455, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, roscore", "url": null }
evolution, neuroscience This gives at least a few names of neurotransmitters that are particularly conserved and candidates for neurotransmitters the common ancestor of neurons used (glutamate, acetylcholine; they may have been peptides, whatever that covers), and I think makes it clear that it is very much not known what those first neurotransmitters were.
{ "domain": "biology.stackexchange", "id": 10621, "lm_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, neuroscience", "url": null }
We have $$H_{n+1}= \sqrt{2}H_n$$ from trigonometry. That is $$H_n$$ is a geometric sequence with common ratio $$\sqrt2$$. • Many thanks! Suppose that the hypotenuse of the $n^{\textrm{th}}$ triangle is the base of the $(n+1)^{\textrm{th}}$ triangle, and each triangle has a height of $1$ unit. If the base of the first triangle is $1$ unit, what is the hypotenuse of $T_{25}$? – Hussain-Alqatari Dec 4 '18 at 7:40
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9898303410461385, "lm_q1q2_score": 0.8046007277095515, "lm_q2_score": 0.8128673110375457, "openwebmath_perplexity": 230.95530750553604, "openwebmath_score": 0.909214437007904, "tags": null, "url": "https://math.stackexchange.com/questions/3025231/what-is-the-length-of-the-hypotenuse" }
following relationship with ‘ r ’ is zero, then means... Is that a nobleman of the coefficient of correlation is the coefficient is a statistical concept, means... Policy and cookie policy coefficient in this segment, we justify some of the MIT OpenCourseWare and! Coefficient since the correlation coefficient and use OCW to guide your own life-long learning, or to! And no start or end dates your own life-long learning, or throw in Bunyakovsky, maybe others lies zero... Just remember to cite OCW as the correlation coefficient is interdependence, lies between -1 and 1 to. Minus 2 rho squared is less than or equal to rho times Y lies 0! Mentioned, it remains valid more generally this is the Schwartz Inequality ( but I keep misspelling name. Observes the following two variables entire MIT curriculum to his maids the degree of closeness the! Creative Commons License and other terms of service, privacy policy and policy! Between ±1 are their ( population ) standard deviations so the denominator is $\ge 0$ therefore 1. Use OCW to guide your own pace ; back them up with references personal! Parameter using $14 in a shell script, which means that X minus rho squared is non-negative which. The variance is 1, not 0 and one can we get rid of potential... To guide your own life-long learning, or responding to other answers do is we will show in! And professionals in related fields -1 to +1 available, OCW is delivering on the top or bottom of non-negative... It means that rho squared and from here we have established this important property, at major! Ocw materials at your own life-long learning, or responding to other answers or throw in,... Because its linearity assumption is not tested throw in Bunyakovsky, maybe others 2,400 courses available OCW. Pearson correlation is the Pearson correlation coefficient is either undefined ( zero denominator ) or in between to. / logo © 2021 Stack Exchange is a free & open publication of material from thousands of MIT courses covering... Useful later Karl Pearson ’ s now input the values for the special of! And expand this quadratic and write it as expected value of rho is equal to 1. Means and unit variances from, you are from, you might call it
{ "domain": "thaiplus.net", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9766692264378963, "lm_q1q2_score": 0.8095990184965997, "lm_q2_score": 0.8289388019824947, "openwebmath_perplexity": 550.7072396013566, "openwebmath_score": 0.6638980507850647, "tags": null, "url": "http://thaiplus.net/9p6gaeax/page.php?id=f1f531-coefficient-of-correlation-lies-between-proof" }
quantum-mechanics, operators, wavefunction, observables Title: Is the expectation value the same as the expectation value of the operator? I was reading the book Introduction to Quantum Mechanics by Daniel Griffith, and also following Brant Carlson's videos. He basically makes videos about parts of the book. The book was discussing $\frac{\mathrm d\langle x\rangle}{\mathrm dt}$, and this spiraled into getting the expectation value of momentum. We are then introduced to the operator used for momentum: $$\langle p\rangle =\int \psi^*\left(-~\mathrm i\hbar\left(\frac{\partial}{\partial x}\right)\right)\psi~\mathrm dx$$ But in the Brant Carlson video on the topic, he states: $$\langle \hat p\rangle =\int \psi^*\left(-~\mathrm i\hbar\left(\frac{\partial}{\partial x}\right)\right)\psi ~\mathrm dx$$ My question is whether this means that $\langle p\rangle =\langle \hat p\rangle\,.$ If this statement is true then the expectation value of $p$ is the same as the expectation value of the momentum operator. This is the link to the video. They are simply using different notations for the same mathematical object (the momentum operator). Some authors use the "hat" notation for operators and write the momentum operator as $\hat p$ and its eigenvalues as $p$, other authors (like Griffiths and Sakurai for example) write both as $p$. Notice that if $p$ was an eigenvalue of the operator $p$ we would trivially have $$\langle p \rangle = p$$ In fact, for every complex number $c$, $\langle c \rangle = c$.
{ "domain": "physics.stackexchange", "id": 35289, "lm_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, operators, wavefunction, observables", "url": null }
c#, object-oriented, console // Another method to update account balance. selectedAccount.AccountBalance = selectedAccount.AccountBalance - transaction_amt; Utility.PrintMessage("Please collect your money. You have successfully withdraw " + $"{Utility.FormatAmount(transaction_amt)}. Please collect your bank slip.", true); } public void PerformThirdPartyTransfer(VMThirdPartyTransfer vMThirdPartyTransfer) { if (vMThirdPartyTransfer.TransferAmount <= 0) { Utility.PrintMessage("Amount needs to be more than zero. Try again.", false); return; } // Check giver's account balance - Start if (vMThirdPartyTransfer.TransferAmount > selectedAccount.AccountBalance) { Utility.PrintMessage($"Withdrawal failed. You do not have enough " + "fund to withdraw {Utility.FormatAmount(vMThirdPartyTransfer.TransferAmount)}", false); return; } if (selectedAccount.AccountBalance - vMThirdPartyTransfer.TransferAmount < minimum_kept_amt) { Utility.PrintMessage($"Withdrawal failed. Your account needs to have " + "minimum {Utility.FormatAmount(minimum_kept_amt)}", false); return; } // Check giver's account balance - End // Check if receiver's bank account number is valid. var selectedBankAccountReceiver = (from b in _accountList where b.AccountNumber == vMThirdPartyTransfer.RecipientBankAccountNumber select b).FirstOrDefault(); if (selectedBankAccountReceiver == null) { Utility.PrintMessage($"Third party transfer failed. Receiver bank account number is invalid.", false); return; } if (selectedBankAccountReceiver.FullName != vMThirdPartyTransfer.RecipientBankAccountName) { Utility.PrintMessage($"Third party transfer failed. Recipient's account name does not match.", false); return; }
{ "domain": "codereview.stackexchange", "id": 35137, "lm_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#, object-oriented, console", "url": null }
quantum-mechanics, homework-and-exercises, angular-momentum, atomic-physics, quantum-spin Firstly, I understand why the state $n,\ell$ has a degeneracy of $2(2\ell+1)$, this is because there are two possible values of $m_{s}$ for a given $\ell$ and there are $2\ell +1$ values of $m_{\ell}$ which multiply to give $2(2\ell+1)$. The part of the solution I don't understand is marked in red. After the $n,\ell$ state splits into $2$ states why must these states have degeneracies $\color{red}{2\ell}$ and $\,\color{red}{2\ell + 2}$? Put in another way; Why not split as $\ell$ and $3\ell +2$ for example which sum to give the required $4\ell +2$ or $\ell + 1$ and $3\ell +1$? I fear I am missing something very simple here. Let's start from the beginning then. $\overrightarrow{L} $ and $\overrightarrow{S} $ are vectors like any other, but they can only take integer length values that we call $\ell$ and $s$. $m_l$ and $m_s$ are the projection of the vector in the z direction usually. $m_\ell$ can only take integer values from $-\ell$ when the vector $\overrightarrow{L} $ is parallel to z but into the opposite direction and as it gets rotated it gains +1 because it's only integers (quantum mechanics) when it's orthogonal to the z axis it's $0$ then when it's parallel it is $\ell$. so it can take $(2\ell +1)$ values.
{ "domain": "physics.stackexchange", "id": 40608, "lm_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, homework-and-exercises, angular-momentum, atomic-physics, quantum-spin", "url": null }
java, object-oriented, swing, quiz // make sure that no ids match each other (otherwise their will be two // of the same words in two differeen fields) while (id4 == id3 || id4 == id2 || id4 == id1) { id4 = rand.nextInt(10) + 1; } while (id3 == id4 || id3 == id2 || id3 == id1) { id3 = rand.nextInt(10) + 1; } while (id2 == id4 || id2 == id3 || id2 == id1) { id2 = rand.nextInt(10) + 1; } while (id1 == id4 || id1 == id3 || id1 == id2) { id1 = rand.nextInt(10) + 1; } WordsDao dao = new WordsDao(); String word1 = null; String word2 = null; String word3 = null; String word4 = null; String vocabWords = ""; if (comboBox.getSelectedItem().equals("Java")) { vocabWords = "javawords"; } else if (comboBox.getSelectedItem().equals("Puppet")) { vocabWords = "puppetwords"; } else { System.out.println("some other words!"); } // nneed to -1 after ids, because the ids are one ahead due to the 0 // value word1 = dao.getAllWords(vocabWords).get(id1 - 1).getWord(); word2 = dao.getAllWords(vocabWords).get(id2 - 1).getWord(); word3 = dao.getAllWords(vocabWords).get(id3 - 1).getWord(); word4 = dao.getAllWords(vocabWords).get(id4 - 1).getWord();
{ "domain": "codereview.stackexchange", "id": 24040, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, object-oriented, swing, quiz", "url": null }
Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $\gcd$ of $0$ and $0$. In general you cannot guarantee that $\gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain). - Use \gcd instead of $GCD$. Also, ^\prime can be abbreviated all the way down to '. – dfeuer Sep 16 '13 at 5:11 I've tried editing it myself, but you've interrupted me twice, so I'll let you do it. – dfeuer Sep 16 '13 at 5:11 @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $\LaTeX$? – Matemáticos Chibchas Sep 16 '13 at 5:12 Yep! It even works in Plain $\TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs). – dfeuer Sep 16 '13 at 5:16 anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries. – Hammerite Sep 16 '13 at 9:21 From Wikipedia: The greatest common divisor of $a$ and $b$ is well-defined, except for the case $a=b=0$, when every natural number divides them. - Well, this isn't really the right answer, is it? William got it right. – user43208 Sep 16 '13 at 5:22 All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $\gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$). – user43208 Sep 16 '13 at 5:32 The guy got his answer, that's the most important :) – DanielY Sep 16 '13 at 5:33
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9835969655605173, "lm_q1q2_score": 0.8510317701886666, "lm_q2_score": 0.8652240704135291, "openwebmath_perplexity": 273.8767097374644, "openwebmath_score": 0.9462026357650757, "tags": null, "url": "http://math.stackexchange.com/questions/495119/what-is-gcd0-0/495127" }
oceanography, models, waves Title: Units of wave spectrum In ocean spectra such as the Pierson Moskowitz or the JONSWAP models, the units of $S(\omega)$ are $m^2/(rad/s)$ (or whatever unit of measurement you are working in). Where does the $m^2$ come from and what does it mean physically? I understand that the integral of the spectrum over all frequencies, i.e. $\int S(\omega) \,d\omega $, is the variance which means that the integral should have $m^2$ units? Please correct me if I am wrong. I understand that the integral of the spectrum over all frequencies is the variance which means that the integral should have $m^2$ units? Please correct me if I am wrong. You are correct. If elevation $\eta(t)$ is the measured quantity (units of $m$), the Fourier transform of wave variance $\eta^2$ yields spectrum $S(f)$ with the units of $m^2/Hz$, or if you are working with angular frequency $\omega = 2\pi f$, it yields $S(\omega)$ with the units of $m^2/rad/Hz$. More details can be found in the answer to this question.
{ "domain": "earthscience.stackexchange", "id": 993, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "oceanography, models, waves", "url": null }
\begin{align} \lim_{h\to0^{\pm}}\sum_{n=1}^\infty \frac{\cos(2n(\mp \pi+h))-\cos(2n(\mp\pi))}{h(4n^2- 1)}&=-2\lim_{h\to0^{\pm}}\sum_{n=1}^\infty \frac{\sin^2(nh)}{h(4n^2-1)}\\\\ &\overbrace{=}^{\text{LHR}}\underbrace{-\frac12\lim_{h\to0^{\pm}}\sum_{n=1}^\infty\frac{4n\sin(2nh)}{4n^2-1}}_{=\lim_{x\to \mp\pi}D(x)}\\\\ &=-\frac12\lim_{h\to0^{\pm}}\sum_{n=1}^\infty\left(\frac{\sin(2nh)}{n}+\frac{\sin(2nh)}{n(4n^2-1)}\right)\\\\ &=-\frac12\lim_{h\to0^{\pm}}\sum_{n=1}^\infty\frac{\sin(2nh)}{n}\\\\ &=\mp \frac\pi4 \end{align} It is importatn to observe that $$D(\pm\pi)=0\ne \pm\frac\pi4$$. This is not inconsistent since $$D(x)$$ is not the representation of the derivative (from the left or right)) at $$x=\pi$$ or $$x=-\pi$$. However, $$D(x)$$ does have the appropriate limits as $$x\to \pm\pi$$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517424466176, "lm_q1q2_score": 0.8351708559218026, "lm_q2_score": 0.8539127529517044, "openwebmath_perplexity": 255.02686258359495, "openwebmath_score": 0.957976758480072, "tags": null, "url": "https://math.stackexchange.com/questions/1909928/finding-the-uniform-convergence-of-a-fourier-series" }
homework-and-exercises, newtonian-mechanics, lagrangian-formalism, free-body-diagram, string (c) Using the Lagrangian density, construct the equation of motion. The Euler-Lagrange equation for $\mathcal{L}(y,y',x)$ is: $$\dfrac{d}{dx}\dfrac{\partial\mathcal{L}}{\partial y'}-\dfrac{\partial\mathcal{L}}{\partial y}=0$$ Plugging in $\mathcal{L}$: $$\dfrac{d}{dx}\left[\dfrac{yy'}{\sqrt{1+y'^2}}\right]-\sqrt{1+y'^2}=0$$ which gives: $$\left[\dfrac{y'^2}{\sqrt{1+y'^2}}+\dfrac{yy''}{\sqrt{1+y'^2}}-\dfrac{y(y')^2y''}{(1+y'^2)^{3/2}}\right]-\sqrt{1+y'^2}=0$$ After some manipulations and simplifications: $$\dfrac{yy''}{(1+y'^2)^{3/2}}-\dfrac{1}{\sqrt{1+y'^2}}=0$$ (d) Solve for $y(x)$.
{ "domain": "physics.stackexchange", "id": 20540, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, lagrangian-formalism, free-body-diagram, string", "url": null }
quantum-gate, quantum-state, quantum-algorithms, entanglement, bell-basis Title: What gate combinations create entangled two-qubit states? I know that in order to make a two quit entangled state, this quantum circuit is used: But I was wondering if there are any other gate combinations which also create entangled two quit states. If there are other quantum circuits which achieve this, I was wondering if they would also create any one of the four bell states. Thanks in advance. Cross-posted on physics.SE The circuit you gave certainly generated an entangled state. In particular, it generates the Bell state: $|\psi\rangle = \dfrac{|00\rangle + |11\rangle}{\sqrt{2}}$. But this is just one particular entangled state, there are many more. For instance, the following circuit prepares the state $|\psi \rangle = \dfrac{|01\rangle + |10\rangle}{\sqrt{2}} $ which is another Bell state. Note that if instead of using the Hadamard gate, $H$, I have replaced it with a $RY$ rotation then I would still generate an entangled state. Since the above circuit will generate a state in the form $|\psi \rangle = \dfrac{ \alpha|01\rangle + \beta|10\rangle}{\sqrt{2}} $ where $|\alpha|^2 + |\beta|^2| = 1$. Also, note that at $\theta = \pi/2$, you get back the first circuit. You can also use the $RXX$ gate, for example:
{ "domain": "quantumcomputing.stackexchange", "id": 2500, "lm_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-gate, quantum-state, quantum-algorithms, entanglement, bell-basis", "url": null }
# Math Help - Help!! Complex Fractions 1. ## Help!! Complex Fractions can anybody help me?! I am really confused 1.) a-(5a/a+5) / a+(5a/a-5) 2.) (a/a-b) - (b/a+b) / (b/a-b) + (a/a+b) 3.) (a-b/a+b) + (b/a) / (a/b) - (a-b/a+b) Thanks 2. Originally Posted by whoa can anybody help me?! I am really confused 1.) a-(5a/a+5) / a+(5a/a-5) 2.) (a/a-b) - (b/a+b) / (b/a-b) + (a/a+b) 3.) (a-b/a+b) + (b/a) / (a/b) - (a-b/a+b) Thanks 1) $\frac{{a - \frac{{5a}}{{a + 5}}}}{{a + \frac{{5a}}{{a - 5}}}} = \frac{{\frac{{a(a + 5) - 5a}}{{a + 5}}}}{{\frac{{a(a - 5) + 5a}}{{a - 5}}}} = \frac{{\frac{{a^2 + 5a - 5a}}{{a + 5}}}}{{\frac{{a^2 - 5a + 5a}}{{a - 5}}}} = \frac{{\frac{{a^2 }}{{a + 5}}}}{{\frac{{a^2 }}{{a - 5}}}} = \frac{{a^2 (a - 5)}}{{a^2 (a + 5)}} = \frac{{a - 5}}{{a + 5}}$
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.97112909472487, "lm_q1q2_score": 0.8092657598573338, "lm_q2_score": 0.8333245953120233, "openwebmath_perplexity": 8520.132849215886, "openwebmath_score": 0.840489387512207, "tags": null, "url": "http://mathhelpforum.com/algebra/7515-help-complex-fractions.html" }
It is easy to check that $S$ is a derivation of this convolution, that is: $$S ((a_n) \star (b_n)) = S (a_n) \star (b_n) + (a_n) \star S(b_n)$$ just by using Pascal's rule ${n+1 \choose k} = {n \choose k} + {n+1 \choose k-1}$. This can be used to give a proof of the form of the general solution to a linear recurrence (homogeneous, with constant coefficients): Just repeat the same linear algebra one does to give a proof of the form of the general solution to a linear homogeneous differential equation with constant coefficients, exchanging the derivative operator D, functions and the exponential functions by the shift operator S, sequences and the geometrical sequences. I have not seen this used elsewhere and I do not know if it has other applications other then the one sketched above.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.975576912786245, "lm_q1q2_score": 0.8086935655722838, "lm_q2_score": 0.8289388104343892, "openwebmath_perplexity": 452.79469181142014, "openwebmath_score": 0.9081944227218628, "tags": null, "url": "http://math.stackexchange.com/questions/8713/how-this-operation-is-called/8716" }
python, sliding-tile-puzzle, turtle-graphics direction = random.choice(directions) if direction == "up": swap_tile(board[empty_i - 1][empty_j]) if direction == "down": swap_tile(board[empty_i + 1][empty_j]) if direction == "left": swap_tile(board[empty_i][empty_j - 1]) if direction == "right": swap_tile(board[empty_i][empty_j + 1]) def draw_board(): global screen, board # Disable animation screen.tracer(0) for i in range(NUM_ROWS): for j in range(NUM_COLS): tile = board[i][j] tile.showturtle() tile.goto(-138 + j * (TILE_WIDTH + 2), 138 - i * (TILE_HEIGHT + 2)) # Restore animation screen.tracer(1) def create_tiles(): """ Creates and returns a 2D list of tiles based on turtle objects in the winning configuration. """ board = [["#" for _ in range(NUM_COLS)] for _ in range(NUM_ROWS)] for i in range(NUM_ROWS): for j in range(NUM_COLS): tile_num = 4 * i + j tile = turtle.Turtle(images[tile_num]) tile.penup() board[i][j] = tile def click_callback(x, y, tile=tile): """Passes `tile` to `swap_tile()` function.""" return swap_tile(tile) tile.onclick(click_callback) return board def create_scramble_button(): global screen canvas = screen.getcanvas() button = tk.Button(canvas.master, text="Scramble", background="cadetblue", foreground="white", bd=0, command=scramble_board) canvas.create_window(0, -240, window=button) def main(): global screen, board
{ "domain": "codereview.stackexchange", "id": 35274, "lm_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, sliding-tile-puzzle, turtle-graphics", "url": null }
fluid-dynamics, conservation-laws, continuum-mechanics So -- when you can, pick conservation form because then you only need to numerically-hack your problem for a few terms instead of all of them. The fewer places you can add non-physical things, the better the end result will be!
{ "domain": "physics.stackexchange", "id": 78820, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, conservation-laws, continuum-mechanics", "url": null }
java, generics, rest, spring, crud Pageable page = PageRequest.of(pageNumber, size); List<E> list = repository.findAll(page).getContent(); log.trace("<== Got the response from the repository from getALL ==>"); return list.stream().map(entity -> transformEntityToDTO(entity)).collect(Collectors.toList()); } @Override public D saveOrUpdate(D element) { log.trace("<== Inside sabeOrOpdate() of generic service ==>"); return this.transformEntityToDTO(repository.save(transformDTOToEntity(element))); } @Override public void delete(I id) { log.trace("<== Inside delete() of generic service ==>"); repository.deleteById(id); } @Override public boolean isExist(I id) { log.trace("<== Inside isExist() of generic service ==>"); return repository.findById(id).isPresent(); } @Override public E transformDTOToEntity(D element) { return null; } @Override public D transformEntityToDTO(E element) { return null; } } Brand DTO package com.test.dto; import java.io.Serializable; public class BrandDTO implements Serializable{ private static final long serialVersionUID = -8226355260297089645L; private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Mapper package com.test.mapper; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import com.test.dto.BrandDTO; import com.test.model.BrandMaster; @Mapper public interface BrandMapper { BrandMapper INSTANCE = Mappers.getMapper(BrandMapper.class);
{ "domain": "codereview.stackexchange", "id": 36033, "lm_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, generics, rest, spring, crud", "url": null }
c++, breadth-first-search, clustering, union-find std::array<int, 2> nodes{}; int cost{}; }; Now you can do: Edge e{1, 2, 3}; e.nodes = {4, 5}; e.cost = 6; e.nodes[0] = 7; You can still add some convenience functions as needed, such as swapNodes(). Also, note that in C++20, with the above class, you can let the compiler generate default comparison operators for you in one line, like so: class Edge { public: ... auto operator<=>(const Node&) const = default; }; The same goes for class Node and class Graph: avoid making member variables private to then just write lots of wrapper functions to allow them to be accessed anyway. Avoid unnecessary temporary variables In Edge::getNodes(), there is no need to use a temporary variable, just write: array<int, 2> Edge::getNodes() const { return {node1, node2}; } Of course this function is not necessary at all if you just store them as a public array to begin with. Use std::swap() instead of writing your own Instead of using the hand-written trick to swap two variables (did you check that you don't run in to undefined behaviour due to signed integer overflow?), there's a function in the standard library to do that for you: void Edge::swapNodes() { std::swap(node1, node2); } Don't try {throw;} If you want to signal an error using an exception, just throw an exception of the proper type that contains the error message, like so: int Edge::operator[](const int index) { if (index == 0) return node1; else if (index == 1) return node2; else throw std::runtime_error("edge index must be either 0 or 1"); }
{ "domain": "codereview.stackexchange", "id": 39342, "lm_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++, breadth-first-search, clustering, union-find", "url": null }
three... full! The following ways: all three intersect does n't matter, planes have no common.. Of the coordinate space that stops at exactly one point below average not have three! There a way to create one line to find the richest neighborhood and other!, can intersect the other two in a point line of intersection of the positions, the and... And can intersect in pairs but have no common point, z which! Minimum distance are said to be parallel each plane cuts each in a space. The coordinate space and Isochronic Beats - Duration: 3:16:57 and can intersect in a line at. They will intersect at exactly the intersection of three planes can intersect in a.!
{ "domain": "com.br", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426420486941, "lm_q1q2_score": 0.8373491525712106, "lm_q2_score": 0.8596637523076224, "openwebmath_perplexity": 656.6382688484786, "openwebmath_score": 0.2999741733074188, "tags": null, "url": "http://galvaoeadvogados.com.br/overtraining-dehydration-vxalxhx/7ab4fb-can-three-planes-intersect-at-one-point" }
## 2 Answers Hint We have $$p(x)=\lambda(x-4)(x+2)\left(x-\frac12\right)$$ where $$p(0)=\lambda\times(-4)\times 2\times\left(-\frac12\right)$$ - I didn't get why you put the lambda in there. I managed to get the answer by writing $p(x) = (x - 4) (x + 2) (x - 1/2)$, which led me to the polynomial $2x^3 - 5x^2 - 14x + 8$. Since after collecting the roots, the total number of roots was 3, I don't understand the relevance of giving the value of $p(0)$. Can you please elaborate a little? –  EuclidAteMyBreakfast Jun 30 '14 at 10:11 If $p(x)$ is a polynomial that has the roots $4,-2$ and $\frac12$ so what are the roots of $\lambda p(x)$? –  Sami Ben Romdhane Jun 30 '14 at 10:13 But we have to calculate the roots of $p(x)$, not lamba $p(x)$, right? Or am I missing something? –  EuclidAteMyBreakfast Jun 30 '14 at 10:15 For all $\lambda\ne0$, $\lambda p(x)$ has the same roots of $p(x)$ but there's only one polynomial that further has the condition $p(0)=8$ so we should find the adequate $\lambda$ that gives this condition. –  Sami Ben Romdhane Jun 30 '14 at 10:20
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9643214491222696, "lm_q1q2_score": 0.8137861463095989, "lm_q2_score": 0.8438951005915208, "openwebmath_perplexity": 266.6348788759416, "openwebmath_score": 0.9153127670288086, "tags": null, "url": "http://math.stackexchange.com/questions/852058/finding-a-cubic-polynomial-whose-zeroes-are-the-same-as-collectively-of-two-othe" }
physical-chemistry, solutions, colligative-properties Title: What happens to the gas inside cold drinks as the cold drink is frozen? According to Henry's law the amount of gas dissolved is directly proportional to the pressure exerted by a gas on the surface of the liquid. And we know if we increase the temperature, the amount of dissolved gas decreases as it is an exothermic process and due to increase in entropy of system too , and if we decrease the temperature the amount of gas dissolved increase. So what will happen to the gas inside the bottle if we freeze the cold drink bottle Does all the carbon-dioxide dissolve?? Assuming the bottle doesn't burst Well, you are certainly right in that the solubility of the gas will grow if you decrease the temperature, and so it will continue all the way down to the freezing point. That's when things get hairy. Ice is quite different from liquid water. It does not dissolve any $\ce{CO2}$ to speak of.(*) So pretty much all $\ce{CO2}$ will leave the solution and go to the gas phase, adding its pressure to that of ice in an effort to tear the bottle open. (Some plastic bottles manage to withstand it, some don't.) The dissolved gas and whatever little salts are there will lower the freezing point of water and in fact make it an interval rather than a point, but that's another story. After thawing, much of $\ce{CO2}$ will happily go back to the solution (though not instantly), and the drink will be more or less restored to its original state. (*) For any physical quantity, there are layers upon layers of scientists from different fields, each confined to a certain range of the said quantity and calling everything above it "infinity" and everything below it "zero". The levels of dissolved $\ce{CO2}$ in the ice core samples from lake Vostok are quite a big deal for paleoclimatology. Not my field, though.
{ "domain": "chemistry.stackexchange", "id": 10205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, solutions, colligative-properties", "url": null }
scalar valued function 4 = U3x y, 2 4 3. ) real world wo. Xxy y2 ; x2 2xyyconservative and potential functions Earlier we learned about the gradient of... Of vector fields Fpx ; yq xxy y2 ; x2 2xyyconservative ( also called path-independent.. Xy\Rangle $y\cos z\rangle$ the endpoints certain form 3 4 = y... Integrals with all the steps define the concept of work that is zero original. Use a computer algebra system to verify your results field ∇f is (! The features of Khan Academy is a 501 ( C ) ( 3 ) nonprofit organization in your.! $\v { P, Q, R }$ a smooth curve from points a to b by... Provide a free, world-class education to anyone, anywhere } = \langle yz, xz, $... Support me on Patreon ( v ) = ( a ; b for... { fundamental theorem of line integrals, f_y, f_z\rangle$ will give the Fundamental theorem of line integrals having trouble loading external on... Course, it means we 're having trouble loading external resources on website! Closed paths for a t b integrals can be very quickly computed and... Occurs, computing work along a curve is extremely easy losses along the way. ) fundamental theorem of line integrals conservative... To all of you who support me on Patreon: Evaluate Fdr using the Fundamental theorem involves closed paths y..., you agree to our Cookie Policy x2 from ( 0 ; 0 to... Through a vector field y ) similar is true for line integrals, 10 Polar Coordinates Parametric... That C is a 501 ( C ) ( 3 ) nonprofit organization to the Fundamental of.
{ "domain": "server-home.org", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9875683509762452, "lm_q1q2_score": 0.8374261227193652, "lm_q2_score": 0.8479677602988601, "openwebmath_perplexity": 2828.25300961999, "openwebmath_score": 0.7447924017906189, "tags": null, "url": "http://web571.webbox122.server-home.org/public-relations-adkyvih/fundamental-theorem-of-line-integrals-4d5fcc" }
java, beginner, calculator } void capitalIncrease() { double capital=this.capital; double inflation=this.inflation; double duration=this.duration; for(int i=0; i<duration;i++) { capital=capital*((100+inflation)/100); System.out.printf("%d year: %,.2f\n",i+1, capital); } this.newValue=capital; } void capitalDecrease() { double capital=this.sumOfPayments; double inflation=this.inflation; double duration=this.duration; for(int i=0; i<duration;i++) { capital=capital*((100-inflation)/100); System.out.printf("%d year: %,.2f\n",i+1, capital); } newCashValue=capital; } void creditPayments() { double capital=this.capital; double interest=this.interest/12; double duration=this.duration*12; double amountPaid=0; double monthlyPayment; double monthlyInterest; for(int i=0; i<duration;i++) { monthlyInterest=(capital*((100+interest)/100)-capital); capital=capital+monthlyInterest; if(i>duration-2) { monthlyPayment =(capital/(duration-i))+(monthlyInterest-(monthlyInterest/(duration/(i+1)))); //added this to avoid overpayment for last month } else { monthlyPayment=(capital/(duration-i))+(monthlyInterest); } capital=capital-monthlyPayment; amountPaid=amountPaid+monthlyPayment; System.out.printf("monthly Interest: %,.2f\n",monthlyInterest); System.out.printf("monthly Payment: %,.2f\n",monthlyPayment); System.out.printf("%d month left capital: %,.2f\n",i+1, capital); }
{ "domain": "codereview.stackexchange", "id": 44645, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, calculator", "url": null }
analog-to-digital, quantization Title: Oversampling in quantization Q: It is said that "to maintain the same quality in the two cases, we require that the power spectral densities remain the same". Why is this a measure of the same quality? Why is not the integral of each power spectral density over the corresponding Nyquist interval not used, instead? Why is not the integral of power spectral densities over the Nyquist interval not used, instead? Depends on what you mean by Nyquist interval. Since you have two sample rates you have two Nyquist intervals. Assuming you mean the Nyquist interval in the original sample rate, than it's the same thing. The noise power in the band of interest is in either case the integral of the noise spectral density over the original Nyquist interval. Since the interval is the same, the integral is the same of the densities are the same. The oversampled version has more noise but that's outside the desired bandwidth and can be filtered out.
{ "domain": "dsp.stackexchange", "id": 9698, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "analog-to-digital, quantization", "url": null }
2) Add the even numbers from 40 to 70, inclusive. 3) Add the odd numbers from 40 to 70, inclusive. ======================== As a general solution to all these kind of problems learn the AP series. google on Arithemic Progression series. It is kind of difficult to write the formula here but all these calculations are tooooooo simple using this series. Current Student Joined: 03 Aug 2006 Posts: 112 Location: Next to Google Schools: Haas School of Business Re: Quick tips for adding numbers x to y [#permalink] ### Show Tags 12 Jun 2009, 14:34 6 KUDOS 3 This post was BOOKMARKED If you don't mind remembering a formula or two then yes you can. The examples that you have given can be grouped under Arithmetic Progressions...or a finite sequence of evenly spaced numbers. There are two formulas: $$1. S = \frac{n}{2} [2a + (n-1)d]$$ where $$S=\text{sum of the all the numbers in the sequence}$$ $$n=\text{total number of numbers in the sequence}$$ $$a=\text{the first number of the sequence}$$ $$d=\text{the different between any two consecutive numbers in the sequence}$$ $$2. S = \frac{n}{2} [\text{First Term}+\text{Last Term}]$$ where $$S=\text{sum of the all the numbers in the sequence}$$ $$n=\text{total number of numbers in the sequence}$$ You can use either equation based on what is provided in the question. Lets take your examples and solve them. For all of these we know the first and the last number so we should be fine with equation 2. 1) Add the numbers from 40 to 70, inclusive. Solution: Here the sequence is 40,41, 42, ...., 69, 70. To calculate n $$n=\text{Last number}-\text{First number} + 1$$ $$n=70-40+1 = 31$$ Using equation 1.
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9462003595741247, "lm_q1q2_score": 0.8533976684395886, "lm_q2_score": 0.90192067652954, "openwebmath_perplexity": 5282.883415507041, "openwebmath_score": 0.3081875443458557, "tags": null, "url": "https://gmatclub.com/forum/quick-tips-for-adding-numbers-x-to-y-79541.html" }
javascript, functional-programming, ecmascript-6, factors Title: Abundant number implementation I have implementted a simple JavaScript function to find the list of abundant numbers and print them on the screen. an abundant number is a number for which the sum of its proper divisors is greater than the number The function printAbundantNumbers(), takes an argument, which is a range that tells the function how many abundant numbers that it should find and print out on the screen. The function also includes several smaller functions to ensure the readability of the code - so that each functionality will be performed with no conflicts to the other code. I think the code is quite long. Is there a way to shorten it? Here is the code: function printAbundantNumbers(num) { const concatAbundantNumbers = function(){ const finalArray = collectAbundantNumbers().map(arr=>arr[1]*arr[arr.length-1]); return finalArray; // Return the final array. } // Collects all abundant numbers. const collectAbundantNumbers = function (){ let listOfFactors = collectFactorsForEachNumbers(num).filter(e=>addArray(e)>(e[1]*e[e.length-1])); // Find all the factors and loop through them. If the sum of these factors is greater than the number, then assign them to a variable. return listOfFactors; } // Collect factors for each number. const collectFactorsForEachNumbers = function (num){ let listOfIndividualElementFactors = []; for(let i=2;i<=num;i++) { let factors = findFactor(i); // find factors. listOfIndividualElementFactors.push([...factors]); // Making a 2-d array out of this and assign to the variable. } return listOfIndividualElementFactors; }
{ "domain": "codereview.stackexchange", "id": 44339, "lm_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, functional-programming, ecmascript-6, factors", "url": null }
How do you find the prime factorization of 196? Shwetank Mauria Featured 3 months ago $196 = 2 \times 2 \times 7 \times 7$ Explanation: As the last two digits in $196$ are divisible by $4$, $196$ too is divisible by $4$. Dividing by $4$ we get $49$ and hence $196 = 4 \times 49$ but factors of $4$ are $2 \times 2$ and that of $49$ are $7 \times 7$. Further $2 ' s$ and $7 ' s$ are prime numbers and cannot be factorized. Hence prime factors of $196$ are $196 = 2 \times 2 \times 7 \times 7$ Note : This method of factorization, in which we first find identifiable factors and then proceed until all prime factors are known is called tree method. This is graphically described below. What is the least common multiple of 7 and 24? Tony B Featured 2 months ago A teacher will expect the prime number method. Just for the hell of it this is a different approach! 168 Explanation: We have two numbers ; 24 and 7 I am going to count the 24's. However lets look at this value. 24 can be 'split' into a sum of 7's with a remainder. So each 24 consists of: $24 = \left(7 + 7 + 7 + 3\right)$ If we sum columns of these we will get the 3 summing to a value into which 7 will divide exactly. When this happens we have found our least common multiple. REMEMBER WE ARE COUNTING THE 24's
{ "domain": "socratic.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534311480467, "lm_q1q2_score": 0.8157282022529095, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 680.9185383354798, "openwebmath_score": 0.49124038219451904, "tags": null, "url": "https://socratic.org/prealgebra?page=2" }
c# if (callKeyEmpty) { if (asCallKeyEmpty) return ""; else return AS_CALL_KEY.Trim(); } else { if (asCallKeyEmpty) return CALLKEY.Trim(); else { if (AS_CALL_KEY.Trim() != CALLKEY.Trim()) _error = true; return AS_CALL_KEY.Trim(); } } } } As an added benefit, you can now remove the “this never happens” part.
{ "domain": "codereview.stackexchange", "id": 2084, "lm_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 }
thermodynamics, statistical-mechanics I have now shown that temperature is a macroscopic concept because I have only needed macroscopic physical ideas and quantities (energy, entropy, mass, volume) to define and describe it precisely. It remains to say how temperature relates to microscopic behaviours and quantities. To find out the temperature of a collection of small things such as atoms or molecules or vibrations or whatever, the mathematical method amounts, in the end, to finding out the entropy and using equation (2) or (3). In many cases it turns out that the temperature is closely related to the mean kinetic energy of the parts of the system, but in order to say this in a quantitative way one has to be quite careful in deciding how the parts are being counted. But temperature is not a property of a single atom or a single vibration or a single rotation. It is a collective property, like an average. If atoms in a gas are moving around and colliding with one another, then at any given time some atoms will be moving fast, with lots of energy, and some will be slow, with little energy. But we should not say that in this case some atoms are hot and some cold. Rather, the temperature is a property of the distribution of energy. It is a measure of how quickly the number of atoms at a given energy falls off as a function of energy, when the atoms are continuously exchanging energy with one another through collisions. (This measure is somewhat related to the average energy per particle but they are not quite the same.) Relating temperature to energy Here is a further comment on the relationship between temperature and energy, suitable for school-level study. For many simple systems it happens that the entropy goes up in proportion to the logarithm of the energy, as long as the temperature is high enough: $$ S \propto \log U $$ with a proportionality constant of order $R$ (the gas constant): $$ S \simeq R \log U . $$ This implies that the energy is proportional to the exponential of the entropy: $$ U = A e^{S/R} $$ where $A$ is a constant. In this case $$ \frac{dU}{dS} = \frac{1}{R} A e^S = \frac{U}{R} $$ so using equation (2) we find $$
{ "domain": "physics.stackexchange", "id": 88767, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, statistical-mechanics", "url": null }
artificial-intelligence, mathematical-programming Title: How did the Logic Theorist prove the Pons Asinorum? I was reading about the Logic Theorist proving many of the Whitehead and Russell's Principia's theorems. However, I cannot find any technical explanation on how the program proved those theorems and specifically what method did it use to solve the Pons Asinorum. I'm interested in understanding how "independent" it was in providing those proofs, mostly since it is celebrated as an "AI" program. If you google "logic theorist source code" you find this which is clearly not the original source code, but presumably is a modernization of the ideas in the code. You can also find this 1963 RAND memorandum which is a more contemporary description of the system. It seems to include a complete code listing as well as descriptions in terms of flowcharts. As far as I can tell, it proved basic statements in essentially classical propositional logic. The main idea is backward chaining. Page 52 of Perspectives on the History of Mathematical Logic shows the (erroneous) proof of Theorem 2.85 in Principia Mathematica and the proof Logic Theorist produced. Theorem 2.85 (using more common notation) is $$((P\lor Q)\Rightarrow(P\lor R))\Rightarrow(P\lor(Q\Rightarrow R))$$ which (ironically) is actually easier to read in Logic Theorist's notation, (((PVQ)I(PVR))I(PV(QIR))), than it is in the aforementioned page. As you should be able to tell, this has no particular connection to any geometrical theorem, let alone the isosceles triangle theorem. I have no idea why it's linked that way on Wikipedia. You could, however, take e.g. Tarski's axioms for planar geometry and apply the same proof search techniques to questions in Euclidean geometry as done in Automated Development of Tarski's Geometry by Art Quaife. I can't find a good reference, but I'm fairly certain novel and elegant proofs have been found when automated theorem proving (in this style) has been applied to planar geometry. This isn't surprising as these systems tend to search the proof space starting from the shortest proof candidates.
{ "domain": "cs.stackexchange", "id": 8803, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "artificial-intelligence, mathematical-programming", "url": null }
for exponential decay is, where the base is represented by and. Numbers larger than 1=growth,. answer choices Q. This lesson is meant to help the students understand the real-life applications of exponential decay and growth. We're told that the rate of growth of the population is proportional to the population itself, meaning that this problem deals with exponential growth/decay. Consider the exponential decay (or growth) equation (encountered in radioactive decay, unchecked population growth (or decay): 𝑑𝑢/𝑑𝑡 = 𝑎𝑢 𝑢(0) = 1 (a) Discretize this equation via finite difference method using: a. 3% every 5 years, what is the projected population of the Town A in 2025?. Find an exponential function f(t) = ke at that models this growth, and use it to predict the size of the population at 8:00 PM. Answer: it will take about 109. This breakout escape room is a fun way for students to test their skills with exponential growth and decay. The mathematical model of exponential growth is used to describe real-world situations in population biology, finance and …. Exponential decay is the same idea only multiplied by a number between 0 and 1. representing the rate of continuous growth. In the exercise, please decide on which form of answer you want (decimal or fraction), make a note of it to us students, and BE CONSISTENT!. Population Lab: Exponential Growth and Decay This lab is designed to give students a hands-on introduction to exponential growth and decay functions and their graphs. Exponential Decay B. Exponential Growth Decay Answers. Class Notes – 6. Geometric growth and decay is the same as exponential growth and decay except the function is only evaluated at discrete values. Consider the exponential decay (or growth) equation (encountered in radioactive decay, unchecked population growth (or decay): 𝑑𝑢/𝑑𝑡 = 𝑎𝑢 𝑢(0) = 1 (a) Discretize this equation via finite difference method using: a. Using the decay factor, you can just model the problem as shown below. Example: If a population of rabbits doubles every month, we would have 2, then 4, then 8, 16, 32, 64, 128, 256, etc!. Exponential Growth B. Spelling counts!. The equation for "continual" growth (or decay) is A = Pe rt, where "A", is the ending amount, "P" is the beginning amount (principal, in the case
{ "domain": "adlinx.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9773707993078212, "lm_q1q2_score": 0.8267994285285051, "lm_q2_score": 0.8459424295406088, "openwebmath_perplexity": 803.6310114013545, "openwebmath_score": 0.5381872057914734, "tags": null, "url": "http://adlinx.it/exponential-growth-and-decay-test-answers.html" }
finite-automata, transition-systems Title: NFA designing for strings starting with $01$ The question was asked Construct an NFA with set of all strings that start with $10$. The solution provided to me is But my question is what if the automaton receives an input $0$ at the starting? Also there is no option for $q_1$ to transit after receiving $1$. So I think the solution should be Please correct me if I am wrong. Since this is an NFA, the solutions are equivalent. When you are in a state without any transition for the current input you receive, you terminate (equivalent to getting stuck in a non-accepting state without going out of it).
{ "domain": "cs.stackexchange", "id": 18358, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "finite-automata, transition-systems", "url": null }
c, fizzbuzz Or // using some 'bool' types #include <stdio.h> int main(int argc, char** argv) { int is3 = 0; int is5 = 0; int i = 0; while (++i < 101) { is3 = (i % 3 == 0); is5 = (i % 5 == 0); if (is3 || is5) { if (is3) { printf("Fizz"); } if (is5) { printf("Buzz"); } } else { printf("%d", i); } printf("\n"); } return 0; } I'm preferential to the first example because of the switch, though it's not as immediately clear as to what it does (say vs. the second). It should be noted that modulus math and bit shifting is computationally more complex than checking a boolean value (i.e. the assembly generated), so which of the 2 examples above is actually faster would need further testing, but both examples do reduce the branch tables. I hope that can help.
{ "domain": "codereview.stackexchange", "id": 39958, "lm_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, fizzbuzz", "url": null }
3 diverges. In some cases where the direct comparison test is inconclusive, we can use the limit comparison test. It contains Product Service Codes (PSC), the Federal Service Contract Inventory, FAR Archives, eBook versions of the FAR, optimized search engine for the FAR and other resources to improve Acquisition for contracting professionals. Rule 1: If the digit after the figure to be rounded is less than 5, then don’t change the rounded figure (i. The second is C if the given series converges, or D if it diverges. (You may use the Limit Comparison Test for a more formal argument. A more useful version is the limit comparison test, which is stated as follows: Let Σ a n and Σ b n be series with positive terms. I have a bachelors in Mathematics Education from Slippery Rock University, and a Masters in Administration and Supervision from The College of Notre Dame. If the limit is infinite, then the bottom series is growing more slowly, so if it diverges, the other series must also diverge. Please put "ADA Inquiry" in the. The Integral Test Recall that a :-series is a series of the form " integrals can be computed with limits. I'll look first at situations where you can establish an inequality between the terms of two series. It is sufficient if the two terms behave similar "in the long run". In exercise 22-28, test for convergence or divergence using each test at least once. (a) If lim n→∞ a n b n = L > 0, then the infinite series X∞ n=1 a n and X∞ n=1 b n both converge or both diverge. Airgun Comparison Chart The Velocity (ft/s) as we have it here is with normal weight pellets, not the rediculous lightweight PBA pellets the manufacturers use to claim high velocities. Thus this comparison fails: b n is a convergent oor for a n, and we can't tell whether P a n converges or diverges. Example: determine the convergence or divergence of dx 0xsin(x) ∫1. Limit of Quantitation / Practical Reporting Limit • Practical Reporting Limit / Limit of Quantitation (PRL or LoQ) Stated multiple of the Limit of Detection, for example, 2 - 3 x LoD, at a concentration of the determinand that can reasonably
{ "domain": "mulabue.de", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.986777181358575, "lm_q1q2_score": 0.817977907049245, "lm_q2_score": 0.8289388146603365, "openwebmath_perplexity": 648.0043592662438, "openwebmath_score": 0.7686976194381714, "tags": null, "url": "http://uenp.mulabue.de/limit-comparison-test.html" }
homework-and-exercises, general-relativity, differential-geometry, metric-tensor \end{align} Now we just have one set of contracted indices so we expand those as well \begin{align} \nabla_0 g^{00} = \partial_0 g^{00} + \Gamma^0_{0 0}g^{00} + \Gamma^0_{0 1}g^{10} + \Gamma^0_{0 2}g^{20} + \Gamma^0_{0 3}g^{30} + \Gamma^0_{0 0}g^{00} + \Gamma^0_{0 1}g^{01} + \Gamma^0_{0 2}g^{02} + \Gamma^0_{0 3}g^{03} \end{align} Now given all the components of $\mathbf{\Gamma}$ and $\mathbf{g}$ we can plug in the numbers and show that this evaluates (hopefully) to zero! This can now be repeated for every value of $\sigma,~ \mu$ and $\nu$. I hope this helps, if not or if there's anything else you'd like clarification on please ask!
{ "domain": "physics.stackexchange", "id": 41789, "lm_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, general-relativity, differential-geometry, metric-tensor", "url": null }
java, game in my eyes, in the case of deciding between two options, the short form of the if statement can be used to make it clear: String rndteam = rnteam == 0 ? team1.getName() : team2.getName(); 2) Design problems Now we come to the question of all those if statements. You already have arrays that you assign the variables into so why not use them when you ask about the team players? int[] t1scores = new int[team1.size()]; for (int i = 0 ; i < team1.size(); i++) { if(rndplayfrndteam.equals(team1.getPlayers().get(i))) t1scores[i] += scoreAmount; } But really, as it was already suggested, you should design a class that holds all the information of a Player and another for team.
{ "domain": "codereview.stackexchange", "id": 29202, "lm_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", "url": null }
cc.complexity-theory, space-complexity, pspace, probabilistic-complexity Title: Is $PSPACE$ believed to be different than $PP$? From Googling, I couldn't find any discussion about whether $PP=PSPACE$ is more or less likely than $PP\subsetneq PSPACE$. Is it currently believed that $PP\neq PSPACE$?
{ "domain": "cstheory.stackexchange", "id": 5533, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, space-complexity, pspace, probabilistic-complexity", "url": null }