qid
int64
1
4.65M
metadata
listlengths
3
3
prompt
stringlengths
31
25.8k
chosen
stringlengths
17
28.2k
rejected
stringlengths
19
40.5k
domain
stringclasses
28 values
245,554
[ "https://dba.stackexchange.com/questions/245554", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/187883/" ]
I have the following table describing the color and smell of an animal. I am trying to filter it to see what animals are the same color and smell. I do not care if multiple animals use the same color or use the same smell, but if they use the same color AND smell, that is what I want to see. I have tried using <code>...
<pre><code>WITH cte AS ( SELECT *, COUNT(*) OVER (PARTITION BY color, smell) cnt FROM animals ) SELECT name, color, smell FROM cte WHERE cnt &gt; 1 </code></pre> PS. <code>color</code> and <code>smell</code> must be NOT NULL.
You can join table with itself to find matching animals and use exists to verify match: <pre><code>SELECT * FROM Animals AS A WHERE EXISTS (SELECT 1 FROM Animals AS MatchingAnimal WHERE A.color = MatchingAnimal.color AND A.smell = MatchingAnimal.smell AND A.Name != MatchingAnimal.Nam...
https://dba.stackexchange.com
160,963
[ "https://mathoverflow.net/questions/160963", "https://mathoverflow.net", "https://mathoverflow.net/users/40458/" ]
What is the asymptotic number of square-free numbers less than $x$ with exactly $k$ prime divisors?
All this is taken from Section 7.4 of Montgomery-Vaughan's <em>Multiplicative Number Theory I. Classical Theory</em>. <strong>Theorem 7.19</strong>: The number of integers up to $x$ with exactly $k$ prime divisors counted with multiplicity is $$ \frac{F((k-1)/\log\log x)}{\Gamma(1+(k-1)/\log\log x)} \frac{x(\log\log x...
Also Theorem 437, section 22.18 (page 368 in edition 5) of Hardy and Wright. $$ \pi_k(x) \sim \frac{x (\log \log x)^{k-1}}{(k-1)! \log x} $$
https://mathoverflow.net
396,856
[ "https://softwareengineering.stackexchange.com/questions/396856", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/344706/" ]
I am new to UML and I have a best practices question. I would like to model separately: <ul> <li>logical architecture: logically interconnected software components;</li> <li>physical architecture: physical installations of operating systems with possibility of physical interconnections like Ethernet;</li> <li>mapping ...
I don't have a proof for this, but my gut feeling tells me that this is reducible to either the <em>Halting Problem</em> or <em>Rice's Theorem</em>, which would mean that such a thing <em>cannot possibly exist</em>. There's also the very practical problem that "making a function idempotent" that is not already idempot...
"Idempotent" describes an aspect of the <em>behavior</em> of a function... If you want your function to be idempotent, you have to make it behave idempotently. You cannot take a non-idempotent function and make it idempotent by simply marking it with a label or an attribute, because that would have to change its behavi...
https://softwareengineering.stackexchange.com
367,395
[ "https://softwareengineering.stackexchange.com/questions/367395", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/298320/" ]
When developping a project I follow the OOP principles and break my code into classes and most of the time I go for one file = one class. Now I dont know how to organize my code into the class and even into my own functions/methods I'm still looking for ways to improve the readability. I think the general consensus i...
Quit procrastinating. Don't waste your time with this stuff. Modern tools facilitate jumping around to parts of the code so effectively you could order a classes functions and properties almost completely randomly and most folks wouldn't even notice. There are tools that can do it for you if it's really that importan...
If you're asking this for your own, personal projects, then @whatsisname nailed it. If you're joining a team, take a look at some of the existing code, and use their style.
https://softwareengineering.stackexchange.com
2,019,296
[ "https://math.stackexchange.com/questions/2019296", "https://math.stackexchange.com", "https://math.stackexchange.com/users/373762/" ]
$$S = \sum_{i = 1}^{\infty} \frac1 {2^i + 1}$$ How to calculate this sum? I calculate it on MatLab and the answer seems to be 0.764499780348444, how to get it?
Here is one example. You may have heard about the 3-dimensional Poincare Conjecture (<em>if $M$ is a compact, without boundary, simply-connected 3-dimensional manifold, then $M$ is homeomorphic to $S^3$</em>). Here is how it was proven by Gregory Perelman, broadly speaking: <ol> <li>$M$ is known to admit a smooth stru...
For me, the Killing-Hopf theorem is interesting because it tells you that a complete connected Riemannian <span class="math-container">$n$</span>-manifold <span class="math-container">$M$</span> with constant non-positive sectional curvature is a classifying space <span class="math-container">$B\Gamma$</span> (i.e. an ...
https://math.stackexchange.com
362,774
[ "https://mathoverflow.net/questions/362774", "https://mathoverflow.net", "https://mathoverflow.net/users/159426/" ]
I am requesting your help today trying to solve a somewhat odd problem. Is there a way to find through some numerical algorithm such as Newton's method the stochastic matrix <span class="math-container">$\boldsymbol{P}$</span> having stationary distribution <span class="math-container">$\boldsymbol{\pi}$</span> (column...
If you make the objective to minimize the sum of the diagonal entries (i.e. the trace), your problem becomes a linear programming problem, solvable with readily available software (I think even Excel). In many cases the optimal solution will have all diagonal entries <span class="math-container">$0$</span>. EDIT: It ...
The following is too large for a comment and definitely not an answer. Fix <span class="math-container">$n \in \mathbb{N}$</span> and let <span class="math-container">$\cal{P}$</span> be the set of stochastic <span class="math-container">$n \times n$</span>-matrices with <span class="math-container">$\text{diag}(P) = ...
https://mathoverflow.net
169,497
[ "https://physics.stackexchange.com/questions/169497", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/43398/" ]
I know that when a positive charge is placed at the center of a circular ring, the "inside" of the ring will have a negative induced charge and the "outside" will have a positive induced charge. Consider the following mobius strip <img src="https://i.stack.imgur.com/Yep1h.jpg" alt="enter image description here"> If ...
So in the first case, when talk about a plain circular ring, I assume you mean an annular ring, with a well defined inner radius and a different well defined out radius. With a positive charge at the center of the annular ring, positive charges will be repelled outward and negative charges attracted inward. Incidentall...
Just answering the second question (since the first was well covered already): Grounding works the same that it always does - it means there is no longer a constraint that the net charge on the ring is zero. Charges will distribute to minimize energy - if there is a negative charge in the center of the ring, negative ...
https://physics.stackexchange.com
708,811
[ "https://physics.stackexchange.com/questions/708811", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/290438/" ]
When calculating the average electrostatic field over a spherical volume due to a point charge within the volume, how do we account for the electric field arbitrarily close to the point charge? What about directly at the point charge position? the integral is supposed to find the electric field at every volume element,...
You can divide the space region of integration <span class="math-container">$V$</span> into two regions: <ol> <li>a sphere centered at the point charge; the sphere is chosen small enough so that it is entirely in the region over which the averaging is done; </li> <li>the rest of the region <span class="math-container">...
The singularity is integrable! The absolute value of the electric field grows as <span class="math-container">$\frac{1}{r^2}$</span> and in three dimensions this can be integrated (for example in a spherically symmetric situation in spherical coordinates this cancels with the <span class="math-container">$4\pi r^2 \tex...
https://physics.stackexchange.com
227,194
[ "https://electronics.stackexchange.com/questions/227194", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106186/" ]
I am trying to use the timers on the microcontroller in order to count up to 10us then add 1 to the int timer. I intend to use this in a project I am doing where I count the time between pulses from a circuit I have built. The code is as flows: <pre><code>#include &lt;msp430fr4133.h&gt; #include &lt;driverlib.h&gt; u...
CL is right, your use of <code>~COV</code> is wrong and is ruining your other settings. Here is what happens: COV is defined in memory as: <pre><code> #define COV (1 &lt;&lt; 1) </code></pre> Inverting COV (with <code>~COV</code>) does not just invert that bit, it actually inverts the entire COV field. So if you kno...
The interrupts were not correctly enabled! The way this was fixed is by using <code>__enable_interrupt();</code>. This function fixed the interrupts and allowed them to work.
https://electronics.stackexchange.com
24,631
[ "https://electronics.stackexchange.com/questions/24631", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/771/" ]
This should be pretty straight forward, but my google-ing is not turning anything up... I can build my project successfully in TI Code Composer Studio (CCSv5) and target my device. Now I want to know my program code size, so that I know how much space I have for future growth etc. When I develop for AVRs in eclipse w...
Set up your project to output a "MAP" file. This gives all of the memory use information. In CCS4, the project properties "Basic Options" under the linker options will do this. From command line, use "--map_file". The map file will show up in the Debug or Release folder. The first section will look something like ...
CCSv5 has a graphical memory use display. Select View -> Other -> Code Composer Studio -> Memory Allocation. The first time I used this, it needed to set up some configuration for the project .... but it prompted for everything and was relatively simple.
https://electronics.stackexchange.com
150,624
[ "https://electronics.stackexchange.com/questions/150624", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/27067/" ]
Is it possible to build a DC-DC converter by means of a piezo crystal followed by a voltage multiplier? The crystal would supply the AC voltage needed by the voltage multiplier. I'm looking to get around 60~70 V from an Arduino 5V pin, and don't require much current(around 0.5mA). Specifically, I'd use 5V to excite th...
So turns out that that family of PICs has an ADC module that automatically takes priority over any other components and prevents pins from causing interrupts until it is disabled. Added some disable code to the main hardware initialization function to disable the ADC on all pins and it works a treat now.
That PIC has a separate interrupt vector for UART errors.<br> I think that you'll find that your UART is stuck in an unhandled error condition and is refusing to receive any more data.<br> I'd suggest you move your overrun and framing error checking &amp; handling code to a new _U1ErrInterrupt handler.
https://electronics.stackexchange.com
223,887
[ "https://mathoverflow.net/questions/223887", "https://mathoverflow.net", "https://mathoverflow.net/users/76736/" ]
Let $\Sigma_k$ be the $k$-th symmetric group and $B\Sigma_k$ be its classifying space. How to prove: for any $n\geq 1$ and the $n$-skeleton $sk_n (B\Sigma_k)$, there exists a finite dimensional $CW$-complex $K$ such that (i). $sk_n(B\Sigma_k)\subseteq K\subseteq B\Sigma_k$; (ii). $H^*(K;\mathbb{Q})$ is trivial? Cou...
Take the $n$-skeleton. It has trivial rational homology except possibly in degree $n$. Now add enough $n+1$-cells from the $n+1$-skeleton to kill this top homology. You won't have created any $n+1$-dimensional homology since the boundary operator $\partial_{n+1}\colon C_{n+1}\to C_n$ is a rational isomorphism onto $\k...
If you want to prove that group cohomology $H^{\ast}(\Sigma_{n},\mathbb{Q})=0$ you use the fact that $\mathbb{Q}$ is a projective $\mathbb{Q}[\Sigma_{n}]$-module (Maschke’s theorem) therefore by definition $$H^{\ast}(\Sigma_{n},\mathbb{Q})=Ext^{\ast}_{\mathbb{Q}[\Sigma_{n}]}(\mathbb{Q},\mathbb{Q})=0$$ for $\ast &gt;0$....
https://mathoverflow.net
4,374,659
[ "https://math.stackexchange.com/questions/4374659", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1022316/" ]
I came across this statement in my math textbook: <span class="math-container">$$\exists x\in\mathbb{Q}\ :\ \forall y\in\mathbb{R}\setminus\mathbb{Q},\ xy\in\mathbb{Q}$$</span> The only number <span class="math-container">$x$</span> for which it's true (that I can think of) is <span class="math-container">$0,$</span> a...
Take a look at this <span class="math-container">$(z \neq 0)$</span>: <span class="math-container">$$ f(z)-f(0) = \frac{z^2}{\lvert z \rvert^2} - 1 = \frac{z^2-\lvert z \rvert^2}{\lvert z \rvert^2} $$</span> Then take the sequence <span class="math-container">$z_n := \frac{i}{n}$</span> that clearly converges to <span ...
If <span class="math-container">$f$</span> was continuous at <span class="math-container">$0$</span>, then its restriction to <span class="math-container">$\Bbb R i$</span> (the set of purely imaginary complex numbers) would also be continuous at <span class="math-container">$0$</span>. But<span class="math-container">...
https://math.stackexchange.com
316,296
[ "https://electronics.stackexchange.com/questions/316296", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/151135/" ]
Basically I am making a solar inverter without any battery or charge controller that will directly convert the dc output coming from solar panels (6 connected in parallel) into 220V AC.I am using solar panels 50W each, having an open circuit voltage of 20V and the voltage varies between 15-20V during the entire day pro...
You need a bigger soldering iron, as in "more power." The square connections are in the ground plane of the board. That is the large yellow area they are embedded in. That is a large piece of copper, and there are probably also large copper surfaces on the internal layers of the board. Copper conducts heat very well...
<blockquote> Is there a special technique or tool I need to perform this task? </blockquote> Nothing special but try to get hold of a rework station with blower. As pointed out by others, the square ones are indeed ground plane which require a bit more time to heat up due to the large surface area. Using the blower ...
https://electronics.stackexchange.com
24,448
[ "https://dba.stackexchange.com/questions/24448", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/12705/" ]
I have a Microsoft Access database that is connected to a MySQL server via ODBC and is accessed by multiple users. Over time many records are locked and editing is not possible anymore. Is there a way to bulk unlock all records? The Error Message: <blockquote> This record has been changed by another user since y...
<strong>I finally could fix my problem</strong> by adding a field named <code>TIMESTAMP</code> of type <code>timestamp</code> and default value <code>CURRENT_TIMESTAMP</code> and <code>attribute = on update CURRENT_TIMESTAMP</code>. Then i updated all records and set <code>TIMESTAMP=NOW()</code>. For now i did not get...
To help you troubleshoot this, here is a very important piece of information to keep in mind: Locks, in MySQL, whether they are on rows, tables, advisory/named locks, and even the global FLUSH TABLES WITH READ LOCK are held by continued existence of the specific connection thread that obtained the lock. When I say "c...
https://dba.stackexchange.com
2,777,476
[ "https://math.stackexchange.com/questions/2777476", "https://math.stackexchange.com", "https://math.stackexchange.com/users/331302/" ]
Knowing the (x,y,z) coordinates of the two endpoints of a line segment in 3D space, how can I calculate the point on the line segment that is a minimum distance to the x-axis? EDIT: Assume it is known that neither endpoint of the line segment is the closest point, so we must calculate which point along that line segme...
Answering edited question (original answer to original question follows): The distance of a point from the x-axis is $\sqrt{y^2+z^2}$, so it suffices to minimize $y^2+z^2$. A line can be parameterized as $(x,y,z)=(f(t),g(t)h(t))$ for linear $f, g, h$. You need to minimize $g(t)^2+h(t)^2$, which is a quadratic polynom...
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \new...
https://math.stackexchange.com
75,578
[ "https://cs.stackexchange.com/questions/75578", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/71879/" ]
It's complexity is $\mathcal{O}(\log^6n)$ and $\log^6n$ is not a polynomial. Can we say that primality testing is <strong>strictly</strong> contained in $P$ then?
The time complexity of the AKS primality test is $O(n^6)$, where $n$ is the length of the input. The length of an integer $N$ is roughly $\log N$, so the time complexity of the AKS primality test applied to the integer $N$ is $O(\log^6 N)$. Finally, I'm not sure what you mean by a problem being strictly contained in P...
Any function which is $O(\log^k n)$ for any constant $k$ is $O(n)$. The concept of "strictly contained" doesn't really make sense. Properly speaking, the statement is that primality is an element of the set of problems that can be decided in polynomial time. There's no such thing as "strictly an element": something is ...
https://cs.stackexchange.com
73,586
[ "https://physics.stackexchange.com/questions/73586", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/23517/" ]
Imagine this: You have a sphere of air where you have no charge and around this sphere you have a charge distribution $\rho(r,\theta,\phi)$. (For instance, this could be $\rho(r,\theta,\phi)=e^{-r}$) Now my question is: What is the most general equation that will give me the potential inside the sphere?-You can use t...
The electric potential $\Phi$ is defined through the following relation: $$\mathbf{E}=-\nabla \Phi\tag{1}$$ Now consider a vector field $\mathbf{F}$ such that: $$\nabla.\mathbf{F}=D$$ $$\nabla \times \mathbf{F}=\mathbf{C}$$ According to Helmholtz theorem, if the divergence $D(\mathbf{r})$ and the curl $\mathbf{C(r)...
The most general expression for the potential (assuming a static charge distribution, as you use) is: $$V({\vec r}) = C + \int d^{3}r'\frac{\rho({\vec r'})}{4\pi \epsilon_{0}\left|{\vec r}-{\vec r}'\right|}$$ Where C satisfies ${\vec \nabla}C = 0$, and the integral covers the region where $\rho \neq 0$. If you doubt...
https://physics.stackexchange.com
2,745,598
[ "https://math.stackexchange.com/questions/2745598", "https://math.stackexchange.com", "https://math.stackexchange.com/users/548770/" ]
<blockquote> I am trying to find the following integral: <span class="math-container">$$\int \frac {dx}{\sin^2 x + \tan^2x}$$</span> </blockquote> I have tried the common thing to do when encountering rational functions that contains rational functions and converting everything in terms of <span class="math-cont...
Let $t=\tan(x)$, then $dx=dt/(1+t^2)$ and $\sin^2(x)=t^2/(1+t^2)$. Hence $$\int \frac {dx}{\sin^2 x + \tan^2x}=\int \frac {dt}{(t^2+ (1+t^2)t^2)}=\int \frac {dt}{t^2(2+t^2)}=\frac{1}{2}\int \frac {dt}{t^2}-\frac{1}{2}\int \frac {dt}{2+t^2}.$$ Can you take it from here? P.S. By letting $t=\tan(x/2)$, then $dx=2dt/(1+t^...
$$\begin{align}\int\dfrac{dx}{\sin^2{(x)}+\tan^2{(x)}}\cdot\dfrac{\sec^2{x}}{\sec^2{x}}&amp;=\int\dfrac{\sec^2{x}\ dx}{\tan^2{x}+\sec^2{x}\tan^2{x}}\\ &amp;=\int\dfrac{\sec^2{x}\ dx}{\tan^2{x}+(\tan^2{x}+1)\tan^2{x}}\\ &amp;=\int\dfrac{\sec^2{x}\ dx}{2\tan^2{x}+\tan^4{x}}\end{align}$$ Let $u=\tan{x}$ and $du=\sec^2{x}...
https://math.stackexchange.com
81,558
[ "https://electronics.stackexchange.com/questions/81558", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/28655/" ]
I want to start making devices and I read about microcontrollers and other stuff on the Internet. I wonder if there are other languages to program microcontrollers with in addition to C.
Chips do not directly use C at all. They have instruction sets that vary greatly between different architectures. As a very low level abstraction of these instruction sets, most manufacturers provide an assembler, through which you can translate programs written in the relevant assembly language (which is roughly a m...
As us2012 said, a µc does not actually run the C language at all. It instead runs machine language which is a binary representation of the instruction set of the µc, with fields for an opcode (what to do), and either register specifiers and/or addresses (where the data is fetched from and/or stored.) Assembly languag...
https://electronics.stackexchange.com
430,347
[ "https://softwareengineering.stackexchange.com/questions/430347", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/397925/" ]
I'm a junior web developer at my first company. We have a business analyst that communicates with the sales team and developers. The business analyst is responsible in creating specifications for the feature request. My question is, should I just follow the business analyst's perspective of the feature request even tho...
You probably shouldn't just be following the business analyst's perspective. From a technical perspective, they probably don't have as much insight as you regarding the feasibility or difficulty of implementing a given requirement based on the system's current state. They (and the stakeholders they are representing) pr...
I'm also not sure whether this is the right place, but it's certainly a common situation that you encounter as a software engineer. The key is communication. Don't view this as a one way street where requirements flow from the BA to devs. If something isn't clear or seems to be too difficult or even impossible, TALK! T...
https://softwareengineering.stackexchange.com
138,538
[ "https://softwareengineering.stackexchange.com/questions/138538", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/49215/" ]
If I'm using a technology like Grails. It's really easy to wind up with inline styling. Are there any downsides to auto-generating code with inline styling? Is this considered bad practice? Why?
There are two main reasons why this auto-generated inline styling is bad: <ol> <li>Inline CSS styling overwrites by default the rules defined in a stylesheet. This means that you'll have a hard time to style the content according to your requirements through the stylesheet itself, and it would require to <strong>const...
Downsides, to my eye: <ul> <li>You may impair the integrity of visual design. If you reuse styles from a carefully crafted CSS, your design has better chances to look consistent.</li> <li>Changing the visual design becomes harder because styling information is scattered in code.</li> <li>Your page gets bigger. This ma...
https://softwareengineering.stackexchange.com
419,727
[ "https://stats.stackexchange.com/questions/419727", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/6827/" ]
Consider the following scenario (it's just a motivating example, not something I am doing for real): I run a trial, drawing an i.i.d. sample <span class="math-container">$S_1$</span> from population <span class="math-container">$P$</span>, to test a hypothesis <span class="math-container">$\mathcal{H}_0$</span>; I obta...
The concept of <span class="math-container">$\alpha$</span>-value is that you have a certain amount of probability mass that you can "use up". For instance, suppose you're trying to test whether a coin is fair, and you flip it 10 times. You might say "Well, the probability of it coming up heads 10 times, given that it'...
Sorry I was not aware that you have the early stopping rule. As @Accumulation answered, your rule already use all <span class="math-container">$\alpha$</span> budget. If you decide whether you reject the null or not based on the second p-value only, your rejection rule is to reject the null if <span class="math-contain...
https://stats.stackexchange.com
58,973
[ "https://mechanics.stackexchange.com/questions/58973", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/41641/" ]
I have a 2003 Ford Escape, 2.0L, manual transmission. I am experiencing a very strange issue. If I am driving (moving), and shift into neutral, the RPMs will rise up to 3500 about, and stay there till I come to a stop. I am in neutral the whole time. The car idles fine, but if I shift into neutral while the car is mo...
Replaced plugs and wires and issue was resolved.
Im going to bet that you did not replace the IAC with a new Motorcraft brand. There is a large batch of aftermarket ones that are causing the exact symptoms you describe. You were probably correct in replacing it, but it needs to be a Motorcraft. I had a 2003 Ranger with a high idle complaint. With bi-directional...
https://mechanics.stackexchange.com
162,232
[ "https://dba.stackexchange.com/questions/162232", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/115894/" ]
This is a example of the table I have: <pre><code>Part No | Start Date | End Date |Cost ABCD1 | 2014-01-01 | 2014-04-01|50.99 BDE2 | 2014-01-01 | 2014-03-01|14.59 ABCD1 | 2014-04-13 | 2014-05-01|13.99 </code></pre> And this is the output I want to see <pre><code>Part No | Start Date | End Date |Cost ...
I would suggest creating a dates table and cross-joining that table to your parts table, something like the following example. Do this in <code>tempdb</code> to not step on anything else. <pre><code>USE tempdb; </code></pre> Create a <code>Months</code> table, with the Year, Month, and a starting date for each: <pr...
Here's another way to do it. Given this table: <pre><code>CREATE TABLE #PartCosts ( PartNo varchar(32) NOT NULL, StartDate date NOT NULL, EndDate date NOT NULL, Cost decimal(18,2) NOT NULL ); INSERT #PartCosts(PartNo, StartDate, EndDate, Cost) VALUES('ABCD1','2014-01-01','2014-04...
https://dba.stackexchange.com
481,095
[ "https://math.stackexchange.com/questions/481095", "https://math.stackexchange.com", "https://math.stackexchange.com/users/77439/" ]
Ok, I know this may sound dumb, but I am trying to understand which is the correct (most beauty) notation for the power function ${\rm pow}(f(x),n)$. This is the correct one: $[f(x)]^n$ From trigonometry, where I was used to write $\cos^2x$, we get: $f^n(x)$ And from Bishop's <em>Pattern Recognition and Machine Lear...
Your curve lies in the plane $x=y$; therefore it is a plane curve. Denoting the length along the first main diagonal in the $(x,y)$-plane by $s$ the curve can be written as a graph in the form $$z(s)=f\left({s\over\sqrt{2}}\right)\qquad (s_0\leq s\leq s_1)\ .$$ For such graphs the formula for the curvature reads $$\ka...
You were given a parametric curve, but it's slightly disguised. Let $\mu(x) = (x,x,f(x))$ and then apply the formula you gave in your question, but with $t=x$. To get you started, note that $\mu'(x) = (1,1,f'(x))$. Can you take it from there?
https://math.stackexchange.com
75,864
[ "https://physics.stackexchange.com/questions/75864", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/4812/" ]
Let us consider a MOS (metal oxide semiconductor FET) system. Now the threshold voltage of aluminium of the gate of such a FET of 4.1 eV and that of the silicon oxide layer is different. My book claims that due to the threshold voltage difference, a voltage difference is created which is termed as the <strong>built ...
<ol> <li>an $E$ field is simply a region in which an $E$ charge experiences a force. therefore when two charges are sufficiently close by, they experience a mutual force. every charge is surrounded by its own $E$ field, in the same way every magnet is surrounded by its own magnetic field (or $B$ field) and every massiv...
The electric field is a modification of space properties created by the presence of any distribution of charge. Its existence does not require any moving things.
https://physics.stackexchange.com
1,630,669
[ "https://math.stackexchange.com/questions/1630669", "https://math.stackexchange.com", "https://math.stackexchange.com/users/113873/" ]
I am trying to show that: $$A \subset B \implies A \cap B = A$$ So far I got: $$A \subset B$$ $$A \cap B \subset A$$ $$A \cap B \subset B$$ $$A \cap B \subset A \subset B$$
$A\cap B \subset A$. On the other hand if $x\in A $ then $x\in B$ (because $A\subset B$). Since $x\in A$ and $x\in B$ we have $x\in A\cap B$, so $A\subset A\cap B$
Clearly $A\cap B \subseteq A.$<br> Conversely $A \subseteq A\cap B$ since:<br> Let $x\in A$ then, by assumption, $x\in B$. So $x\in A\cap B$.
https://math.stackexchange.com
243,663
[ "https://security.stackexchange.com/questions/243663", "https://security.stackexchange.com", "https://security.stackexchange.com/users/249539/" ]
I'm curious, as a green programmer, if one used layers of encryption methods, would this be more difficult to crack or impossible? Example: Layer 1- encryption method 1 &quot;Encrypt this string&quot; Apply crypto = &quot;encrypted mumbo jumbo&quot; Layer 2- encryption method 2 &quot;encrypted mumbo jumbo&quot; Apply c...
<blockquote> would this be more difficult to crack or impossible? </blockquote> If you use a modern encryption method like AES256 properly it is already effectively impossible to decrypt. You can learn about AES256 from a variety of sources including cryptography textbooks, which are perhaps a good place to start for a...
While it is possible to gain an improvement in security by encrypting data with multiple algorithms in this way, it's generally not needed and not a good idea. <ul> <li>If you are using a secure 256-bit AEAD algorithm with a securely generated key and nonce (that is, using a KDF or both randomly generated on each use),...
https://security.stackexchange.com
55,168
[ "https://security.stackexchange.com/questions/55168", "https://security.stackexchange.com", "https://security.stackexchange.com/users/43747/" ]
I have a fair number of security concerns with a client's operation and it made me think about all the security concerns I've observed and noticed throughout the years with different clients/jobs. Raising concerns with management was met with "too much time/money/resource" unless the security issue in question was expl...
Every fix is a business decision. The business needs to make the call. You, as the one with the knowledge, need to properly inform and guide the business through the matrix of needs and costs. Optimally, there are policies and procedures in place to identify and incorporate fixes over time based on cost and priority, b...
One big problem about fixing something when being told not to do so is that you might be wrong in some point: <ul> <li>perhaps it's not a real bug / hole;</li> <li>perhaps it is but some other layer of the application prevents it from leaking</li> <li>perhaps it is a bug, it might lead to leaks, but your app isn't in ...
https://security.stackexchange.com
139,346
[ "https://physics.stackexchange.com/questions/139346", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/60700/" ]
Why does the air pressure at the surface of the earth (resulting from collisions of molecules on the surface of the earth which has to do with the velocity of the particles) exactly equal the weight of the entire air column above it (which just has to do with the number and mass of the molecules in the air column)? H...
Suppose the pressure at the Earth's surface is $P$. Consider an air column of cross-sectional area $A$. The upward force on the column is $F_{\text{up}}=PA$. Denote the weight of the column as $W$. By definition of "weight", the downward force on the column is $F_{\text{down}}=W$. Suppose the pressure is too low, such...
<blockquote> Why does the air pressure at the surface of the earth (resulting from collisions of molecules on the surface of the earth which has to do with the velocity of the particles) exactly equal the weight of the entire air column above it (which just has to do with the number and mass of the molecules in the a...
https://physics.stackexchange.com
2,980
[ "https://ai.stackexchange.com/questions/2980", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/6019/" ]
I want to create an AI which can play five-in-a-row/Gomoku. I want to use reinforcement learning for this. I use the <em>policy gradient</em> method, namely REINFORCE, with baseline. For the value and policy function approximation, I use a <em>neural network</em>. It has convolutional and fully connected layers. All of...
Just ignore the invalid moves. For exploration, it is likely that you won't just execute the move with the highest probability, but instead choose moves randomly based on the outputted probability. If you only punish illegal moves they will still retain some probability (however small) and therefore will be executed fr...
Usually softmax methods in policy gradient methods using linear function approximation use the following formula to calculate the probability of choosing action <span class="math-container">$a$</span>. Here, weights are <span class="math-container">$\theta$</span>, and the features <span class="math-container">$\phi$</...
https://ai.stackexchange.com
279,204
[ "https://mathoverflow.net/questions/279204", "https://mathoverflow.net", "https://mathoverflow.net/users/43198/" ]
Let $X$ be a projective, noetherian $k$-scheme for an algebraically closed field $k$ of characteristic zero. Let $Y_1,...,Y_r$ be locally closed subschemes (open subschemes of closed subschemes) of $X$. Does the scheme structure on $X$ necessarily induce a scheme structure on $Y_1 \cup ... \cup Y_r$?
You just discovered <em>constructible sets</em>! It is really easy to give counter-examples to your suggestion (as <em>Ja ok</em> already has), but here is a general idea: Take your favorite locally closed but neither open nor closed subscheme of your favorite irreducible scheme. Then prove (as a homework) that its c...
No. Take the Union of the origin and the complement of the coordinate axes inside X = A^2. This is not a subscheme because the origin doesn't have an affine open neighborhood.
https://mathoverflow.net
117,524
[ "https://cs.stackexchange.com/questions/117524", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/105282/" ]
<blockquote> Minimum number of bits required to represent <span class="math-container">$(+32)_{base10}$</span> and <span class="math-container">$(-32)_{base10}$</span> in signed two's compliment form? </blockquote> My attempt: 32 = 0100000 ( 1st zero - sign bit as positive) So to represent +32 we need 7 bits -32 = 110...
The representations of the numbers as 6-bit two's complement binaries are <span class="math-container">\begin{align} +32_{10} &amp;= 10\,0000_2\\ -32_{10} &amp;= \overline{10\,0000}_2 + 1_2\\ &amp;= 01\,1111_2 + 1_2\\ &amp;= 10\,0000_2 \end{align}</span> which would give the same representation for bo...
There are 65 values x with -32 &lt;= x &lt;= +32. You cannot represent 65 values in 6 bits. Either you misread the question, or the answer 6 is wrong.
https://cs.stackexchange.com
47,369
[ "https://mathoverflow.net/questions/47369", "https://mathoverflow.net", "https://mathoverflow.net/users/6415/" ]
The proof that column rank = row rank for matrices over a field relies on the fact that the elements of a field commute. I'm looking for an easy example of a matrix over a ring for which column rank $\neq$ row rank. i.e. can one find a $2 \times 3$-(block)matrix with real $2\times 2$-matrices as elements, which has dif...
Let $D$ be a skew field and consider the sets of $2\times 1$-matrices (columns) and $1\times 2$-matrices (lines) as left vector spaces over $D$. Let $a$ and $b$ be two non-commuting elements of $D$. Then $(a,ab)\in D(1,b)$, on the other hand $(b,ab)^{\rm T}\not\in D(1,a)^{\rm T}$. In particular the matrix $$ \left(\...
It is a classical observation due to Nathan Jacobson that a division ring such that the set of invertible matrices over it is closed under transposition has to be a field, i.e. commutative. The reason is simple: the matrix $\begin{pmatrix} a &amp; b \\ c &amp; 1 \end{pmatrix}$ is invertible if and only if $\begin{pmat...
https://mathoverflow.net
49,714
[ "https://quant.stackexchange.com/questions/49714", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/43315/" ]
Let's say I have a bond that pays on coupon on 10/03.<br> I buy this bond on 10/01 with settlement on 10/03. Who gets the coupon ? Does it depend if it's paid in the morning, in the afternoon, before/after the settlement ? Or is there a market convention that clarifies this kind of situation ?
Yes, of course there is a market convention. We can try to imagine how this worked in the 19th Century. The bond belongs to Mr. S, a wealthy capitalist. On 10/03 Mr. S is legally entitled to receive a coupon payment. So the first thing he does (of course) is he goes down to the US Treasury office on Wall Street, and s...
Since the bond was purchased on 10/1 and settles on 10/3, the coupon belongs to the buyer of the bond. The reason why is because when someone buys the bond on 10/1, they receive the price + accrued interest up to 10/1 and nothing more.
https://quant.stackexchange.com
301,737
[ "https://physics.stackexchange.com/questions/301737", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/140580/" ]
If I have a projectile that is thrown at some horizontal velocity at some height, and horizontal acceleration is zero, can't I use the equation $v = v_0 + at$? The problem is when I use it since $v$ will equal $v_0$ (acceleration is zero so velocity won't change) I get $\frac{0}{0}$ which is undefined and definitely no...
To find the distance $s$ something traveled to go from speed $V_i$ to speed $V_f$ use the formula $$s = \frac{V_f^2-V_i^2}{2 a}$$ But this assumes <em>some acceleration</em> in order for $V_f \neq V_i$. If the acceleration is zero then use $s = V \Delta t $. You will need to know the time of motion, instead of the beg...
Resolve the vertical component until it h=0, it hits the ground. Use this time t in the horizontal $s=ut+(1/2)at^2$ where a is 0. Because horizontal acceleration is zero.
https://physics.stackexchange.com
8,397
[ "https://mechanics.stackexchange.com/questions/8397", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/4284/" ]
Today someone broke my car fuel outer case and taken out fuel. I came home by driving but then i have now one doubt in my mind. What if he put something else in tank like <code>water, sand,</code> etc in there. Although i didn't find any traces of those near fuel tank but not sure. So i want to know what will happen...
You are correct that the only extra energy consumed is the electricity used by the blower fan to move the warmed air. In the grand scheme of things the extra fuel required to generate that electricity is miniscule. The coolant is circulated regardless of the heater setting. Moving the selector to cool or warm merely di...
Here's a nice tip: if you turn up the heat in your car, it helps lower the operating temperature of your engine. Sometimes by as much as 10%. Not a problem when you're driving around in icy cold weather, but if your car is overheating, turning on the heat, opening the windows and putting the blower on full could save y...
https://mechanics.stackexchange.com
201,023
[ "https://softwareengineering.stackexchange.com/questions/201023", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/9335/" ]
Say I have created a web service based on RESTful APIs. Does it make sense to also provide users with a client library for the API in some select languages which are likely to be the most used ones? By client library, I mean a thin wrapper around all the API calls, so that the users can call methods in their language a...
Many of the organisations offering RESTful APIs also offer up some client code, but they also provide the full API separately. I think there's only a few sensible combinations: <ol> <li>API and client</li> <li>API only</li> <li>Client-only</li> </ol> I've ordered those in terms of preference, with API plus client bei...
It depends on how many users there will be for each language, and how long it takes you to write them. If you only have a handful of users then there's little point IMO. If you have (or expect to have) 1000s of users (and it's financially viable from a business point of view), then it's probably worth doing. Will t...
https://softwareengineering.stackexchange.com
604,018
[ "https://physics.stackexchange.com/questions/604018", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/25545/" ]
In order to teach 7th-grade students of the enormity of the number of electrons in 1 coulomb of charge <span class="math-container">$$1\ {\rm C} =6.25 \times 10^{18}~ {\rm electrons}$$</span> I wish to compare this number to a real-life example. How may I do it?
I would say this is not quite the right approach. A perhaps better illustration is to show, instead of how <em>big</em> the number is, how <em>not</em>-big it is, and yet how, despite that, it has the potential to be <em>extremely</em> impactful. Sure, you can count grains of sand and pennies and imagine big mountains ...
If you were to count 1 electron every second, it would take you around 20 billion years, more than current age of the universe, to count all the electrons in 1 Coulomb.
https://physics.stackexchange.com
283,078
[ "https://mathoverflow.net/questions/283078", "https://mathoverflow.net", "https://mathoverflow.net/users/106906/" ]
I am trying to understand the details behind the so-called "distribution relations" between Heegner points on the modular curve $X_0(N)$, as given (for instance) in Gross's paper <em>Kolyvagin's work on modular elliptic curves</em>, [Proposition 3.7, (i)]. More precisely, the relation between Hecke and Galois actions o...
<blockquote> What I don't understand is why the exactly the same terms should appear in both sums. </blockquote> The Galois action on CM points is described in adelic terms via the fundamental theorem of complex multiplication (or Shimura's explicit reciprocity law) so identifying the terms appearing in the right-ha...
Thank you Olivier for this great answer, I wish I could be one of your students ;-) ! Though I still not quite fully understand the adelic setting, here is some "classical" explanation I found, using the theory of ideals in orders of imaginary quadratic fields. I guess this is supposed to be a very well-known result b...
https://mathoverflow.net
150,184
[ "https://softwareengineering.stackexchange.com/questions/150184", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/42599/" ]
I would like to know the idea behind the working of 'docking' in applications. I have worked with applications where components from individual forms are docked on a single main form to provide the necessary GUI. But I don't have any idea whats happening in the background. According to Wikipedia<br> <em>A dock is a gr...
Some collection that is empty has length of zero. Some collection with a negative length is something else. Use second one or implement a method like IsEmpty().
Personally, I think that neither version is good, and both are a sign of bad API design on part of the author of <code>Array</code>. For example, in Ruby (not that I would propose the Ruby core library as an example of good API design) it would be <pre><code>do_something if my_array.empty? </code></pre> Which coinci...
https://softwareengineering.stackexchange.com
11,095
[ "https://electronics.stackexchange.com/questions/11095", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3261/" ]
I've just got a cheapo &lt; $20 digital multimeter here and was curious if anyone could tell me whether current might still flow through it after i turn the dial so that the power is off. Some background: I have a wireless bluetooth mouse that always gave me problems charging because the contacts don't seem to line up...
In short, yes. The way a digital multimeter measures current (not a loop current meter) is that it measures the voltage drop across a small precision resistor. For reliability, simplicity, and repeatability, no switches or contacts are placed in series with this shunt resistor. Some meters will have a fast-acting fuse...
Just hook up a light bulb or LED through the current connections on the meter and observe that it remains lit when the meter is powered off. Or pop the case open and observe the wiring of the current connections. Current is inferred by measuring the voltage drop across big hefty resistor (but with quite low resistan...
https://electronics.stackexchange.com
151,613
[ "https://electronics.stackexchange.com/questions/151613", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/65520/" ]
I would like to design a device with opamp LM324 operating at roughly >5V. The device has to manipulate a signal on +/2.5V (Vpp:5V, DC balanced). If I want it to work without a split supply, can I use a 2.5V offset to bias the signal? (I understand that the Vdd of opamp should be at least 7V for fear of saturation). ...
If what happens when the input is open is important, then you can follow the answer from WhatRoughBeast (also see comment below). If not, you can simplify things a bit: Get rid of D1, R1, R2 Change R3 to 20K and connect to the +5V reference voltage Change R5 to 20K That will have an output of 0V with an input of -2...
You're very close. First, as you suspected, get rid of the diode. Second, change R3 to 9.5k, or R4 to 10.5k. Your 2.5 volt reference will have a Thevenin equivalent resistance of 500 ohms, so you need to compensate in order to keep the gain right. A few (hopefully minor) points. Your 5 volts must be stable and no...
https://electronics.stackexchange.com
358,241
[ "https://physics.stackexchange.com/questions/358241", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/94790/" ]
Considering a single free bosonic mode with Hamiltonian $H=\epsilon a^{\dagger}a$, we can use (bosonic) coherent states to write the corresponding partition function $\mathcal{Z}=\mathrm{tr} (e^{-\beta H})$ as: \begin{equation} \mathcal{Z}=\int d(\bar{\psi},\psi)e^{-\bar{\psi}\psi}\langle\psi|e^{-\beta H}|\psi\rangle, ...
To begin with, the result of the multi-dimensional complex Gaussian integral is \begin{equation} I(A) := \int d(z_1, z_1^\ast) \cdots d(z_n, z_n^\ast)\, \exp\big(-\vec{z}^{\dagger} A \vec{z}\big) = \det(A)^{-1}. \end{equation} Here, $A$ is an $n\times n$ matrix, and $\vec{z} = (z_1, \ldots, z_n)^T$. The integration mea...
Do you need to use the coherent states to calculate the partition function? You might be overthinking it a bit. A partition function is the sum of Boltzmann factors ($e^{-\beta E}$) over the Fock space. Your Fock space is defined by the occupation numbers: $|0\rangle$, $|1\rangle$, etc. For you, $\hat H|n\rangle = n\e...
https://physics.stackexchange.com
376,522
[ "https://stats.stackexchange.com/questions/376522", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/95569/" ]
The problem is basically as follows There are four cards with points <code>[1,2,3,4]</code>, every time I draw one card randomly and then put it back to the deck. As I keep drawing I record the sum of the points on the cards, I stop drawing if the sum is greater than or equal to five. If the final points is equal to ...
Whenever there are conflicting answers from combinatorial methods, I like to simulate the result to see what happens. My method of simulation (in R) is to sample five cards with replacement from among 1, 2, 3, 4. Then to take cumulative sums of the results to see if the total 5 is present at any step. If so, that's a ...
I think another way to approach this problem is to model the game as a Markov chain with the following transition probability matrix, <span class="math-container">$M$</span>: <span class="math-container">$$ \begin{matrix} &amp; \text{From state} \\ \text{To state} &amp; {\begin{array}{r|ccccccc} &amp; 0 &amp; 1...
https://stats.stackexchange.com
104,279
[ "https://cs.stackexchange.com/questions/104279", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/100381/" ]
I can see that <span class="math-container">$L$</span> has to be context-free but not regular here as regular languages are closed under concatenation and intersection. But <span class="math-container">$L\cap L^2$</span> looks too weird. I couldn't think of any <span class="math-container">$L$</span> that gives rise to...
You can take <span class="math-container">$$ L = \{ a^n b^n : n \geq 1 \} \cup \{ a^k b^n a^n b^\ell : n,k,\ell \geq 1 \}. $$</span> You can check that <span class="math-container">$$ L \cap L^2 = \{ a^n b^n a^n b^n : n \geq 1 \}. $$</span>
The intersection of the form <span class="math-container">$L\cap L^2$</span> actually turns out to be quite powerful. In fact languages like this can code Turing machine computations. Let <span class="math-container">$L_1, L_2 \subseteq\{a,b\}^*$</span> and let <span class="math-container">$\#$</span> be a third "spec...
https://cs.stackexchange.com
2,603,338
[ "https://math.stackexchange.com/questions/2603338", "https://math.stackexchange.com", "https://math.stackexchange.com/users/274352/" ]
I was trying to come up with examples of metric spaces that are not locally compact, but could only come up with totally disconnected examples ($\mathbb{Q}$ and $\mathbb{R}_l$). Are there examples that are not totally disconnected? Wikipedia tells me something about infinite-dimensional topological vector spaces not b...
Some theorems on preservation of local compactness: If $X$ is locally compact Hausdorff then $Y \subseteq X$ is locally compact in the subspace topology iff $Y = O \cap C$, where $O$ is open in $X$ and $C$ is closed in $X$. (This holds iff $Y$ is open in $\overline{Y}$.) E.g. $\mathbb{Q} \times \mathbb{R}$ is not tot...
Have you considered $([0,1]\backslash\mathbb{Q})^\omega$?
https://math.stackexchange.com
106,774
[ "https://cs.stackexchange.com/questions/106774", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/102757/" ]
Irrational numbers like <span class="math-container">$\pi$</span>, <span class="math-container">$e$</span> and <span class="math-container">$\sqrt{2}$</span> have a unique and non-repeating sequence after the decimal point. If we extract the <span class="math-container">$n$</span>-th digit from such numbers (where <spa...
The most obvious disadvantage is the unnecessary complexity of PRNG algorithms based on irrational numbers. They require much more computations per generated digit than, say, an LCG; and this complexity typically grows as you go further in the sequence. Calculating 256 bits of π at the two-quadrillionth bit took 23 day...
For any reasonable definition of perfect, the mechanism you describe is not a perfect random number generator. <ul> <li>Non-repeating isn't enough. The decimal number <span class="math-container">$0.101001000100001\dots$</span> is non-repeating but it's a terrible generator of random digits, since the answer is "alway...
https://cs.stackexchange.com
479,069
[ "https://math.stackexchange.com/questions/479069", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90771/" ]
Hi I'm doing derivatives of trigonometric functions. I needed to find the value of the derivative at $$x=\pi,$$ where $$\frac{dy}{dx} = -x\sin x +\cos x.$$ I found that this was -1 using the calculator, however is this possible to do without a calculator? How does the calculator evaluate this? I haven't studied advanc...
Since $\sin\pi = 0$ and $\cos\pi = -1$, $$-x\sin x + \cos x = -\pi \sin \pi + \cos\pi = -\pi\cdot 0 + (-1) = -1.$$
Using the unit circle approach, since <span class="math-container">$\pi$</span> (radians), which is equivalent to <span class="math-container">$180^{\circ}$</span>, terminates at the point <span class="math-container">$(-1,0)$</span>, it follows that <span class="math-container">$\sin\pi = 0$</span> and <span class="ma...
https://math.stackexchange.com
515,234
[ "https://physics.stackexchange.com/questions/515234", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/167281/" ]
Why is the following statement false? When an electron loses energy in making a transition from one state to another, energy is conserved by several photons being emitted. I don't see which conservation law this violates.
This process is perfectly possible; it's just very unlikely, because of the details of how atoms couple to the electromagnetic field. If you want a concrete example, the simplest case is the 2s-1s transition in hydrogen, for which single-photon mechanisms are forbidden by symmetry, but which will still decay via a tw...
The electron isnt traveling from one energy state to another, he literally cant be between energy levels , which means the diffrence of energy between those two levels have to be somewhere , when you calculate the diffrence you basiclly see its an energy of one photon with a specific frequency , and only this frequency...
https://physics.stackexchange.com
372,379
[ "https://softwareengineering.stackexchange.com/questions/372379", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/273966/" ]
Let me give a bit of background on the problem. We have a java application which has MQ integration and an Integration Test pack which is also written in java. The test pack runs all scenarios (positive and negative) by running the test cases (methods) and changing the parameters depending on the scenario. The way it...
So the solution we have come up with is this. We will Dockerize the test pack so that we have multiple containers running multiple servers and multiple message queues. We will utilize the maven profiles to deploy the same war but run different test packs in the separate containers. The test pack would be modularized i...
Filters on message queues exist. You can throw them into the same message queue, and then assign a listener for messages based on a specific criteria. This criteria can be anything, to thread id to an arbitrary message name. The end result is that messages not having that specific criteria don't get thrown away, ...
https://softwareengineering.stackexchange.com
223,160
[ "https://dba.stackexchange.com/questions/223160", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/165468/" ]
<h1>Overview</h1> I am attempting to join 3 tables <code>auction</code>, <code>bids</code>, and <code>users</code>. I need several key pieces of information from each table based off the <code>bids</code> table. In the end I want a summary overview of the auctions. To see the latest bid for each auction and the user t...
The database does this by default, no hints/tuning needed. <pre><code>create table data(partitioned_key_index number, some_dummy_measure number) partition by list (partitioned_key_index) ( partition p1 values (1), partition p2 values (2), partition p3 values (3), partition p4 values (4), par...
Your intuition is correct. So far Oracle can not iterate over partitions and have a different exec plan for each of them. The only exception is new 12c feature, where a local index can be missing on some partitions. General recommendation is that each partition should have similar statistical characteristic - or you wi...
https://dba.stackexchange.com
69,677
[ "https://dba.stackexchange.com/questions/69677", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/42155/" ]
I am designing some tables and a number of the tables have as the key a lower and upper bound which never overlap. I want to query by a value that can fall withing any of those ranges. If I keep both columns I can query it as a range (i.e. WHERE lower_bound &lt;= val AND val &lt; upper_bound) and it is fairly simple. ...
There's no single right answer for any performance question. The answer is always that query optimizers are very smart, to a point. So the most efficient design or query will depend on the number of records, what kind of indexes you have, how selective they are, and many, many more factors. If you want to avoid keep...
Assuming you have an ascending index on lower_bound, you could try <pre><code>SELECT * FROM table WHERE lower_bound = ( SELECT MIN(lower_bound) FROM table WHERE lower_bound &gt;= VAL ) </code></pre> This sort of query was used by a commercial product many moons ago. It w...
https://dba.stackexchange.com
225,193
[ "https://stats.stackexchange.com/questions/225193", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/124210/" ]
I have data in a perception experiment where I show surfaces slanted at different angles and ask participants to judge whether the surface could be stood on. I also asked them how certain they are about their perceptual responses using a 7-point Likert scale. Here is a subset of the data: <pre><code>SUB COND TRIAL ...
Neither model is &quot;correct&quot;, statistically: <blockquote> <em>&quot;Remember that all models are wrong; the practical question is how wrong do they have to be to not be useful.&quot;</em> Box, G. E. P.; Draper, N. R. (1987), Empirical Model-Building and Response Surfaces, John Wiley &amp; Sons. </blockquote> Th...
After I centered <code>ANGLE</code> and added <code>ANGLE^2</code>, I used the following model: <pre><code>data$ANGLE &lt;- (data$ANGLE)-30 #centered variable data$ANGLE1 &lt;- (data$ANGLE)^2 fm2 &lt;- clmm(CERTAINTY ~ ANGLE*COND +ANGLE1*COND +(1+ANGLE|SUB), data = data,Hess=TRUE) </code></pre> The output now shows ...
https://stats.stackexchange.com
8,947
[ "https://stats.stackexchange.com/questions/8947", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/1965/" ]
Let's say I have a matrix where the underlying data is from the entire population. Let's say I also have a matrix where the underlying data has been sampled from population. How would I analyze how well the the sample represents the population? My gut instinct is to convert it into a row-col listing: <pre><code>row ...
This behavior is questionable but documented. The help for "confidence" states: <blockquote> If standard_dev ≤ 0, CONFIDENCE returns the #NUM! error value. ... If we assume alpha equals 0.05, we need to calculate the area under the standard normal curve that equals (1 - alpha), or 95 percent. This value is ±...
Let's assume all your 8 subjects chose to answer 3 on the (1, 2, 3, 4, 5) scale. Let's assume that their opinions were continuous in their minds, and they rounded it to the closest values of the scale. This means that the original opinion of each subject was in the range $[2.5, 3.5)$. <pre><code>&gt; mean(replicate(1...
https://stats.stackexchange.com
47,510
[ "https://chemistry.stackexchange.com/questions/47510", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/27596/" ]
I've seen it suggested countless times that combining vinegar and baking soda is a <em>great</em> home cleaning solution, but this always seemed like nonsense to me. I recognize that baking soda, a base, can eat away at certain kinds of grime and that vinegar, an acid, can operate similarly on different kinds of grime...
Well, cleaning is a very broad subject. This is a question which could make a great Science Fair Project. Because vinegar is just a dilute solution of acetic acid (ignoring trace compounds present), and because both baking soda and sodium acetate are pretty soluble, it wouldn't probably be practical to try to make a sa...
One application of baking soda and vinegar is in cleaning a glass stovetop. You start with baking soda and water. The dissolved baking soda acts as a base, and the undissolved baking soda acts as mild abrasive. Once you are done cleaning, you need to get rid of the baking soda, and might want to adjust the pH of the cl...
https://chemistry.stackexchange.com
70,236
[ "https://stats.stackexchange.com/questions/70236", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/29386/" ]
I have the daily closed values of the initial index for DJUSER, MSCI, SP500, SPGSCI from 1 January 1999 to 31 December 2011. I want to transform them in to data of rolling annual returns. How to do it using R? which package do I need to use? The density of the rolling annual returns associate to each data should be...
Always use the scores the way they come out of the classifier. If you take absolute values you are basically changing the classifier's ranking and you will obtain an erroneous ROC curve. The values of scores across classifiers are entirely irrelevant: the only thing that matters to plot ROC curves is the ranking produ...
A classifier often involves an internal (hidden) value which is compared against a threshold. Effectively in a ROC curve each such value is treated as a threshold to get each new segment of the curve. If you are worried about the different range of values, and their unintepretability, it is nice to convert them to a ...
https://stats.stackexchange.com
37,566
[ "https://stats.stackexchange.com/questions/37566", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/5635/" ]
If I plot some data in function of a categorical variable in R, I get the standard boxplot. However, the boxplot displays non-parametric statistics (quantiles) that don't seem appropriate for normally distributed data. What is the equivalent of the boxplot for normally distributed data (ideally, something based on con...
First of all I agree with Momo's comments. Boxplots are appropriate for normally distributed data as well as any other distribution for continuous variables. There is no relevance to confidence intervals when discussing boxplots for sample data. However I think there are ways to customize boxplots to normal distribu...
Plotting categorical vs continuous variables with box-and-whiskers plots is, as far as I know, fairly common and appropriate for normally distributed data. That said, you might be interested in adding additional information (although again, what follows applies to non-normally distributed data as well): Beyond the q...
https://stats.stackexchange.com
3,855,312
[ "https://math.stackexchange.com/questions/3855312", "https://math.stackexchange.com", "https://math.stackexchange.com/users/824194/" ]
I have completed a proof of the following statement: Prove that any bounded open subset of R is the union of disjoint open intervals Let O <span class="math-container">$\subset$</span> R We want to write O as a disjoint union of open intervals Since O is bounded, we can define <span class="math-container">$\forall x \i...
So <span class="math-container">$a_x = \inf\{y \in \Bbb R\mid (y,x) \subseteq O\}$</span> and <span class="math-container">$b_x = \sup\{y \in \Bbb R\mid (x,y) \subseteq O\}$</span> which are well-defined (there are <span class="math-container">$a' &lt; x &lt; b'$</span> such that <span class="math-container">$(a',b') \...
<strong>Hint:</strong> prove that <span class="math-container">$(a_x+\frac1n,\, b_x-\frac1n)\subseteq O$</span> for all <span class="math-container">$x\in O$</span> and big enough <span class="math-container">$n\in\Bbb N$</span>.
https://math.stackexchange.com
29,866
[ "https://dsp.stackexchange.com/questions/29866", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/17077/" ]
I generate a Gaussian noise and then I filter it with a passband FIR Kaiser window filter. When I perform the Fourier transform of the output of the filter and plot its magnitude spectrum, it is filtered in the correct frequency band. Now, I perform a second Fourier transform on the output of the first Fourier transfor...
Applying the discrete Fourier transform (DFT) twice to a time-domain signal, should produce the original time-domain signal in a circularly time-reversed, and linearly scaled (by N) form; as the inverse DFT is very similar to the forward DFT, except the sign of the complex exponential,a linear scale by 1/N. The inverse...
The difference between an IFFT and an FFT is (merely) in the direction of the result vector (indexed forwards or backwards/reversed in time), and usually a scaling factor of N or 1/N. So you should see nearly the same thing if the input is so close to symmetrical looking that it doesn't look too different when reverse...
https://dsp.stackexchange.com
69,408
[ "https://chemistry.stackexchange.com/questions/69408", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/33671/" ]
Why does viscocity increase with temperature in gases? When they gain kinetic energy, they should be more free right?
From the basis of the kinetic theory of gases, viscosity in gases increases with temperature because the increase in kinetic energy will increase the frequency of collisions between the molecules. This increased number of collisions decreases the ability of the molecules to diffuse in the desired direction (i.e. the ga...
A short, qualitative answer: In gas, the addition of heat increases the average velocities of molecules, which means more intermolecular collisions, which means more intermolecular interactions that limits macroscopic mobility of fluid in certain direction. In liquid it's the opposite - heating the system increases t...
https://chemistry.stackexchange.com
63,362
[ "https://dba.stackexchange.com/questions/63362", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/37188/" ]
I'm using MySQL and I am trying to calculate the distance in meters between two different longitude, latitude coordinates. I wrote a stored function in MySQL but it calculates just 1 for each row in select query. There is my stored function in the following segment: <pre><code>DELIMITER $$ CREATE DEFINER=`root`@`loca...
Here's a really simple way to get the distance between two lat/lng pairs. It's not exact, but it's pretty close. Replace lat1, lng1, lat2 and lng2 with your columns. <pre><code>SELECT 1609.34 * 3959 * ACOS( COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS( RADIANS(lng2) - RADIANS(lng1) ) + SIN(RADIANS(l...
Okay, few notions about your procedure <ol> <li><code>DECIMAL(12,12)</code> means 12 digits, where <strong>ALL 12</strong> are behind a floating point (so basically, 0.<em>*</em>). To see an example, execute <code>SELECT CAST(23.45 AS DECIMAL(12,12));</code> and see what output does it give you.</li> <li>I suggest tha...
https://dba.stackexchange.com
273,657
[ "https://softwareengineering.stackexchange.com/questions/273657", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/92352/" ]
I am using JWT tokens in HTTP headers to authenticate requests to a resource server. The resource server and auth server are two separate worker roles on Azure. I cannot makeup my mind as to whether I should store the claims in the token or attach them to the request/response some other way. The Claims list affects ...
I store identifier claims only (userid, etc.) (encrypted) in my jwt. Then when I get the token on the server (API) I can do a lookup server side (db,redis, or local network api call) and retrieve all the associations to the userid (apps,roles, etc.) However if you want to stuff more unencrypted claims into the jwt just...
It sounds like authentication (who the user is) and authorization (what the user is allowed to do) are not as clearly divided as you would like. If you don't want the authentication server to know what the user is entitled to then limit the claims in that JWT to the userid just like wchoward suggested. You could have...
https://softwareengineering.stackexchange.com
111,180
[ "https://chemistry.stackexchange.com/questions/111180", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/75894/" ]
We classify exothermic and endothermic processes based on enthalpy change, <span class="math-container">$\Delta H &lt; 0$</span> and <span class="math-container">$\Delta H &gt; 0$</span> respectively. I assume this translates to <span class="math-container">$\Delta U &lt; 0$</span> and <span class="math-container">$\D...
<blockquote> If K is large enough (bigger than <span class="math-container">$10^4$</span> in my curriculum), this means that the the concentration of the reactants is almost zero. </blockquote> This statement is not always true - it depends on the stoichiometry of the reaction. For the reaction <span class="math-co...
See my comment above. As a numerical example, take acetic acid (<span class="math-container">$\ce{AcOH}$</span>), which has <span class="math-container">$K_\mathrm{a} = 1.8 \cdot 10^{-5}$</span>. This means that: <span class="math-container">$$K_\mathrm{a} = \frac{[\ce{AcO-}][\ce{H+}]}{[\ce{AcOH}]}$$</span> And the...
https://chemistry.stackexchange.com
327,916
[ "https://math.stackexchange.com/questions/327916", "https://math.stackexchange.com", "https://math.stackexchange.com/users/64393/" ]
I need to find all the primitive roots of 49. First note, $ ϕ(49) = 42 $ Is there an easier way to go about trying all numbers less than $42$ to find the primitive roots of $49$ if we already know that the primitive roots of $7$ and $49$ are $3$ and $5$?
If you have found one primitive root $a$, you get all the primitive roots in the form $a^i$ where $\gcd(i,42) = 1$.
Here is another way to see this, so you don't have to take as many powers as in azimut's answer. <strong>Theorem.</strong> Suppose that $p$ is an odd prime. If $g\bmod p$ is a primitive root for $\mathbb{Z}/p\mathbb{Z}$ and $g^{p-1}\not\equiv 1 \bmod p^2$, then $g$ is also a primitive root of $p^2$. If $g^{p-1}\equiv ...
https://math.stackexchange.com
391,915
[ "https://math.stackexchange.com/questions/391915", "https://math.stackexchange.com", "https://math.stackexchange.com/users/49956/" ]
Firstly, I'd like to apologise - I do not know the correct terms for what I am asking. <img src="https://i.stack.imgur.com/hBOad.png" alt="Diagram showing a section of a cone highlighted"> Assume that the top/bottom of the highlighted portion there is actually aligned with the base. To help explain: I need to wrap t...
If I've understood your problem correctly, I think this should help. This one's a right circular cone and its opened up paper version. Here we've taken an arbitrary curved surface of the form shown on the cone and visualized. <img src="https://i.stack.imgur.com/2OnVy.jpg" alt="enter image description here">
Since the distance from the apex to the base is constant. Assuming the cone is made of paper, cutting it open along your yellow line will make a circular sector whose radius is the former distance. Your cross-sections will correspond to bands concentric with the sector's circumference.
https://math.stackexchange.com
64,443
[ "https://mathoverflow.net/questions/64443", "https://mathoverflow.net", "https://mathoverflow.net/users/7392/" ]
Let $n \ge 2$ be some positive integer. Given a norm $p : \mathbb{R}^n \to \mathbb{R}$, one can inquire about the structure and properties of its isometry group, i.e. the group of all bijections $F:\mathbb{R}^{n}\to\mathbb{R}^{n}$ such that $p\left(v\right)=p\left(F\left(v\right)\right)$ for all $v \in \mathbb{R}^n$. ...
As an answer to (1), consider any compact subgroup $G\subset O(n)$ and look at the $G$-invariant functions on $\mathbb{R}^n$ that have homogeneity $1$. As long as $G$ does not act transitively on the space of lines in $\mathbb{R}^n$, that set of functions will be properly larger than the $O(n)$-invariant functions of ...
Related problems have been studied by people in Banach space theory. Why don't you talk with Yehoram (Joram) Gordon, who did deep work in this direction? As for (2), the answer is easy: If $C$ is the John's maximal volume ellipsoid on the space, any linear isometry maps $C$ onto itself. This means that you get the...
https://mathoverflow.net
456,734
[ "https://electronics.stackexchange.com/questions/456734", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/228500/" ]
I'm connecting 3 phase motor to frequency converter and I don't understand why to use <strong>shield</strong> cables. Is using shield cables a must in every situation or only when nearby is running a Profinet or other sensitive signals?
You have <span class="math-container">$$\bar{x}yz + x\bar{y}\bar{z} + xy\bar{z} + xyz = (x + \bar{x})yz + (y + \bar{y})x\bar{z} = yz + x\bar{z}.$$</span> Alternatively <span class="math-container">$$xy + yz + x\bar{z} = xy(z + \bar{z}) + yz + x\bar{z} = (1 + x)yz + (1 + y)x\bar{z} = yz + x\bar{z}.$$</span>
Notice that the final expression is a MUX: <span class="math-container">$$yz + x\bar{z}$$</span> When <code>z</code> is 1, the output is <code>y</code>. When <code>z</code> is 0, the output is <code>x</code>. The contribution of OR'ing <code>xy</code> to the output of the MUX is redundant, because it is only 1 when ...
https://electronics.stackexchange.com
2,252
[ "https://mechanics.stackexchange.com/questions/2252", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/59/" ]
What could be causing my (non-)starting issues? Occasionally (once every two weeks or so) when the keys are inserted and turned to the start position, nothing happens. No noise, no dome lights dimming if they're already on, nothing. The dash lights come on, as well as any accessories (radio, blower, etc.), but nothing ...
That sounds like an immobiliser problem to me. What happens if you get out, lock, then unlock the van, then try again? Another possible problem is a loose wire between the ignition switch and the solenoid, but in that case I'd expect it to need physical intervention before it would work again (i.e. knocking or wigglin...
Or could be a bad ignition switch.
https://mechanics.stackexchange.com
117,878
[ "https://mathoverflow.net/questions/117878", "https://mathoverflow.net", "https://mathoverflow.net/users/30363/" ]
Assume $X$, $E$ and $G$ are topological groups and $1\to X\to E\to G\to 1$ a short exact sequence of continuous group homomorphisms. Under which of these conditions is $E$ a profinite group? (i) $G$ profinite, $X$ finite (ii) $G$ profinite, $X$ pro-$p$ for some prime $p$ (iii) $G$ profinite, $X$ profinite In those ...
The answer to all three questions is no in general. You need to assume in addition that $G$ carries the quotient topology from $E$. Otherwise, starting from any such exact sequence with $E$ compact and $G$ infinite, you can endow the compact group $E$ with the topology inherited from the embedding into $E\times G_d$ wh...
[EDIT: I assume $X$ is given the subspace topology and $G$ the quotient topology.] The answer to (iii) (and (i) and (ii)) is "yes". Is this not treated in the book "Profinite groups" (which I've never looked at)? I'm less sure about the "explicit" request, since (even for finite $X$) it seems a bit hard to "see" an op...
https://mathoverflow.net
99,078
[ "https://mathoverflow.net/questions/99078", "https://mathoverflow.net", "https://mathoverflow.net/users/1/" ]
<strong>Well-known example:</strong> Consider the function $$f(x,y)=\left\{\begin{array}{c} \frac{x^2y}{x^4+y^2} &amp; \text{if }(x,y)\neq(0,0)\\ 0 &amp; \text{if }(x,y)=(0,0) \end{array}\right.$$ When restricted to any straight line through the origin, this function is continuous. However, if we approach the origin a...
Usually, by a "smooth curve through $0\in\mathbb R^2$", one means a $C^k$ mapping $f:[-a,a]\to\mathbb R^2$ where $k\ge 1$ is the desired degree of smoothness, $a&gt;0$, $f(0)=0$, and $f'(x)\ne 0$ for all $x\in[-a,a]$ (without the last condition, you can get quite ugly images even of $C^\infty$ mappings). Equivalently, ...
Yes you can do this. Suppose you have a sequence of points $c_n$ which converges very fast to zero, so that $n^k c_n$ is bounded for all $k$. Let $h$ be a smooth function that is equal to $0$ for $x\le -1$ and $1$ for $x\geq 0$. Let $t_n=\frac{1}{(n+1)^2}+2\sum_{k=1}^n \frac{1}{k^2}$ and $$g(x)=\sum_{n\geq 0}h(1+n^2(x...
https://mathoverflow.net
312,186
[ "https://dba.stackexchange.com/questions/312186", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/201049/" ]
I have a table on MySQL 5.7 with the following definition and indexes: <pre><code>+-------------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------------+---------------+------+-----+---------+----...
<ul> <li>Please provide <code>SHOW CREATE TABLE</code>; it is more descriptive than <code>DESCRIBE</code>.</li> <li>Add <code>INDEX(archive, col1)</code>, it <em>may</em> help performance.</li> <li>key_len=5 for a 4-byte <code>INT</code> means that it is NULLable; nothing else. (<code>key_len</code> provides no clue o...
Right now you have no index on col1 even though that's the first item in your where clause. You should definitely create an index on the aggregate of col1, archive and created_at. This should solve your speed issue as well.
https://dba.stackexchange.com
336,650
[ "https://softwareengineering.stackexchange.com/questions/336650", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/254584/" ]
I'm studying for a final exam and I came across this question which I found pretty interesting. I was wondering what the stackExchange community who are more experience in scripted languages than I had to say. <blockquote> If you were asked to design a scripting language which was compiled, how would you achieve th...
<blockquote> One point I thought of was to create a compiled version of a Read-eval-print to test mini functions faster than compiling a whole program for ease of testing. </blockquote> How would that speed anything up? Practically all of the CPU time is going to into "eval" rather than "read" and "print". <blockqu...
The question is nonsensical. Interpretation and compilation are properties of the <em>implementation</em>, not the language. In other words, they are properties of the interpreter or compiler (duh!). Every language can be implemented with a compiler, and every language can be implemented with an interpreter. Talking a...
https://softwareengineering.stackexchange.com
75,864
[ "https://mathoverflow.net/questions/75864", "https://mathoverflow.net", "https://mathoverflow.net/users/1648/" ]
I've been thinking about $SU(n)$-invariant metrics on the odd-dimensional spheres $S^{2n-1} \simeq SU(n)/SU(n-1)$. For $S^1$, all such metrics are in correspondence with the positive reals. For $S^{3} \simeq SU(2)$, the tangent space is parallelizable, and so, such metrics are in correspondence with metrics on $R^2$. D...
Assume $n&gt;2$. The $SU(n)$-invariant metrics on the sphere $S^{2n-1}$ are in bijection with $SU(n-1)$ invariant metrics on $T_x S^{2n-1}$ where $SU(n-1)$ is realized as the stabilizer of some $x\in S^{2n-1}$. This action is the sum of the defining $SU(n-1)$-module $V$ and the trivial real 1-dimensional module $T$. Th...
<h2>Classification of <span class="math-container">$SU(n+1)$</span>-homogeneous metrics on <span class="math-container">$S^{2n+1}$</span>:</h2> First, note that for any <span class="math-container">$n\geq1$</span>, the round metric on the sphere <span class="math-container">$S^{2n+1}$</span> can be scaled by <span clas...
https://mathoverflow.net
533,552
[ "https://physics.stackexchange.com/questions/533552", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/222367/" ]
Every time light hits a material, both reflection and refraction occurs. How does a material determine how much light gets reflected/ refracted e.g. glass vs silver? So far what I could find is light gets scattered by atoms in the material in all directions, but they all cancel out except in these 2 directions. But tha...
We know that, <span class="math-container">$\displaystyle R = \rho \,\frac{L}{A}$</span>. So we need the resistance to be constant, Therefore, <span class="math-container">$\rho\dfrac{L}{A} = \text{constant}$</span> or, <span class="math-container">$L\propto \dfrac{A}{\rho}$</span>. Now the material of the resistanc...
Yes, if you have a superconductor. Twice zero resistance is still zero resistance.
https://physics.stackexchange.com
106,910
[ "https://security.stackexchange.com/questions/106910", "https://security.stackexchange.com", "https://security.stackexchange.com/users/81656/" ]
By my admittedly limited understanding of how HTTPS/TLS works, the end user (me) initiates a connection with a remote server which signs every one of its messages with a public key. This public key can be verified (magically) by checking the certificate, which is signed by a CA that vouches for the integrity of that ce...
<h1>Yup.</h1> Yes. (If you consider <em>&quot;My company's admins can change my HTTP(s) traffic&quot;</em> compromise.) Except for some programs that pin their certificate use and fail if another certificate is used. That's pretty much the idea of SSL inspection: Open up SSL/TLS, do some anti-virus-scanning, close up S...
Technically, yes. However, you can still verify whether your connections are being compromised or not: <ol> <li>Install a web browser which uses its own certificate bundles (your employer may forbid that too).</li> <li>Connect to a trusted site using a trusted computer (e.g. at home) and note the certificate fingerpri...
https://security.stackexchange.com
4,500,135
[ "https://math.stackexchange.com/questions/4500135", "https://math.stackexchange.com", "https://math.stackexchange.com/users/973696/" ]
Following a space inversion, vector <span class="math-container">$\bf{A}$</span> goes to <span class="math-container">$\bf{A}^{'} = -\bf{A}$</span> and <span class="math-container">$\bf{B}$</span> to <span class="math-container">$\bf{B}^{'} = -\bf{B}$</span>. How does <span class="math-container">$\bf{A}^{'} \cdot \bf{...
Apply Cauchy-Schwarz inequality twice followed by an application of AM-GM inequality: <span class="math-container">$\sqrt{\dfrac{x^2+1}{x+1}}+\dfrac{2}{\sqrt{x}+1}\ge \dfrac{\sqrt{x+1}}{\sqrt{2}}+\dfrac{2}{\sqrt{x}+1}\ge\dfrac{\sqrt{x+1}}{\sqrt{2}}+\dfrac{2}{\sqrt{2(x+1)}}\ge 2\sqrt{\dfrac{\sqrt{x+1}}{\sqrt{2}}\cdot \d...
First, we can take the first derivative of this function <span class="math-container">$$\frac{d}{dx}\sqrt{\frac{x^2+1}{x+1}}\;+\;\frac{2}{\sqrt{x}+1}$$</span> we get <span class="math-container">$$\frac{x^2+2x-1}{2\sqrt{x^2+1}\left(x+1\right)^{\frac{3}{2}}}-\frac{1}{\sqrt{x}\left(\sqrt{x}+1\right)^2}$$</span> We then w...
https://math.stackexchange.com
52,816
[ "https://cs.stackexchange.com/questions/52816", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/41205/" ]
In preparation for an exam, I've come upon the following problem. Given the constructors : <pre><code>[]: -&gt; T LIST [a]:T-&gt; T LIST cons(a,x) : T x T LIST -&gt; T LIST ( a is added to the beginning of the list) </code></pre> And the functions : <pre><code>size(l) : T LIST -&gt; N (number of elements in l)...
<em>Note:</em> I mixed up boolean functions and propositions in what follows for brevity, and I hope it'll not cause any confusion. I assume you have defined the function $\max?$ something like this: <pre><code>max?(e, l) = ge_all?(e, l) &amp;&amp; member(e, l), </code></pre> where <pre><code>ge_all?(e, []) = True...
Probably you can show that <pre><code>member (e, l) = member (e, unique (l)) || member (e, repeated (l)) </code></pre> Then maximum element it's either among unique elements or among repeated.
https://cs.stackexchange.com
37,875
[ "https://security.stackexchange.com/questions/37875", "https://security.stackexchange.com", "https://security.stackexchange.com/users/27526/" ]
In a typical home user situation with a PC connected to the internet via a router, suppose we are not concerned with protecting the machine from people with physical access. Does setting a password on a Windows XP user account help secure the machine from remote exploits? (compared to a passwordless account). With no ...
No, there is no additional protection against remote exploits, but <strong>you should always set an account password wherever humanly possible</strong>, for a whole host of reasons not related to remote code execution bugs. Remote exploits usually result in code execution, and that code would run under the privilege l...
Well, if you have no external hardware firewall (mostly there is one in the router) and you have file services enabled or things like that, then the remote side could simply connect to your \system\c$ share and place any malware there or whatever. With RPC access the attacker could place things into the registry, etc. ...
https://security.stackexchange.com
203,102
[ "https://physics.stackexchange.com/questions/203102", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/90163/" ]
Imagine a ball ($m= 1\,{\rm kg}$) moving at a velocity $2\,{\rm m}/{\rm s}$ towards a wall. When it hits the wall, it suddenly stops, thereby liberating all its ${\rm KE}$ as heat. Here, the initial kinetic energy, ${\rm KE}_I = (1/2)mv^2 = 2\,{\rm J}$, and final ${\rm KE}$ is obviously zero. So heat liberated (${\rm K...
Initially your ball has some energy ($2J$) and some momentum ($2Ns$). And the wall has some energy ($0J$) and some momentum ($0Ns$). And there is some internal energy, $U=U_0,$ the thing that heat increases. Afterwards the ball has some energy ($0J$) and some momentum ($0Ns$). And the wall has some energy ($0J$) and s...
Timaeus has given the full technical answer: the kinetic energy of the wall itself changes a tiny bit. Since kinetic energy scales as $v^2$, this is totally negligible in the first case (where the wall starts with $v = 0$) but actually significant in the second case (where the wall starts with $v = 2$), and that's wher...
https://physics.stackexchange.com
7,601
[ "https://scicomp.stackexchange.com/questions/7601", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/4524/" ]
I know that ATLAS is able to optimize itself for the machine it is compiled on and thus maximum benefits are found by compiling from source. Is there any benefit to compiling LAPACK from source? It would be much easier to just install the prebuilt package.
OpenBlas is quite fast, so you can link it to LAPACK. Have you tried precompiled version of LAPACK/BLAS from your CPU vendor? For example AMD ACML (free) or Intel MKL (free on linux for non-commercial and non-academic use)? You simply need to unpack and run install file. In my opinion the only advantage of using ATLAS...
In my experience, the best way to use blas/lapack on recent versions of ubuntu is to use the packaged openblas. For what it's worth, I mostly use blas/lapack through python numpy/scipy, and using openblas speeds up some of the linear algebra by like 200x vs. the default. I've tried using custom ATLAS, but it was a hu...
https://scicomp.stackexchange.com
35,283
[ "https://cs.stackexchange.com/questions/35283", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/24576/" ]
I got some problems with building a set, which should looks like this: $S = A\times B \subset N \times N $, where $S$&nbsp;is decidable but $A$&nbsp;is undecidable. Could somebody give me a clue how to actually do this?
Let $A$ be set of Turing machines that halt, which is clearly undecidable. Now $B$ needs to be something that helps you decide $A$ (a certificate if you will, in the sense of a certificate for a $NP$ problem). Hint: if a TM halts, it halts in a finite number of steps.
Let $B \subset N^{2}$. Also we know that exist a set, which is enumerable but undecidable (for example, a set of all $n$ so that $U(n, n)$ is defined). This way, we build a $X \times Y$, which is decidable. More precisely, $(x, y) \in X \times Y$ iff $U(x, x)$ stops in $y$ steps. So $X \times Y$ is decidable, but its ...
https://cs.stackexchange.com
4,558,880
[ "https://math.stackexchange.com/questions/4558880", "https://math.stackexchange.com", "https://math.stackexchange.com/users/979705/" ]
I have homework to do and the question is : <span class="math-container">$$\text{Prove that for all } z \in \mathbb{C} \setminus{\{-1\}}, \frac{1-z}{1+z} \in \mathbb{R} \leftrightarrow z \in \mathbb{R}$$</span> So I started by saying that <span class="math-container">$z = a+ib$</span> with <span class="math-container">...
Let <span class="math-container">$A=1$</span> and <span class="math-container">$B=a-ib$</span>. Then <span class="math-container">$A+B=1+a-ib$</span> and <span class="math-container">$A-B=1-(a-ib)=1-a\color{red}+ib$</span>. As @Stinking Bishop wrote, <span class="math-container">$(1-a-ib)(1+a-ib)=(1-ib-a)(1-ib+a)=(1-ib...
One characterisation of reals is given by <span class="math-container">$u=\bar u$</span> for <span class="math-container">$u\in\mathbb C$</span> Let <span class="math-container">$u=\dfrac{1-z}{1+z}\ $</span> then <span class="math-container">$\ u=\bar u\iff \dfrac{1-z}{1+z}=\dfrac{1-\bar z}{1+\bar z}$</span> For <span ...
https://math.stackexchange.com
65,289
[ "https://dba.stackexchange.com/questions/65289", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/38519/" ]
I have the following table: <pre><code>CREATE TABLE word( word CHARACTER VARYING NOT NULL, id BIGINT NOT NULL, repeat INTEGER NOT NULL ); ALTER TABLE public.word OWNER TO postgres; ALTER TABLE ONLY word ADD CONSTRAINT "ID_PKEY" PRIMARY KEY (word,id); </code></pre> When I try to restore it using following command: <...
<blockquote> how can i use multiple primary keys in postgres ? </blockquote> You can't. It's an oxymoron - the definition of a primary key is that it's <em>the</em> primary key, singular. You can't have more than one. You can have multiple <code>unique</code> constraints. You can have a primary key that contains mu...
You can define a table like this: <pre class="lang-sql prettyprint-override"><code>CREATE TABLE mytable ( field1 INTEGER, field2 INTEGER, PRIMARY KEY (field1, field2) ); </code></pre>
https://dba.stackexchange.com
78,416
[ "https://softwareengineering.stackexchange.com/questions/78416", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/8020/" ]
Too often, I can see that there are many viable programmers without college degrees in Computer Science, Informatics, etc. Now that I've been reading more articles about underperforming education and the insignificance of college degrees (especially as a programmer), will a college degree ever hurt my employability? ...
<strong>No.</strong> The reason it seems like quite a few self-taught programmers "make it big without a degree" is the same as the reason why it seems like all people who make it to 120 lived on cigarettes and bacon and drank a bottle of whiskey every day: <strong>exceptions draw a lot of attention</strong>. Good se...
The degree is going to open a bunch of doors for you (Recruiters use this as a base line. You have to be a star programmer to be selected for interviews, if you don't have a CS degree/ come with a pedigree). Also the community aspect of a degree is very important too - your current class mates are gonna be future hirin...
https://softwareengineering.stackexchange.com
401,775
[ "https://physics.stackexchange.com/questions/401775", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/193619/" ]
I'm a beginner in optics and my understanding of virtual objects is that a virtual object is defined as a point from where incident light rays apparently seem to be coming from. But can a virtual object exist outside of the human brain? Can it exist without an observer? I also read that real image of a vitual object c...
Don't get stuck at the word "virtual", it has nothing to do with the image not being a well defined thing in the physical world. It is just (arbitrary) nomenclature. A real image is one that can be projected onto a screen (that is, where the light coming from one point of the object is approximately collected in one p...
A real image is a very tangible thing. Make a small real image of the Sun using a magnifying glass, put a match where the image is and it will burn. As for virtual objects, disregard lenses and just consider a mirror. Are there objects on the other side of a mirror? No, but it’s easier to calculate light paths by assu...
https://physics.stackexchange.com
344,779
[ "https://stats.stackexchange.com/questions/344779", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/201516/" ]
Basic question about MCMC Metropolis–Hastings algorithm. I am trying to understand the Metropolis–Hastings algorithm and it's connection to Bayesian Analysis. Suppose I want to construct an MCMC MH algrorithm to evaluate my posterior distribution in the my Bayesian Analysis. I am looking at the step where $\alpha$ is ...
You have still a lot of confusion. I'll try to explain with an example. Let suppose $\mathbf{Y}= (y_1, \dots ,y_n)'$,and you have $$ Y_i = \beta_0+\beta_1x_i+\epsilon_i $$, with $$ \epsilon \sim N(0,\sigma^2) $$ i.e. a regression model. Then your parameters are $\theta= (\beta_0, \beta_1, \sigma^2)'$. The observat...
There is a lot of confusion. You want to evaluate the posterior $$ f(\theta|\mathbf{y}) =\frac{f(\mathbf{y}|\theta)f(\theta)}{f(\mathbf{y})} $$ where I use $f()$ to indicate a density, to be as general as possible. You have to decide the likelihood of your model, i.e., $f(\mathbf{y}|\theta)$, and the prior over $\thet...
https://stats.stackexchange.com
61,112
[ "https://mathoverflow.net/questions/61112", "https://mathoverflow.net", "https://mathoverflow.net/users/11966/" ]
Spectrum decomposition can be regarded as the generalizations of the following fact that: Every Hermitian matrix $A$ can be decomposed into $A=U^{*}\Lambda U$,where $U$ is a unitary matrix Singular vector decomposition can be expressed as Every Matrix $A_{mn}$ can be decomposed in to $A=U\Lambda V^{*}$, where $U$,a...
The simplest generalization is that a "compact self adjoint linear operator" on a Hilbert space can be diagonalized in terms of (an infinite number of) eigenvalues and eigenfunctions that are elements of the Hilbert space. This can be extended to non-compact but still self adjoint operators, but it's more complicated ...
This should really be a comment, not an answer, but I decided it perhaps could do with extra visibility. The current version of your question, asks, among other things, once we have corrected the terminology: <blockquote> Do operators on Hilbert space have a decomposition $A=U\Lambda V^*$ where $U$ and $V$ are unit...
https://mathoverflow.net
145,988
[ "https://physics.stackexchange.com/questions/145988", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/46156/" ]
Given only the length of an organ pipe to be $2.14 m$, is it possible to find what frequency it vibrates at? If I use the equation $f=\frac{v}{\lambda}$, does the $v$ apply to the speed of sound in the organ pipe or in air?
The speed of sound should apply to $v$ because the sound waves are travelling through the air after it leaves the organ pipe. The speed of sound is approximated by the following formula: $$ v = 331.3 + 0.606T $$ Where $T$ is the temperature in degrees Celsius, and $v$ is the velocity in meters per second. In your ca...
<span class="math-container">$v$</span> applies to the speed of sound in the equation <span class="math-container">$f=\frac{v}{\lambda}$</span>. Assuming air to be an ideal gas we can use the following equation to calculate the speed of sound in air: <span class="math-container">\begin{equation} v=331.3\sqrt{1+\frac{T}...
https://physics.stackexchange.com
675,998
[ "https://math.stackexchange.com/questions/675998", "https://math.stackexchange.com", "https://math.stackexchange.com/users/128703/" ]
How do you evaluate this trigonometric integral: $$\int 7\tan^5x\sec^2 x\,dx$$? Please help. Thank you in advance for your help.
Given $\int 7\tan ^5 x \sec ^2 x dx$, let $\tan x=t$. Then $\sec ^2 x dx=dt$. Hence we must have $I=7\int t^5 dt= 7\frac{t^6}{6}+c=\frac{7}{6}\tan ^6 x+c$ where $c$ is constant.
Since the exponent of $ \ \tan x \ $ is odd and that of $ \ \sec x \ $ is even, this "trigonometric powers integral" works the other way, too: Choosing $ \ u \ = \ \sec x \ , $ we have $ \ du \ = \ \tan x \ \sec x \ dx \ $ and so may write $$ 7 \int \ \tan^4 x \ \sec x \ \ (\tan x \ \sec x \ dx) \ = \ 7 \int \ (\tan...
https://math.stackexchange.com
743
[ "https://mechanics.stackexchange.com/questions/743", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/471/" ]
The AC on my 2002 Chevy Cavalier stopped blowing cold in the fall and I had planned on getting it checked out and recharged once the AC check specials started. I saw this for $30 and it seems too good to be true. Do they work? Anything I should look out for? <img src="https://i.stack.imgur.com/PZhts.jpg" alt="enter...
They do work. I've used them often. <ol> <li>If your low on freon, there may be a leak. However, if this is the case use a bottle of stop leak first or a bottle mixed with stop leak. It should seal up an value leakage. Replacing your AC unit is costly, most leaks can be fixed with a stop leak sealant unless the proble...
I got that exact same product! The hose didn't work very well. I ended up buying a separate hose for $15 or so, with brass fittings. Also, as Patrick said, a large amount of refrigerant solves a large refrigerant leak. And it won't solve it for long. So, I recommend either <ul> <li>Go to the shop and get a leak tes...
https://mechanics.stackexchange.com
42,975
[ "https://dsp.stackexchange.com/questions/42975", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/30167/" ]
I wonder if an efficient method exist to compute how much a signal is periodic, it should be ~1.0 when the signal is totally periodic (like a sinusoïdal signal) and ~0.0 when totally random, like a white noise. Edit : This question came with a big misunderstanding, it has been modified to fit the answer.
I suggest using Spectral Flatness, aka Wiener Entropy. It is defined as a ratio of geometric and arithmetic mean of the magnitude spectra <span class="math-container">$X(k)$</span>: <span class="math-container">$$\Xi=\dfrac{\sqrt[K]{\prod_{k=0}^{K} X(k)}}{\frac{1}{K}\sum_{k=0}^{K}X(k)} $$</span> For signals which have ...
The unbiased, normalized autocorrelation function (ACF) $r_{xx}[\tau]$ directly computes the desired "periodicity coefficient". It is defined as $$ r_{xx}[\tau] = \frac{N}{\left\|x\right\|_2^2\cdot(N-\tau)}\sum_{i=0}^{N-\tau-1}x[i]x[i+\tau]\quad\text{ for }0\leq \tau \leq (N-1), $$ with $\left\|x\right\|_2^2$ the squ...
https://dsp.stackexchange.com
101,135
[ "https://electronics.stackexchange.com/questions/101135", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/19220/" ]
Is SPI ever wired as open collector in devices calling for the use of pullup resistors? Everything seems to point to it usually being totem pole but I wonder if there are exceptions. The only pullup really required seems to be on the chip select, but sometimes a pullup on MISO seems to be used also for reliability/rob...
As far as I know, SPI lines are always actively driven in both directions. I sometimes put a pulldown on the MISO line because it could be floating for extended periods of time. Only the slave with slave select asserted is allowed to drive the line, so when no slave is selected, the line floats. Floating MISO doesn'...
<blockquote> sometimes a pullup on MISO seems to be used </blockquote> This is done mostly on SD cards, because they come out of reset as open drain and must be switched into SPI with a command. You would also need a pullup/down when the slave may be disconnected somehow to put the non-driven line to a known state. ...
https://electronics.stackexchange.com
87,132
[ "https://dba.stackexchange.com/questions/87132", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/55744/" ]
I decided to stop using H2 for obvious reasons (I have Oracle on production, compatibility mode is a fake). So, I wrote simple test framework which for each test in my application does the following: <ol> <li>Generate random username (in example below it's <code>test_user</code>).</li> <li>Create new user and tablespa...
<h3>Speed up 2:</h3> <ul> <li>If you create the tablespace with let's say 100M and extend it with 50M or 100M, your database is much quicker than with 500k extension. This way the database keeps extending the file over and over again.</li> <li>You can also use ASM which is much faster in creating files than traditiona...
Actually, one more possible approach came to my mind. <ol> <li>Create a db with <code>n</code> tablespaces. </li> <li>Test framework would maintain a pool of these tablespaces.</li> <li>Each test would <em>lease</em> a tablespace from a pool.</li> <li>When tablespace is <em>returned</em> framework cleans it up and ma...
https://dba.stackexchange.com
101,028
[ "https://electronics.stackexchange.com/questions/101028", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/16096/" ]
If I setup an opamp in a non-inverting configuration as follows: <img src="https://i.stack.imgur.com/SIpIZ.png" alt="enter image description here"> Vrail+ is 7.5V, Vrail- is GND (0 V) Vin is 2.5V, Vout = 3.3V (in other words, the gain, aka, 1+R2/R1 is 1.32 [V/V]) Iout = 100mA (connected to some load) What are the...
The inherent efficiency will be the same as any other linear regulator, give or take, depending on the op-amp quiescent current (could be uA to mA for the op-amp just sitting there with no load). \$P_D = (V_{in} - V_{out}) \cdot I_{load} + I_q \cdot V_{in} \$ 100mA will require an expensive op-amp or a booster stag...
Opamps can't usually supply 100 mA. But, they can still be used to control a power voltage if you add some current gain to their output. If you really want a opamp to control a power voltage that can supply 100s of mA, here is a simple way: <img src="https://i.stack.imgur.com/NgwCo.gif" alt=""> The opamp still does...
https://electronics.stackexchange.com
272,464
[ "https://electronics.stackexchange.com/questions/272464", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/124001/" ]
i have a few 2N5064 SCR that are puzzling me. No matter how many hundreds of thousands of ohms i put between their gates and a 3.2V battery source, it always starts to conduct. I even put a 10 V zener between them, and it still turns on. Looking at the datasheet, i am puzzled. Where minimum gate turn on current is, the...
2N5064 is a sensitive-gate SCR. It triggers with a maximum of 200uA at room temperature (Tj = 25°C). No minimum is specified in the official data, as you can see. Edit: In order to keep it "off" guaranteed, you should keep the gate voltage to less than 100mV, which is guaranteed to not trigger up to Tj = 125°C or s...
Since it's guaranteed to trigger from 200 uA, you'd have to limit the current to less than that to have a hope of it not triggering. From a 3.2 V source, we can compute from Ohm's law that R = 3.2 / .0002. This tells us that if the resistor is 16K ohms (or less), it's <em>guaranteed</em> to trigger. It doesn't tell u...
https://electronics.stackexchange.com
87,049
[ "https://datascience.stackexchange.com/questions/87049", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/84229/" ]
I am building a CNN from scratch, and I am trying to change the number of convolutional layers to see what happens. I have noticed that <strong>decreasing the number of convolutional layers increases the number of parameters</strong>. This fact really surprised me, since I was expecting to see a decrease in the number ...
Generally removing the number of convolutional layers indeed decreases the number of parameters in a network, but given your situation I suspect you are using fully connected layers after the convolutional layers in your network. When removing some convolutional layers it means that the image/tensor size before being p...
When calculating parameters between a FC and a CONV layer: the formula is <blockquote> ((Conv layer height * width * channel) + 1 ) * units in FC layer </blockquote> So, when you remove a CONV layer, the previous CONV layer gets connected to FC layer. This results in higher number of parameters. <em><strong>For Example...
https://datascience.stackexchange.com
519,916
[ "https://math.stackexchange.com/questions/519916", "https://math.stackexchange.com", "https://math.stackexchange.com/users/87430/" ]
<blockquote> Find the number of $3$ digit numbers (repetitions allowed) such that at least one of the digit is $9.​$ </blockquote> I've posted my answer below. If there is a better way to solve this question, I would be glad to learn about that.
Suppose that 'three-digit' means $abc$, where $a&gt;0$. Now, we first count that there are $900$ of these numbers. Of numbers without a $9$, then it's $8\times 9 \times 9$, since the first digit can be any of 1-8, and the rest 0-8. This gives $648$ numbers without a 9. One then finds that there are $252 = 900-64...
If unit place is $9,$ hundredth place would have $9$ options $(1\,\text{to} \,9),$ tens place would have $10$ options $(0\, \text{to}\, 9).$ Total ways $90.$ When $9$ is fixed for tens place, unit place choices$=9 (0\, \text{to}\, 8),$ hundredth place choices$= 9 (1\, \text{to}\, 9).$ Total$=81.$ When $9$ is fixed fo...
https://math.stackexchange.com
132,011
[ "https://mathoverflow.net/questions/132011", "https://mathoverflow.net", "https://mathoverflow.net/users/34427/" ]
Is it true that the equation $10^{n}-9m^{3}=1$ has only one positive integer solution, namely $n=m=1$? I can't find the answer. This has an equivalent description that the repunits $R_n = 11\dots1$ are not cubic numbers.
Rather to my surprise I find an entirely elementary proof that $R_1=1$ is the only (decimal) repunit cube, using nothing beyond quadratic reciprocity (namely the formula for the Legendre symbol $(-5/p)$). Let us first dispose of the case that $n$ is even, say $n=2k$. This is routine: write the equation $10^n - 9m^3 = ...
As expected $(m,n)=(1,1)$ is the only solution in positive integers of the exponential Diophantine equation $10^n - 9m^3 = 1$. An entirely elementary proof of this seems unlikely because any finite list of congruence conditions on $n$ would have to allow $n=1$ (and also $n=0$, which corresponds to the empty repunit...
https://mathoverflow.net