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 |
|---|---|---|---|---|---|
230,451 | [
"https://softwareengineering.stackexchange.com/questions/230451",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/67077/"
] | I recently tend to design my methods in the following way:
<pre><code>if ( 'A' === $a ) {
if ( 'B' === $b ) {
return 'some thing';
} else if ( 'C' === $c ) {
return 'some other things';
}
}
/* If you made it up to here, then something has gone wrong */
return false;
</code></pre>
So basic... | A Fail-fast design is really the same structure but with reverse order to avoid the arrowhead code.
A fail fast design would be:
<pre><code>if ( 'A' !== $a )
return false;
if ( 'B' === $b ) {
return 'some thing';
}
if ( 'C' === $c ) {
return 'some other things';
}
return false;
</code></pre>
Less indent... | Regarding your second question, my 2 cents are that your methods should not return anything if the input was not in the correct/expected format. Don't be afraid to use exceptions for expressing something like 'i cannot work with this input'.
| https://softwareengineering.stackexchange.com |
158,328 | [
"https://softwareengineering.stackexchange.com/questions/158328",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/60193/"
] | For an area of an application that has been developed, the request has come in to remove an item from a menu.
I know this is a small thing, but how do you treat it in Scrum? I'm used to using User Stories for adding functionality, not removing.
So my question is: Should I create a user story for this, somehow phrase... | <strong>Yes, you should write a user story.</strong>
Use a story for everything you do. It forces you to answer the question "what business value is there in doing this work?". Writing user stories also forces you to understand who benefits from the work.
Plus, you <em>are</em> adding something. Presumably, the remov... | It depends on the reason that the button is being removed:
<ul>
<li>If it is being removed because the functionality is no longer
needed/used, then write a user story indicating the business
requirement change.</li>
<li>If it is being removed because it's confusing, or behaving
improperly, then tie the work to the bug... | https://softwareengineering.stackexchange.com |
254,780 | [
"https://softwareengineering.stackexchange.com/questions/254780",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/65453/"
] | I am an experienced java developer.Of now I have started learning multithreading in java.I am able to grasp most of the concepts but still I am unable to visualize applications running on threads.I know the concept but somewhere if I am given a problem statement, I am unable to think or visualize it in threads.How shou... | The easiest way is to think of threads as processes (and this is the case in some unixy systems that spawn a new process where some systems would create a new thread).
A process is a blob of code and data with a stack and a single thread anyway.
Once there, you can start to imagine sharing data between threads- its e... | I usually think about thread as an arrow that execute your code(Like when you're debugging on Eclipse or Netbeans);<br>
This little arrow executes your code, but instead of having just one, you'll spawn another one.<br>
In Java, you have to let a class implements the Runnable interface that lets you implement the run(... | https://softwareengineering.stackexchange.com |
57,071 | [
"https://electronics.stackexchange.com/questions/57071",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/18047/"
] | First, I acknowledge that there are several questions regarding this topic in the forum, however, the answers assume too much background knowledge of electronics to be of use to a true beginner (like myself). That being said, if you choose to answer, please limit your responses to heuristic (non-technical) explanations... | First: Yes, your understanding is essentially correct, other than the issue being voltage and not charge.
<strong>Here is my analogy:</strong>
Consider a <strong>door</strong> to a house, with really smooth hinges, and no bolt or latch. The door is so light and so well-hinged that the slightest breeze would cause it ... | A pull up/down does three things.
1, it stabilizes the line, with a fixed reference (V+ for a pull up, or Gnd for a pull down, in most cases). The line will not float around. This could also be done without the pull-up, by directly connecting it to V+ or Gnd. This is a problem, which part 2 fixes.
2, <strong>it prote... | https://electronics.stackexchange.com |
341,558 | [
"https://softwareengineering.stackexchange.com/questions/341558",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/205818/"
] | Much has been told about the advantages of agile development and Scrum in particular, however, most of these assessments assume that an organisation comes from a very rigid methodology of Waterfall. But what if a company is organised less strictly than advised by Scrum, not more?
The organisation I work for is a form... | If your teams are producing code of appropriate quality at a rate acceptable by management, there is nothing to be gained by using scrum. In a sense, scrum is a framework to guide a team to reach this exact state.
However, if your code is of low quality, or if the code you develop doesn't always meet the needs of the... | One sort of counter-intuitive benefit to scrum is it forces you to prioritize your backlog, be really aware of your actual capacity, and limit your work in progress. What we found when we started doing scrum was we thought we were being really responsive by tackling things as they came, but really each new thing we to... | https://softwareengineering.stackexchange.com |
93,225 | [
"https://datascience.stackexchange.com/questions/93225",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/116267/"
] | I'm trying to understand what I did wrong when trying to answer this question. The exact question is:
<blockquote>
Assume that we have 3 trained prediction models, and each model outputs either
-1 or 1. We then tested the accuracies of these models and obtained the following outcomes:
</blockquote>
<div class="s-table... | It's not the actual data, it's the probabilities. So you should consider all the scenarios of voting.
For the Ensemble to be correct,
<br><em>Either any two or all the three should be correct</em>
=<span class="math-container">$[m_1*m_2*(1- m_3) + m_1*(1-m_2)*m_3) + (1-m_1)*m_2*m_3] + [m_1*m_2*m_3]$</span>
= <em>[0.6*0... | You would get a correct prediction if model's 1, 2 and 3 were
<ul>
<li>Correct, Correct, Correct
</li>
<li>Correct, Correct, Wrong
</li>
<li>Correct, Wrong, Correct
</li>
<li>Wrong, Correct, Correct
</li>
</ul>
Likewise, You would get a wrong prediction if they were
<ul>
<li>Wrong, Wrong, Correct</li>
<li>Wrong, Correc... | https://datascience.stackexchange.com |
95,493 | [
"https://cs.stackexchange.com/questions/95493",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/90246/"
] | I am given an list of numbers and A number-s. I need to find out the collection(s) of numbers from the list of numbers whose sum corresponds to the given number s.
<pre><code>for example - the given set is [2,8,3] and given integer 9
Then I can tell {3,3,3} or {3,2,2,2} can be the required sets.
</code></pre>
Unfortu... | There are many techniques that can be used by an OS. Still, usually when the OS loads an executable file, it finds inside it how much memory to allocate at the beginning for the "heap".
The "stack" can be set to a minimum amount, and then gradually increased as soon as things are pushed on it.
When the program starts... | <code>malloc</code> is a library function that makes use the <code>sbrk</code> system call. The manual page of <code>malloc</code> on Linux says:
<blockquote>
Normally, malloc() allocates memory from the heap, and adjusts the size of the heap as required, using sbrk(2).
</blockquote>
If we now look at <code>sbrk</... | https://cs.stackexchange.com |
68,437 | [
"https://datascience.stackexchange.com/questions/68437",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/90387/"
] | I have a dataset with 4 predictor variables <span class="math-container">$X_1, X_2, X_3, X_4,$</span> and one response variable <span class="math-container">$Y$</span>. I have been asked to check the correlation between these variables and see how they are related and then use a linear model to fit them.
No split of tr... | Load some data:
<pre><code># Load data
library(ISLR)
cars = head(ISLR::Auto,100)
</code></pre>
Split data into two parts (train and "rest"):
<pre><code># 70% Sample size
smp_size <- floor(0.7 * nrow(cars))
# Set seed to control randomness
set.seed(123)
ind <- sample(seq_len(nrow(cars)), size = smp_size)... | Usually you choose the ratio between training and test data by how many samples you have. For example, if you do not have that many you would go to something like 90:10, but with a larger one you can even consider something like 75:25, although, 80:20 sounds good for your case.
For the random splitting that you are tal... | https://datascience.stackexchange.com |
1,046,531 | [
"https://math.stackexchange.com/questions/1046531",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/132479/"
] | If $ax^2+bx+6=0$ doesn't have $2$ distinct real roots, then find the least value of $(3a+b)$
$a,b\in \mathbb R$
Any hint for this question?
| Picking up from $b^2 \leq 24a$, we have $b^2 + 8b \leq 8(3a + b)$ or $$\frac{1}{8}\left( b^2 + 8b \right) \leq 3a + b$$
Now what is the minimum value of the LHS?
| HINT:
What happens when $D=b^2-4ac>0$ and what happens when $D=0$ and $D<0$
| https://math.stackexchange.com |
181,205 | [
"https://softwareengineering.stackexchange.com/questions/181205",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/883/"
] | Consider an existing project that is dual-licensed GPL + either MIT or BSD.
Since it's dual-licensed, when I fork, can I pick one license in the fork? Or do my forked files need to continue to be dual-licensed?
It sure would be simpler to track only one license.
| If, and only if, the project is truly dual licensed then you may pick your preferred license and fork from there. But you must make sure that <strong>all</strong> aspects of the code that you <em>need</em> are licensed in your preferred license. You <em>are</em> allowed to carve apart a project to 'cherry pick' just ... | <em>Note, I am not a lawyer.</em>
When a project is dual-licensed it means that you can choose to license the work from the author under either one of the licenses. You are only bound by the one you pick—that is the whole point of dual licensing (though I don't understand the point of dual-licensing under the GPL and ... | https://softwareengineering.stackexchange.com |
571,292 | [
"https://stats.stackexchange.com/questions/571292",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/299869/"
] | I want to simulate data of the following random intercept effect model in R
<span class="math-container">$$Y_{ij}=\alpha+\beta x_{ij}+u_{0,i}+\epsilon_{ij}$$</span>
<span class="math-container">$$u_{0,i} \sim N(0,\tau^2)$$</span>
<span class="math-container">$$\epsilon_{ij} \sim N(0,\sigma^2)$$</span>
Here the intercep... | Fairly straightforward.
One way to express a random intercept model is in matrix notation like
<span class="math-container">$$ y = X\beta + Zu$$</span>
Here, <span class="math-container">$X$</span> is a design matrix, <span class="math-container">$\beta$</span> are regression coefficeints, <span class="math-container">... | As Xi'an indicates, start with the upper levels. Simulate the random intercepts for each group, <span class="math-container">$u_{0,i}$</span>. The rnorm(∙) function will work.
Next, you want to generate the <span class="math-container">$x_{i,j}$</span> values and the residual error terms at the lowest level. I recom... | https://stats.stackexchange.com |
699,767 | [
"https://physics.stackexchange.com/questions/699767",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/315774/"
] | Is it possible to control phase of a light radiation?
Assume I have two point sources A and B. They emit spherical waves of a green light (or any other color).
Is it possible to make such physical system where the phase of B is shifted by some <span class="math-container">$\theta$</span> in comparison to A.
| The challenge is to make two sources that are highly coherent but spatially separated. The easy ways to do that generally involve starting with a single source and splitting its output (for example with beam splitters, partially reflective mirrors, or fiber optic couplers) and routing the beams to different locations.
... | For example, a spherical shell with controlled refractive index around B.
| https://physics.stackexchange.com |
49,799 | [
"https://mathoverflow.net/questions/49799",
"https://mathoverflow.net",
"https://mathoverflow.net/users/5572/"
] | Given a graph $G(V,E)$ whose edges are colored in two colors: red and blue.
Suppose the following two conditions hold:
<ul>
<li>for any $S\subseteq V$, there are at most $O(|S|)$ red edges in $G[S]$</li>
<li>for any $S\subseteq V$, if $G[S]$ contains no red edges, then it contains $O(|S|)$ blue edges</li>
</ul>
My q... | I think one can push through the probabilistic arguments of Tim Gowers and Fedor Petrov in the general case, as follows.
Let $c$ be a constant such that the number of red edges in $G[S]$
is at most $c|S|$ for every $S \subseteq V(G)$. One can order the vertices of $G$: $v_1, v_2, \ldots, v_n$, so that every vertex ha... | Suppose that the red edges can be written as a union of k matchings, $M_1,\dots,M_k$. Now choose a random set of vertices as follows. For each edge in $M_1$ choose one of its end points randomly. Put in all other vertices with probability 1/2. Then do the same for $M_2,\dots,M_k$. This gives us sets $A_1,\dots,A_k$. Le... | https://mathoverflow.net |
16,443 | [
"https://cstheory.stackexchange.com/questions/16443",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/7531/"
] | Consider a circuit that takes as inputs numbers in $[0,1]$, and has gates that consist of the functions $\max(x, y)$, $\min(x, y)$, $1 - x$, and $\frac{x+y}{2}$.
The output of the circuit is then also a number in $[0,1]$.
Does anyone know if this model, or a closely related model, has been studied?
Specifically, I'm... | The satisfiability problem for these circuits (i.e., given a circuit $C$ and $u\in[0,1]$, decide whether there is an input $x$ such that $C(x)\ge u$) is in NP, and therefore NP-complete by Neal Young’s comment and Peter Shor’s answer.
We can construct a nondeterministic reduction of the problem to linear programming ... | This problem is NP-hard.
You can get 3-SAT with the gates <em>min</em>(<i>x</i>,<em>y</em>), <em>max</em>(<i>x,y</i>) and 1−<em>x</em>.
What we want is to reduce a 3-SAT problem to a circuit for which you can get 1 if all the variables are satisfiable, and you can only achieve something strictly less than 1 oth... | https://cstheory.stackexchange.com |
96,046 | [
"https://physics.stackexchange.com/questions/96046",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/36793/"
] | How to write the total wavefunction of a Baryon including space part, spin part, isospin part and color part such that the net wavefunction is antisymmetric? What is the difference in wavefunctions of two different baryons but of same quark content say proton $p$ and $\Delta^+$ baryon?
| To write the wavefunction of a baryon, you write it as a direct product of the different parts of the wavefunction (just as you would for any other particle):
\begin{equation}
\left| \psi \right\rangle = \left| \mbox{spatial} \right\rangle \otimes \left| \mbox{spin} \right\rangle \otimes \left| \mbox{Isospin} \righ... | You can think of $\Delta^+$ as just the energized state of $p$, due to the spin configuration of the three quarks, and therefore different total spin ($3/2$ vs. $1/2$). This is much the same as the hydrogen atom, where different angular momentum states lead to different energy states.
| https://physics.stackexchange.com |
3,196,145 | [
"https://math.stackexchange.com/questions/3196145",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/450884/"
] | I'm looking for an expression of the variance of a single component of a point chosen from within a uniformly distributed n-ball with radius r for any n.
There are a few proofs showing that components of a point chosen this way become increasingly normally distributed as n tends to infinity. I can't seem to find expre... | Assume first the radius of the ball is <span class="math-container">$r=1$</span>.
Write your point <span class="math-container">$X$</span> as a scaled point of the surface of the unit sphere: <span class="math-container">$X=R\sigma$</span>, where <span class="math-container">$R=\|X\|$</span> and <span class="math-cont... | I didn't totally follow @kimchi lover's answer (particularly his assumption of normality), so here is a similar approach.
Suppose X is hyperspherically uniformly distributed with r=1, so each <span class="math-container">$X_i$</span> has <span class="math-container">$E[X_i] = 0$</span>, and we want to compute <span cl... | https://math.stackexchange.com |
2,995,054 | [
"https://math.stackexchange.com/questions/2995054",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/223599/"
] | If <span class="math-container">$\cos^4x.\sec^2y,\dfrac{1}{2},\sin^4x.\csc^2y$</span> are in A.P, then prove that <span class="math-container">$\cos^8x.\sec^6y,\dfrac{1}{2},\sin^8x.\csc^6y$</span> in AP.
<strong>My Attempt</strong>
<span class="math-container">$$
\cos^4x.\sec^2y+\sin^4.x\csc^2y=\frac{\cos^4x}{\cos^2y}... | Assume <span class="math-container">$V$</span> is non-trivial. Fix a vector <span class="math-container">$v\neq 0$</span> in <span class="math-container">$V$</span>. Simply define the injection
<span class="math-container">$$k\to V: \lambda \to \lambda v$$</span>
This does not work if <span class="math-container">$V... | You can't prove it since it is not true. For instance, <span class="math-container">$k\not\subset k^2$</span>.
| https://math.stackexchange.com |
336,638 | [
"https://softwareengineering.stackexchange.com/questions/336638",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/66237/"
] | I am designing a <code>REST</code> <code>API</code> and facing a choice of formatting my <code>POST</code> methods to absorb parameters free-form via query string or content parameters:
<pre><code>POST /my/api HTTP/1.0
paramOne=XYZ&paramTwo=ABC
</code></pre>
or expect that a rigidly formatted data message (XML/J... | There is one concrete difference between the two.
The length of the query string is severely limited (depending on what browser/server you are using) compared the the max size of a POST request
8000 characters might seem like a lot, but if you are sending lists of things with long parameter names you can soon run out... | I'd suggest looking more broadly at both the POST and the GET, with an eye for some consistency for your API, especially since you are looking at REST.
Various identifiers of the desired information (resource) for the GET necessarily go in either the path or the query parameters as there is no body.
For the same para... | https://softwareengineering.stackexchange.com |
3,531 | [
"https://physics.stackexchange.com/questions/3531",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/1394/"
] | A distant star like the sun, thousands of light years away, could be so faint that only one photon might arrive per square meter every few hundred seconds. How can we think about such an arriving photon in wave packet terms?
Years ago, in a popularisation entitled “Quantum Reality”, Nick Herbert suggested that the pho... | first of all, the shape of the wave function of a photon that is emitted by an atom is independent of the number of photons because the photons are almost non-interacting and the atoms that emit them are pretty much independent of each other. So if an atom on the surface of a star spontaneously emits a photon, the phot... | Nigel,
I would like to make another suggestion concerning this question. I have not read the 1985 book by Nick Herbert, but from online links I see that he was discussing the "Hanbury Brown and Twiss" mechanism for optical interferometry. Although this sounds like quite a mouthful and not very fundamental - in fact it... | https://physics.stackexchange.com |
389,775 | [
"https://softwareengineering.stackexchange.com/questions/389775",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/23361/"
] | I am facing a design problem related to the design of the user notification messages to be used in a web application.
Just for the record, I am working in a JS environment and use a json structure to store user notification messages. However, I think the actual tech stack I use is of no importance here, since this is ... | What do you know about the actors of the system? Are they tech-savvy? For tech-savvy users, the word <code>Entity</code> is totally meaningless. Are they even humans? Are they HTTP clients?
As in the real world, messages should be adapted to the interlocutor.
What do the requirements say about these messages? Are the... | First of all, success and error/failure messages are not symmetric. Success should be signalled clearly but unobtrusively. Normally, removing the spinning cursor that indicates a running operation should be enough.
On the other hand, error messages should convey as much information to the user as is available and help... | https://softwareengineering.stackexchange.com |
61,784 | [
"https://electronics.stackexchange.com/questions/61784",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/20474/"
] | So,
I'm not understanding how NPN transistors really work in this scenario. In this image, I
have highlighted what I understand to be the collector and emmiter. My understanding is
that power flows from the collector, TO the emitter right?
In this example, the base either turns the circuit on or off. I get that ... | An analogy may help to visualize this:
Think of the transistor as a valve or faucet. The base is the knob, the water tends to flow from the positive side (storage tank) to the ground (drain), if you follow the normal "current flow" directions.
The LED is like a little transparent glass section in the pipe, with a sm... | <blockquote>
But, why is the emitter running to ground? Shouldn't it be the other way, collecting and emitting to the LED?
</blockquote>
It is, but the charge carriers are negative electrons, so they move (well, nudge each other along, really) in the opposite direction from what the idea of <em>conventional current<... | https://electronics.stackexchange.com |
34,066 | [
"https://mathoverflow.net/questions/34066",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3077/"
] | Suppose $R$ is a Cohen-Macaulay ring. It is well known that if $I$ is an ideal of $R$ generated by $n$ elements, and $I$ has codimension $n$, then $R/I$ is also Cohen-Macaulay.
Now suppose that $I$ does not have codimension $n$, but (the scheme defined by) $R/I$ has several irreducible components, one of which has co... | Hi Alex, I think this fails for $n=2$. Start with a polynomial ring $S$ and height $2$ prime $P$ such that $S/P$ is not Cohen-Macaulay (for example let $P$ be the kernel of the map $S=k[a,b,c,d] \to k[x^4,x^3y,xy^3,y^4]$). Let $a,b$ be a regular sequence in $P$. Let $R=S[t]$ and $I=(ta,tb)$. Then $I$ has height $1$ a... | To complement Hailong's answer, here is another way of seeing that an irreducible component of a Cohen-Macaulay scheme need not have special properties. In the example below, the whole scheme is Cohen-Macaulay, so all of its components have the same dimension, unlike in Hailong's example.
Let $X$ be a reduced and irre... | https://mathoverflow.net |
141,389 | [
"https://softwareengineering.stackexchange.com/questions/141389",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/49217/"
] | So, a RESTful service has a fixed set of verbs in its vocabulary. A RESTful web service takes these from the HTTP methods. There are some supposed advantages to defining a fixed vocabulary, but I don't really grasp the point. Maybe someone can explain it.
Why is a fixed vocabulary as outlined by REST better than dynam... | Consider a language where all constructs (such as functions) are objects. Then the RESTful verbs are simply calling conventions and assignment statements. For JavaScript you could define a fixed verb syntax like INVOKE for calling a function, DELETE (the same as delete in js) for deleting an object on another object, S... | The "verb" and "noun" terminology is somewhat unfortunate here. As you already mentioned, you can easily create object for function. All object oriented languages except Java have that transformation built-in and in Java you end up doing it all the time anyway ending up with lots of objects with single method and often... | https://softwareengineering.stackexchange.com |
259,138 | [
"https://mathoverflow.net/questions/259138",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | Does any one prepared a list of errata for Linear algebraic groups by Springer.
I could not find any in Google search.
First typo that i came across is in page 6, Regular functions and ringed spaces:
<blockquote>
If $U $ and $V$ are open subsets and $U\subset V$, restriction defines a $k$ - algebra homomorphism $\... | The answer to your specific question is that it's really stated backwards. More generally, your question about lists of errata comes up fairly often here and is hard to answer in detail. It's a legitimate question to ask when looking at relatively advanced books in mathematics. (Maybe a special tag is needed?) Bu... | Here is a different one, on page 299: Proposition 17.3.13(iii) giving the relative root system for quasi-simple groups of type <span class="math-container">$D_{n}$</span> is not correct as stated. I believe the following is correct, but please comment if not!
If <span class="math-container">$n > rd$</span>, then th... | https://mathoverflow.net |
136,049 | [
"https://physics.stackexchange.com/questions/136049",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/28241/"
] | <blockquote>
Suppose a spherical object is kept in water and nine tenths of the object are inside the water, while the remaining tenth floats. Find the weight of solid inside liquid.
</blockquote>
By Archimedes' principle, if an object is immersed in a fluid, it experiences an apparent loss of weight which is equal ... | The density of water is 1 g/ml. If the volume of the object is 100 ml and the object weighs 90 g, it is less dense than the water (0.9 g/ml) and hence only 90 ml of the object will be submerged (depending in the shape), leaving 10 ml of the object exposed above the water level.
| Let $W_a$ and $W_w$ be the weight of the object in air and water. <br/><br/>V be the volume of the object.<br/><br/> As mentioned 9/10 of the object is immersed in water. <br/> <br/>$\rho$ be the density of water, Principle of Archimedes states below expression $$ W_a-W_w = 9/10 * V* \rho. $$
| https://physics.stackexchange.com |
617,768 | [
"https://electronics.stackexchange.com/questions/617768",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/274143/"
] | In an NMOS we have a p-substrate, and we use a positive voltage to attract negative charge "to the top". But could we have used negative charge to attract holes instead and gotten a "hole-current"? I am confused by this because the p-substrate have more holes than negative minority carriers so why n... | In a N-channel MOSFET with Vgs = 0, there is a depletion region between the source and drain N+ regions and the P-type substrate that is a barrier to current flow. In normal operation with Vgs > 0, minority carriers are attracted to the oxide interface in sufficient quantities to create an inverted channel that act... | In an NMOS, the source and drain are N diffusions. When a channel (electrons) is formed, you can imagine a continuous conductive sheet is formed between S and D at the top surface of the channel.
If you bias the gate negatively, more holes <em>will</em> accumulate under the gate, but the electrons in the S can't enter ... | https://electronics.stackexchange.com |
279,515 | [
"https://physics.stackexchange.com/questions/279515",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/117789/"
] | I have read:
<blockquote>
<ol>
<li>Matter waves require a medium to for propagation. </li>
<li>Matter waves do not leave the moving particle, i.e. are not emitted. </li>
</ol>
</blockquote>
But when a particle is moving with some velocity in vacuum, what happens to the matter wave? Matter wave can neither ... | Perhaps the simplest answer would be to say that #1 is wrong. Where did you hear that matter waves required a medium to propagate? Since I agree that what you mean by "matter wave" sounds like a wavefunction, those don't require a medium. One might even say this was the biggest surprise in the history of physics-- ... | Your way of thinking about this issue is badly muddled. Quantum mechanics describes systems in terms of wave functions. A wave function is not a particle. Rather, you can measure various properties of the wave function like momentum or charge or whatever. The states that can be detected by such interactions are constra... | https://physics.stackexchange.com |
35,429 | [
"https://electronics.stackexchange.com/questions/35429",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/3757/"
] | In EMC there is an equation for charactristic impedance (If I am not wrong) that is defined as:
$$Z_w = \frac{E}{H}$$
As you know \$E\$ is expressed in Volts and \$H\$ as Ampers.
I had the exam today and for sake of confusion of students, the teacher brough this values in dB. But I actually needed this value in pure ... | <blockquote>
Is this the correct?
</blockquote>
No.
<blockquote>
If not, how to handle this?
</blockquote>
Simply convert the E and H values from dB to \$V/m\$ and \$A/m\$ respectively. Although the notation you've used isn't conventional, it's pretty clear what it means. The E field is 100 dB referenced to \$... | Decibels (dB) represent a dimensionless ratio. There is no way to express Ohms or any other non-dimensionless quantity in dB directly. You can express a <i>ratio</i> of any value in dB, since that is always dimensionless.
In some cases, specific numeric scales have been created based on dB with 0 dB defined as some ... | https://electronics.stackexchange.com |
427,693 | [
"https://mathoverflow.net/questions/427693",
"https://mathoverflow.net",
"https://mathoverflow.net/users/133882/"
] | This is a question that has bothered myself and Gottfried Helms a fair amount of late. He has made his case for the following result, but a proof escapes both of us. The question is deceptively simple, but keeps eluding each of my attempts when we get into the finer details.
Let's start by calling:
<span class="math-co... | The kind of completely regular space you are looking for is an <span class="math-container">$F$</span>-space.
Suppose that <span class="math-container">$X$</span> is a completely regular space. Then we say that a subset <span class="math-container">$A\subseteq X$</span> is <span class="math-container">$C^*$</span>-embe... | <blockquote>
What can be said about <span class="math-container">$X$</span>?
</blockquote>
One thing we can say that <span class="math-container">$X$</span> does not have any nonconstant sequences that converge. If <span class="math-container">$x_n \to x$</span> (all distinct), define <span class="math-container">$g(x_... | https://mathoverflow.net |
182,250 | [
"https://mathoverflow.net/questions/182250",
"https://mathoverflow.net",
"https://mathoverflow.net/users/58585/"
] | If G is an infinite planar group (it means that it has a generating subset C such that Cay (S, C) is a planar graph) and H is a normal subgroup of it, I would be very grateful if somebody helps me and tell me "is G/H a planar group?"
| This is Proposition 3.9 in Osborne's Basic Homological Algebra. I expect you could also find it somewhere in pretty much any homological algebra text, though it might be mentioned in passing rather than stated explicitly as a result.
<span class="math-container">${}{}{}{}{}{}$</span>
| I see no reason to cite it when the proof is so easy! The homology of the associated total complex can be computed using the spectral sequence of a double complex in two different ways: either you start by taking homology of rows or of columns. In both cases the sequence obviously collapses, and the homology of $E^\inf... | https://mathoverflow.net |
404,950 | [
"https://physics.stackexchange.com/questions/404950",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/167407/"
] | Suppose you have an electric field in three dimensions created by some finite (but possibly arbitrarily high) number of point charges, each with charge equal to an integer multiple (positive or negative) of $e$. Now you pick a point $O$ in a three dimensional space, and a ray $\vec{\ell}$ originating from $O$ in any di... | Surface tension means that it costs energy to increase the surface area of the liquid. The energy changes by $\Delta E = \sigma \Delta A$ for a small change $\Delta A$ in the surface area and $\sigma$ is the surface tension of the liquid.
This equation explains both why surface tension can let objects float and why su... | Sebastian Riese explained that surface area constitutes a form of potential energy, and thus increasing it requires a force, but I think that the causality of that is backwards. Potential energy doesn't cause force, force causes potential energy.
Also, I don't think that surface tension explains objects sticking to w... | https://physics.stackexchange.com |
64,370 | [
"https://mathoverflow.net/questions/64370",
"https://mathoverflow.net",
"https://mathoverflow.net/users/9672/"
] | What are the simplest examples of
rings that are not isomorphic to their
opposite rings? Is there a science to constructing them?
<hr>
<h2>The only simple example known to me:</h2>
In Jacobson's Basic Algebra (vol. 1), Section 2.8, there is an exercise that goes as follows:
Let $u=\begin{pmatrix} 0 & 1 & 0 ... | Here's a factory for making examples. If $\Gamma$ is a quiver, and $k$ a field, then we get a quiver algebra $k\Gamma$. If $\Gamma$ has no oriented cycles, we can recover $\Gamma$ from $k\Gamma$ by taking the Ext-construction. Also, the opposite algebra of a quiver algebra is obtained by reversing all the arrows in the... | Here is an easy example. Consider the abelian group $M = \mathbb{Z} \times \mathbb{Q}$. I claim that $R:=\text{End}(M)$ does not have any anti-endomorphism at all. <strong>EDIT</strong>: My previous proof is flawed. Thanks to Leon Lampret who pointed this out to me. The new proof shows that $R$ has several anti-endomor... | https://mathoverflow.net |
32,788 | [
"https://mathoverflow.net/questions/32788",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3969/"
] | Given a map of topological spaces $f:X\rightarrow Y$. Assume, that $X$ has finite Lebesgue dimension. I am wondering, what dim$(f(X))$ might be. Of course, if $f$ is a homeomorphism onto its image, then it's just dim$(X)$. On the other hand there are the space filling curves, that show, that the dimension might increas... | Some results from Engelking's dimension theory book:
If $f: X \mapsto Y$ is a closed, continuous and surjective function between normal spaces $X$ and $Y$, and $\forall y \in Y: | f^{-1}[{y}] | \le k$ for some integer $k \ge 1$, then $\dim(Y) \le \dim(X) + (k-1)$.
If $f: X \mapsto Y$ is an open, continuous and surje... | One result of this kind: if $X$ is zero-dimensional and $f$ is at most $n$ to one, then $\dim f(X) \le n-1$. This is if and only if... Given $Y$ of dimension $m$, there is a zero-dimensional $X$ and surjection $f \colon X \to Y$ that is at most $m+1$ to one.
| https://mathoverflow.net |
18,130 | [
"https://cs.stackexchange.com/questions/18130",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/4251/"
] | I need some help understanding the problem statement in CLRS 11.3-4 pg 269. It says:
<blockquote>
Consider a hash table of size $m = 1000$ and a corresponding hash function
$ h(k) =\left \lfloor m(kA \bmod 1) \right \rfloor $
for $A = (\sqrt5 - 1)/2$. Compute the locations to which the keys
61, 62, 63, 64, ... | Thanks to for clarifying mod 1 concept , for constant $\mathcal{A}$ I got the proper explanation in <strong>CLRS</strong> itself it says :
Although this method works with any value of the constant $\mathcal{A}$, it works better
with some values than with others. The optimal choice depends on the characteristics of the ... | That's not a misprint. $kA \bmod 1$ makes sense. For instance, $37.239 \bmod 1 = 0.239$.
| https://cs.stackexchange.com |
52,416 | [
"https://datascience.stackexchange.com/questions/52416",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/74680/"
] | I have a bunch of tuples like this; [SourceIP, DestinationIP, Port, TimeStamp]
If a destination IP recorded 21, 22, 23 and 80 port (set of 5 tuples) then I will decide something, if it has set of 4 tuples I will decide something if less than 4 I will decide another thing...
I have already handled it with SQL rules bu... | This is a common problem with rare events modelling, and your options are relatively limited (as far as I am aware, at least). It may well be the case that the features you're using are not very informative with respect to predicting these outcomes.
The major issue is that your predictors, in the context of this model... | As a complementary to Upper_Case's answer, you could just shuffle your labels randomly and do your training with these wrong labels again. If the results still don't change(it should get worse), it means that your input may actually not be very informative.
| https://datascience.stackexchange.com |
212,830 | [
"https://electronics.stackexchange.com/questions/212830",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/81191/"
] | We always told to keep off the electronic devices from water with no explicit reasons. Or remedies to fix the thing when accidents happened.
So, what is the physical reasons behind that submerged electronic or electrial devices get damaged?
For example speaker, motor(high-voltage). Smart phone, headphone(low voltage)... | Water can have several bad effects, not all of them directly related to electricity.
<ol>
<li>It can allow current to flow in directions it was never meant to flow. This can cause damage. Many devices have a wide range of different voltages in use and having higher voltages reach parts of the device that were never de... | Besides shorting out the components, as you mentioned, it can also be absorbed by some materials and as they try they warp and twist, potentially causing bad solder joints.
High voltage and water do not mix because it greatly increases the chances of the operator receiving a potentially lethal electric shock. The main... | https://electronics.stackexchange.com |
169,183 | [
"https://mathoverflow.net/questions/169183",
"https://mathoverflow.net",
"https://mathoverflow.net/users/24478/"
] | Using a small modification to Turáns theorem we can find the minimum amount of edges a graph $G$ on $n$ vertices must have so it does not have an independent set of size $k$. Is there a similar result if we add the restriction that $G$ is a connected graph?
| Just a partial answer, expanding Tony's:
The statement is true for $n=2k$ (i.e. you need exactly $(2k-1)$ edges to avoid an independent set of size $k+1$ in a connected graph), and the extremal graphs are exactly the trees with a perfect matching.
Proof: Clearly, you need $2k-1$ edges to make it connected. And $2k-1... | This is not an answer, but it became a bit too long for a comment.
If we let $\tau(n,k)$ be the number of edges in the complement of the Turan graph $T(n,k)$, then the minimum number of edges a connected graph with no independent set of size $k+1$ is probably $\tau(n,k)+k-1$. Note that it is at least $\tau(n,k)+1$ ... | https://mathoverflow.net |
16,546 | [
"https://cs.stackexchange.com/questions/16546",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/10988/"
] | I need to detect whether a binary pattern P of length m occurs in a binary text T of length n where m
I want to state an algorithm that runs in time O(n) where we assume that arithmetic operations on O(log2n) bit numbers can be executed in constant time. The algorithm should accept with probability 1 whenever P is a s... | The average complexity of the search from the back to the front is equal to
$$
\sum_{i=1}^n \frac{2i}{n(n+1)}(n-i+1) = \frac{2}{n(n+1)}\sum_{i=1}^n i(n-i+1) = \frac{2}{n(n+1)} \frac{1}{6}n (n+1) (n+2) = \frac{1}{3}(n+2)
$$
which is indeed linear.
| Well, a common-sense heuristic would be to check the next most likely place first. This would suggest checking the array from the back to the front is optimal, since the target is more likely to be in higher positions.
The best and worst cases are the same as for vanilla linear search: in the best case, it's always th... | https://cs.stackexchange.com |
142,584 | [
"https://softwareengineering.stackexchange.com/questions/142584",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/47365/"
] | I develop some scripts for data analysis in a small team. For the moment we use SVN, but not in a very structured way. We haven't even looked how to use branches even though we need this functionality.
What do you suggest as the best practice to setup the following system:
<ul>
<li>two code bases (core and plugins)</... | <strong>Disclaimer</strong>
This answer <strong>is not intended</strong> to be comprehensive and detailed illustrated textbook from series "... for Dummies", <strong>may contain</strong> the wrong conclusions from faulty assumptions and <strong>involves</strong> the reader's own ability to read and understand the docu... | Well, I'm no SVN ninja or anything, but for the two projects, you'd simply have two folders at the top level. Each of those would have some folders:
<ul>
<li>Release, which would have tags or copies of the project that you decided to give a version number to. And you should really start giving them version numbers. </... | https://softwareengineering.stackexchange.com |
19,843 | [
"https://robotics.stackexchange.com/questions/19843",
"https://robotics.stackexchange.com",
"https://robotics.stackexchange.com/users/15321/"
] | Is it wise / possible to use multithreading to handle control system on robot?
For example, a line follower robot with PID control flowchart would be:
<em>read_sensor()</em> -> <em>calculate_control()</em> -> <em>set_actuator_value()</em>
The control system will be much like this :
<pre><code>void calculate_control... | Multithreading doesn't help a simple robot much. For example, if you have just a couple of sensors for line following, multithreading isn't necessary.
However, as the robot becomes more complex both electronically and in programming, multithreading makes sencpse.
Add more sensors to your line-follower, perhaps a lida... | For a simple PID control you don't need parallel threads, as a control rate of 50 to 100 Hz should be enough.
| https://robotics.stackexchange.com |
238,359 | [
"https://security.stackexchange.com/questions/238359",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/242974/"
] | Hello I am looking for some compromise with integrating E2E encryption for web app (basic FE and BE).
Basically I read about two concepts which are trully E2E encryption and not that much complicated.
<ol>
<li>Using two passwords, when one is for login and second is for encryption only used only locally on client devic... | Having the authentication password by the same as the encryption password <em>by default</em> but allowing the user to set a different encryption password might be the best of both worlds. The data is always going to be lost if the user forgets their encryption password (you can have them download and maybe print out a... | It's not clear what you are really asking.
<ul>
<li>From an usability point of view, requiring a single password is preferable.</li>
</ul>
More than "too much hassle" I would describe it as "users being confused". I wouldn't consider users using the same password for both fields as a failure in the ... | https://security.stackexchange.com |
97,979 | [
"https://electronics.stackexchange.com/questions/97979",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/7523/"
] | For most purposes I've personally encountered, RMS current and voltage have been useful only for computing heat losses in a resistor. Do RMS current or voltage have other applications besides computing heat loss?
| By adding a battery in parallel, you <em>do not</em> increase the current. You increase the maximum current that the motor can take. Nothing will happen if you add another battery in parallel and the motor isn't suffering from shortage of current.
Keep in mind that than in Ohm's law, you have 3 variables: \$V=RI\$. I... | <blockquote>
Increasing voltage increases the RPM of the motor, but what does increasing current do?
</blockquote>
Increasing Voltage, Increases the Current Pulled, which Increases the Strength of the coil, which increases the RPM AND Torque of the motor. They are all connected.
<blockquote>
I currently have two ... | https://electronics.stackexchange.com |
386,370 | [
"https://softwareengineering.stackexchange.com/questions/386370",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/321010/"
] | Developing Big Data processing pipelines and storage, you probably come across software which is more or less a part of the Hadoop ecosystem. Be it Hadoop itself, Spark/Flink, HBase, Kafka, Accumulo, etc.
Now all of these have been very well implemented, offering fast and high-quality solutions to the developers needs... | Hadoop was originally written in Java, because it was used to "fix" problems in Nutch, which also was written in Java. Nutch, in turn, was written in Java because it was a write once run anywhere solution.
As for whether C++ or another language would have been a better choice, that's definitely up for debate. With... | The comment that "performance" is an important factor is odd, because "performance" is not a single monolithic thing.
The two most obvious different types of "performance" constraint are:
<ol>
<li><em>Throughput</em> (long-running servers, jobs that take a long time to complete, etc.)
GC i... | https://softwareengineering.stackexchange.com |
813,785 | [
"https://math.stackexchange.com/questions/813785",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/148057/"
] | There is a theorem in the course notes but the lecturer didn't given the proof:
If $A,B\in M_n(K)$, where $K$ is a field. Then $A\sim B$ if and only if they represent the same linear transformation $T$ of an $n$-dimensional vector space $V$ over $K$ with respect to bases $\mathcal{B}$ and $\mathcal{C}$. i.e.,
$$
A\s... | $A\sim B$ means that there exists an invertible matrix $P$ such that $B=P^{-1}AP$. An invertible matrix $P$ can be considered as the change of basis matrix $P=[I]^E_C$ from the standard basis $E$ of $K^n$ to the basis $C$ of consisting of the columns of the matrix $P$. Thus if you define the linear transformation
$$T:K... | If $A \sim B$ then there exists an invertible matrix $P$ for which $B=P^{-1}AP$. Pick a basis $\beta = \{ v_1, \dots, v_n \}$ for $V$ over $\mathbb{K}$ and let $\Phi_{\beta}: V \rightarrow \mathbb{K}^n$ form the coordinate map defined by linearly extending $\Phi_{\beta}(v_i)=e_i$ where $(e_i)_j = \delta_{ij}$ for all $... | https://math.stackexchange.com |
568,315 | [
"https://physics.stackexchange.com/questions/568315",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/236734/"
] | Suppose there is a rope which is initially untaut, two people go and hold both ends of the rope and start running in opposite directions at constant velocity. Let person holding one end be '<span class="math-container">$A$</span>' and the person holding other be '<span class="math-container">$B$</span>', now when the ... | They simply <strong>cannot</strong> move at constant velocity relative to one another once the rope becomes taut, because past that point the rope would have <strong>tension</strong> that exerts a <strong>force</strong> on each runner, causing each of them to (rapidly) <strong>decelerate</strong>, and probably fall dow... | the force here is due to momentum change
| https://physics.stackexchange.com |
109,646 | [
"https://physics.stackexchange.com/questions/109646",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/25077/"
] | This is a question that has been troubling me from many days:
Suppose we pass a linearly polarized light through a system of 3 successive polarizers.
The 1st polarizer is offset 30$^{\circ}$ from the plane of polarization. The second is offset 30$^{\circ}$ from the first. The third is offset 30 $^{\circ}$ from the sec... | I think the simplest way to understand this is that any vector can be described as the sum of two basis vectors. The vector from, say (0,0) to (1,1) is the vector sum of (0,0) to (1,0) and (0,0) to (0,1) . So, take your original polarized light and run it thru a 45-degree polarizer. You've just tossed half the ampl... | I also found this surprising when first introduced.
The light has no memory. When it passes through the second polariser, there is no information whatsoever of its previous polarisation. It could have been whatever!
When light goes through a polariser at $30º$, it gets tilted at the cost of some lost intensity. In ot... | https://physics.stackexchange.com |
341,480 | [
"https://softwareengineering.stackexchange.com/questions/341480",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/261415/"
] | Suppose the following situation:
<ol>
<li>A CI server generated regular snapshot artifacts</li>
<li>At some point, an artifact is considered "stable" and is given to QA for testing
<ol>
<li>If it passes, it's deployed as an official release</li>
<li>If it doesn't pass, a newer snapshot gets tested until one passes</l... | Cryptographically sign a release, but not a release candidate/snapshot.
The code could check if its own package has a valid signature, if the signature on the package is missing or invalid, then show the rc number, otherwise if the signature is valid the rc number is not shown.
| This is the 'standard' workflow in my experience.
<ul>
<li>feature branch new features</li>
<li>when 'dev complete' merge to develop</li>
<li>ci builds on develop and assigns incremental version number (no -RC)</li>
<li>build auto deployed to qa (artifact goes to octopus)</li>
<li>testers test</li>
<li>fixes merged in... | https://softwareengineering.stackexchange.com |
76,376 | [
"https://electronics.stackexchange.com/questions/76376",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2028/"
] | A "strong" pull (up/down) resistor would be one of a relatively low value, while a "weak" one would be of a relatively high value.
For example, a pull-down resistor would be used to keep an I/O pin low, but a button connected from that pin to V<sub>CC</sub> would bring it high when pressed, because more current flows ... | <em>Strong</em> means <em>low resistance</em>. <em>Weak</em> means <em>high resistance</em>. Of course <em>low</em> and <em>high</em> are relative terms, and so are <em>strong</em> and <em>weak</em>. The reference for this relationship must be inferred from context.
A <em>strong</em> or <em>low resistance</em> pull-up... | A "weak" pull resistor is usually a high value resistor that only allows a small amount of current through, and can quickly be overwritten, but takes longer to reassert itself.
A "strong" pull resistor is usually a low value resistor, allows more current through, takes longer to be overwritten, but can quickly reasser... | https://electronics.stackexchange.com |
64,206 | [
"https://physics.stackexchange.com/questions/64206",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/24234/"
] | From what I understand the Dirac equation is supposed to be an improvement on the Schrödinger equation in that it is consistent with relativity theory. Yet all methods I have encountered for doing actual ab initio quantum mechanical calculations uses the Schrödinger equation. If relativistic effects are important one a... | Think it with an example, Einstein's field equations are much more precise than Newton's law of gravity, but it's much more complicated to solve a Classical Mechanics problem with General Relativity.
More fundamental and precise doesn't mean that it will give easier calculations. If it did, then then chemistry, medici... | <h2>If the Dirac equation is a more correct description of reality, shouldn't it give rise to easier calculations?</h2>
It is true that the Dirac equation takes into account theory of relativity, so in this respect it is more correct than the Schroedinger equation.
However, the problem with the Dirac equation is that... | https://physics.stackexchange.com |
412,003 | [
"https://math.stackexchange.com/questions/412003",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/81072/"
] | This is probably quite a simple question but here I go..<br />
Suppose you are going to roll a six-sided (fair) die N times, what is the probability that you will get at least one set of three consecutive numbers in a row?<br />
Hopefully that's clear enough but as an example, in nine rolls you may get:<br />
1, 4, 2, ... | Let $T$ denote the first time when this happens and, for every $|s|\leqslant1$ and $k$ in $\{0,1,2\}$, $u_k(s)=E_k[s^T]$ where $k$ is the number of identical results just produced. One is asking for $P_0[T\leqslant N]$. A one-step Markov conditioning yields the usual linear system $u_0=su_1$, $u_1=s\left(\frac16u_2+\fr... | The number of <span class="math-container">$N$</span>-tuples over <span class="math-container">$\{1,2,3,4,5,6\}$</span> with no runs of 3 or more consecutive values the same is <span class="math-container">$$6\sum_{j} 5^{N-j-1}{N-j\choose j}.\tag1$$</span>
The probability of no such "triple" runs is <span class="math-... | https://math.stackexchange.com |
103,690 | [
"https://electronics.stackexchange.com/questions/103690",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/39029/"
] | We're using the PIC32MX795F512L on a number of custom boards. I'm responsible for one design, for which we currently have two prototypes. The first board appears to work perfectly.
On the second, the PIC is mostly unresponsive. Pressing the Reset button doesn't help. Occasionally it will report a Device ID to the PIC... | So it turns out the problem was our power supply scheme - we had the analog pins on a separate plane, but there's some issue we haven't completely identified with our regulators, wherein some boards don't work this way (it turns out mine wasn't the only one with this problem). Running all Vdd/AVdd pins from the same re... | I agree with Erik that there could be an issue with the hand assembly of the second board. If the first and second boards are exactly the same design, but one works and the other does not, then it's a component or assembly or freak damage/accident issue.
I have had a recent experience with hand loading 20 small bat t... | https://electronics.stackexchange.com |
15,934 | [
"https://stats.stackexchange.com/questions/15934",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/4559/"
] | There are 13 subjects in this study, each subject was "repeatedly measured" right and left legs on five walking conditions. The variables of this data set is: ID, Y, Leg, Conditions.
The research questions are to find the difference between legs and conditions.
At beginning, I plan to use RM-ANOVA: $Y = \text{Leg} + ... | It seems to me that if Y doesn't actually already exist you probably want to just make it from scratch like this.
<pre><code>Y <- X[sample(1:nrow(X), size = 10000, replace = TRUE, prob = X$PROB),]
Y <- Y[,-3]
</code></pre>
BTW, you can test to see that you got what you want with...
<pre><code>table(factor(Y$A)... | Use <code>ddply</code> (from <code>plyr</code> package) first to create the conditional probabilities:
<pre><code>Xcond<-ddply(X, .(A),
.fun=function(curdfr){
curdfr$CPROB<-curdfr$PROB/sum(curdfr$PROB);curdfr})
</code></pre>
Now, given Y with column A, you can get the result you wa... | https://stats.stackexchange.com |
65,918 | [
"https://security.stackexchange.com/questions/65918",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/53125/"
] | Is there any way in which you can stop a DDoS attack(or any measure that you can take), if the packets sent by the attacker look like normal traffic?
I got the question on an interview (how would you block a DDoS attack if the malicious traffic looks like the normal traffic?) and I didn't knew how to answer.
Thank yo... | In most cases, it is very hard to mitigate DDoS attacks on your own. Most banks and large companies will engage the service of professional DDoS mitigation service providers. The latter will detect anomaly traffic patterns and reroute all traffic to their scrubbing centers for filtering out the bad traffic. The followi... | Use of a scrubbing provider can potentially help, depending on the type of "normal" traffic and how much control you have over it. In the best case, that traffic would be human-initiated http or https traffic, and scrubbing could consist of using JavaScript based tests and CAPTCHA spash screens to whitelist the legitim... | https://security.stackexchange.com |
246,277 | [
"https://physics.stackexchange.com/questions/246277",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/112794/"
] | I am carrying out a research work and I am stuck at the first page where there is an introduction to the angular momentum and its relationship in the formation of the solar system.
According to that paper, stars are formed by the accretion of interstellar cloud (or nebulla) into a young star and that when central part... | You must remember that $\textbf{r}$ is an operator and to compute $\nabla\cdot\hat r$ you must act it on a function of coordinates. Here is how I derived it.\begin{equation}
\textbf{L}^2=(\textbf{r}\times\textbf{p})\cdot(\textbf{r}\times\textbf{p})
\end{equation} Using the formula $\textbf{A}\cdot(\textbf{B}\times\text... | I worked on your line of reasoning and was able to obtain the answer. I use $\hat{r}$ to mean an operator (not unit vector), which to compute, you have to act on a function (from right to left as operators always do), as SRS have said.
After applying the quadruple product for vectors, you obtained:
$$
\hat{L}^2 f = -... | https://physics.stackexchange.com |
118,501 | [
"https://physics.stackexchange.com/questions/118501",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/12513/"
] | Currently in my academics I am studying about the Gravitation. In the chapter I came across a term called the <strong>Escape Velocity</strong> (<em>It's the velocity of any celestial body which is required by an object to escape from body's gravitational field without any further propulsion</em>). When I was going thro... | The radius of a non-rotating black hole is $$r_s = \frac{2GM}{c^2} \tag{1}$$
where $M$ is the mass, $G$ is Newton's constant, and $c$ is the speed of light. This is the distance from the center of the black hole to the event horizon. The event horizon is the surface that traps light and objects, it separates inside and... | It's not just the mass that matters or just the radius. It's $r/m$. If $r/m$ is less than $2G/c^2$, then you have a black hole.
Black holes can theoretically have big masses or small masses. It's theoretically possible to have a black hole with a mass of 1 kg -- we just don't know of any processes in nature that would... | https://physics.stackexchange.com |
112,836 | [
"https://electronics.stackexchange.com/questions/112836",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/28778/"
] | Currently we are developing enclosures in an isolated "system of systems". Our overall system is fed AC power and converted to 28V with an off-the-shelf converter. Currently the enclosures we are designing each have a PCB internally and currently these PCB's power supplies are tied to the same ground (dashed red lines ... | Since you are showing analog and signal grounds being connected between the two boxes, connecting the power grounds together is not a great idea. You are inviting ground loops.
That said, if your boxes are at all separated physically, and your interconnecting signals are low voltage/ high impedance (10 volts, a few k... | Set your system up so that you can easily swap between several different connection schemes. (like with disconnectable grounding straps, resistors you can easily clip or solder on, etc) Try them all out at home and see how well each one works.
When you go to test EMC, have your wits about you and test the most preferr... | https://electronics.stackexchange.com |
398,846 | [
"https://stats.stackexchange.com/questions/398846",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/242059/"
] | I fitted a <code>gam</code> model in <code>mgcv</code> package and now want to get the confidence intervals for the non-smooth term.
<pre><code>require(datasets)
require(mgcv)
b = gam(Temp ~ s(Ozone) + Solar.R, data=airquality, family=gaussian)
</code></pre>
So, when I wanted to print the confidence intervals, I ran:... | You need the standard error of the term, which is given in the output from <code>summary()</code>, but you can grab the standard errors from the diagonals of the variance-covariance matrix, which is extracted using <code>vcov()</code>.
Fit your example model:
<pre><code>require(datasets)
require(mgcv)
b <- gam(Tem... | Gavin's useful answer can be generalized by the following in the situation where you may have more than one coefficient of interest. Let's say these coefficients are called c1, c2, c3, c4 for example.
Replace
i <- which(names(beta) == "Solar.R")
with
i <- which(names(beta) %in% c("c1", "c... | https://stats.stackexchange.com |
450,309 | [
"https://physics.stackexchange.com/questions/450309",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/206548/"
] | What will be the work done in radially stretching a rubberband it can't be zero as there is potential energy being stored in it
All I came up with it that there would be increase in overall length so assuming that initial length before expansion was <span class="math-container">$$2πR$$</span>
And after its expansion i... | Usually, the term <strong>impulse</strong> means the <em>difference in momentum</em>:
<span class="math-container">$$\vec J=\Delta \vec p$$</span>
Force is the time derivative of momentum:
<span class="math-container">$$\vec F=\frac{d\vec p}{dt} \Leftrightarrow d\vec p=\vec F \;dt$$</span>
In a scenario where you c... | You have written wrong formula for impulse.it is not just time there instead it is change in time(delta t).
So, now if you look over the final formula that is F=J/delta t(not just t) it is same as F=dp/dt as, J =dp.
So you got nothing new like you observed in your question .
You got same equation.impulse is just a fan... | https://physics.stackexchange.com |
176,210 | [
"https://dba.stackexchange.com/questions/176210",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/56152/"
] | I have a SQL Server 2014 DB where the log file filled up the disk. Since it was a test db, we decided to just delete the whole database. We took it offline, but when we try to drop it, we get a message that it cannot be dropped since it is in use.
How can it be in use when it is offline?
How can I get it dropped? (Pr... | The problem was that the person who set the database to OFFLINE also set it to SINGLE_USER, and his session was still open and "using" the database, even if it was OFFLINE. When he closed that session we were able to drop the database.
Thx to everyone in the comments for helping.
| The problem you saw was actually because another spid held a "SHARED_TRANSACTION_WORKSPACE" lock on the dbcat (database catalog). In your case, you could have seen that lock by running this <code>SELECT DB_NAME(resource_database_id) AS DbcatName, * FROM sys.dm_tran_locks;</code> or this <code>EXEC sp_lock NUL... | https://dba.stackexchange.com |
439,205 | [
"https://physics.stackexchange.com/questions/439205",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/28120/"
] | We know that the Minkowski vacuum corresponds to the thermal state in a Rindler wedge at Unruh temp. But does the thermal state in one Rindler wedge at Unruh temperature uniquely map to the Minkowski vacuum? Or could there be other states
in the Minkowski space field theory which also corresponds to thermal state in ... | OON's idea can be made more precise to obtain an example of state which is identical to Minkowski vacuum in the left Rindler wedge but is different in the right wedge.
It is just matter of a correct choice of the local operator in OON's idea. The idea works only with certain local operators: <em>isometries</em> loc... | Of course there are infinite number of states with reduced density for the left wedge being in thermal state while the total state is not the Minkowski vacuum. To obtain the latter the reduced density matrix in the right state should alsobbe in the thermal state AND there also should be a specific entanglement between ... | https://physics.stackexchange.com |
182,631 | [
"https://mathoverflow.net/questions/182631",
"https://mathoverflow.net",
"https://mathoverflow.net/users/59115/"
] | Let $A$ be a von Neumann algebra and $A_*$ its predual. One can define a topology on the set $vN(A)$of all von Neumann subalgebras of $A$ called the Effros-Marechal topology. It is characterized as the coarsest topology on $vN(A)$ such that for all $\varphi \in A_*$ the map
$ B \mapsto ||\varphi_{|B}|| $
is continous.
... | Choose a bijection $\alpha:\mathbb{N}\to\mathbb{Q}$, and for each $x\in\mathbb{R}$ let
$$a(x)_i=\begin{cases}0&\mbox{ if $\alpha(i)<x$}\\1&\mbox{ if $\alpha(i)\geq x$}\end{cases}.$$
Then the set of sequences $\{a(x):x\in\mathbb{R}\}$ is linearly independent.
| Take a family $A_\alpha$ of continuum non finite ``almost disjoint'' subsets of $\textbf{N}$. That is the sets $A_\alpha\cap A_\beta$ are finite
for any $\alpha\ne \beta$, and each $A_\alpha$ is infinite.
Then the characteristic functions $x(\alpha)$ of the set $A_\alpha$ is a
sequence of $0$ and $1$, so rational... | https://mathoverflow.net |
41,067 | [
"https://dba.stackexchange.com/questions/41067",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/23098/"
] | Consider this select statement:
<pre><code>SELECT *,
1 AS query_id
FROM players
WHERE username='foobar';
</code></pre>
It returns the column <code>query_id</code> with value <code>1</code> along with a player's other columns.
How would one make the above SQL return at least the <code>query_id</code> of <co... | <pre><code>SELECT col1,
col2,
col3,
1 AS query_id
FROM players
WHERE username='foobar'
union all
select null,
null,
null,
1
where not exists (select 1 from players where username = 'foobar');
</code></pre>
Or as an alternative (<em>might</em> be faster as no second subse... | If you are only expecting one or zero rows back, then this would also work:
<pre><code>SELECT
max(col1) col1,
max(col2) col2,
1 AS query_id
FROM
players
WHERE
username='foobar';
</code></pre>
This will return one row with all values having null except query_id if no row is found.
| https://dba.stackexchange.com |
1,260,843 | [
"https://math.stackexchange.com/questions/1260843",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/26559/"
] | <blockquote>
Show that
$$\sum_{n \neq 0} \frac{(-1)^{n+1}}{in} e^{in\theta} = 2 \sum_{n=1}^\infty (-1)^{n+1} \frac{\sin n\theta}{n}.$$
</blockquote>
This is not an exercise. It is an example from Stein, Fourier Analysis - An Introduction, pg. 36. I'm rusty on my complex algebra and I'm having trouble understandin... | The key here is that $e^{in\theta} = \cos(n\theta) + i\sin(n\theta)$ implies that
$$
e^{in\theta} - e^{-in\theta} = 2i\sin(n\theta).
$$
Thus the sum on the left hand side is, after rearranging terms (grouping those indexed by $\pm n$) and simplifying,
$$
\sum_{n > 0} \frac{(-1)^{n+1}}{in}(e^{in\theta}-e^{-in... | Use $\sin n\theta = \dfrac{e^{in\theta} - e^{-in\theta}}{2i}$ and observe the sum on the left can be written as
$$ \sum_{n=1}^\infty \left[ \frac{(-1)^{n+1}}{in} e^{in\theta} + \frac{(-1)^{-n+1}}{i(-n)} e^{i(-n)\theta} \right].$$
| https://math.stackexchange.com |
105,779 | [
"https://softwareengineering.stackexchange.com/questions/105779",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/18515/"
] | I have read about linear programming and its content and I wonder if this way of programming is common to use in the market? I often hear about object oriented programming but not linear programming.
I would like to hear a discussion about it.
| Linear programming is not a style of computer programming. It is a subclass of mathematical programming, which in turn is a subclass of mathematical optimization. A mathematical program is an optimization problem where the function to be optimized is subject to constraints. In linear programming, the function to be opt... | What David Hammen said. Your question doesn't make a lot of sense. E.g. would you program Shortest Path Programming or Dynamic Programming as opposed to Object Oriented programming? No these are just techniques for constructing algorithms. Similarly Linear Programming is just another technique for constructing algo... | https://softwareengineering.stackexchange.com |
121,794 | [
"https://dba.stackexchange.com/questions/121794",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/79682/"
] | I have a few questions, hoping I can get answers.
<ol>
<li>what does it mean when the Mongodb said:
<blockquote>
Clients can read documents while write operations are in progress
</blockquote>
I can see partially updated document? or the document will be under lock and no one can see it until the lock yielded?</l... | it is absolutely correct error, You are select single column in main select, so it must return only one column for avoid collisions
for each column make a new sub-select:
<pre><code> (SELECT username
FROM users
WHERE id = topicanswers.userid) as username
... | Another way to rewrite the query, without having 2 correlated inline subqueries is to have instead one <code>LEFT JOIN</code> in the <code>FROM</code> clause. The problem is that MySQL does not have <code>LATERAL</code> joins so it looks a bit clumsy and is quite confusing to get it right:
<pre><code>SELECT *,
... | https://dba.stackexchange.com |
548,127 | [
"https://math.stackexchange.com/questions/548127",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/104662/"
] | I would like to show that:
$$ \frac{1}{|\vec r -\vec r'|} =\frac{1}{r} + \frac{\vec r'\cdot r'}{r^3}+\frac{3 ((\vec r \cdot \vec r)^2 -\vec r^2 \vec r'^2 )}{2r^5} +\dots$$
What I derived so far is:
$$\frac{1}{|\vec r -\vec r'|}= \sum_{n=0}^{\infty} \frac{1}{n!} (-\vec r' \cdot \nabla_r )^n \frac{1}{r} $$
The last par... | The notation $(-\vec r'\cdot \nabla_r)$ means "first take the gradient with respect to $r$, then do the dot product with $-\vec r'$. For example
$$ (-\vec r'\cdot \nabla_r)^2 f(r) = -\vec r' \cdot \left[ \nabla_r(-\vec r'\cdot \nabla_r f(r)) \right].$$
So let's have a look at the first few summands. Starting with $n=0... | $\vec r' \cdot \nabla_{\vec r}$ is just a directional derivative. A good set of identities for using directional derivatives can be helpful. In particular, for any vectors $\vec a, \vec b$,
$$\begin{align*}\vec a \cdot \nabla_{\vec r} r &= \vec a \cdot \hat r \\ \vec a \cdot \nabla_{\vec r}\vec r &= \vec a \e... | https://math.stackexchange.com |
134,403 | [
"https://softwareengineering.stackexchange.com/questions/134403",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/36662/"
] | What is the best choice LINQ TO SQL (.DBML) or using ADO.NET with procedures for a database with 29 tables and about 30 concurrent users that will run the system that I am going to build?
I know that ADO.NET is faster than LINQ TO SQL but it is so much simpler to work with LINQ TO SQL. Will LINQ TO SQL handle all the ... | The risk/reward of customizing systems is to provide a competitive advantage which allows your company to offer something differently than the other businesses in your space.
The larger organizations that I have worked with derive a competitive advantage from customization and in that mind set, they make them do thi... | Communicating to office dwellers? I'd go with analogies.
Tell them that all these changes are turning your typical 4-door domestic sedan into an exotic foreign car. Every time you bring it into the mechanic shop, from the tune-up, to the crushed light, to the transmission overhaul, it's going to be more expensive. "We... | https://softwareengineering.stackexchange.com |
42,917 | [
"https://cs.stackexchange.com/questions/42917",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/33882/"
] | Consider a simple random walk on an undirected graph and let $H_{ij}$ be the hitting time from $i$ to $j$. How much bigger can
$$ H_{\rm max} = \max_{i,j} H_{ij}, $$ be compared to
$$ H_{\rm ave} = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n H_{ij}.$$ For all the examples I can think of, these two quantities are of rough... | The quantity $\phi(n)$ grows like $\Theta(n)$.
For the lower bound, consider the following graph: a clique on $m$ vertices connected to a path of length $k = C\log m$ for an appropriate $C$ (so $n = m + k \approx m$), in which each vertex of the path is also connected to the first vertex of the path (the one incident ... | This is an addendum to the answer by Yuval Filmus. Indeed <span class="math-container">$\phi(n)=\Theta(n)$</span>, and the upper bound is explained in that answer. I don't understand the argument for the lower bound given there, but a simpler graph will yield the required bound. Let <span class="math-container">$G$</sp... | https://cs.stackexchange.com |
32,088 | [
"https://physics.stackexchange.com/questions/32088",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/540/"
] | I have a question related to the interference (thought)experiment with water waves given in the book Feynman Lectures on Physics Vol.3. When only one hole (hole 1) is open the measured wave intensity at the second wall varies with the distance from the center. It is shown in the figure as $I_1$ which has a peak right a... | You have a 2D point source, so the energy of the wave is spread out along a circle of circumference $2\pi r$ where r is the distance from the point source. This means the intensity of the wave varies as 1/r. It's a 2D version of the inverse square law.
Obviously the amplitude can't be constant everywhere on the second... | It's not in fact a damping factor but rather a geometrical effect due to the fact that the waves are two-dimensional. The form $e^{i(kx-\omega t)}$ you quote for the amplitude is wrong - it only applies for plane waves. In this 2D experiment, travelling waves are described by Bessel functions, for which a good asymptot... | https://physics.stackexchange.com |
298,775 | [
"https://mathoverflow.net/questions/298775",
"https://mathoverflow.net",
"https://mathoverflow.net/users/84390/"
] | Let $X$ be a separable Banach space. Is the strong operator topology metrizable on $B(X)$, the space of all bounded operators on $X$?
SOT-$\lim T_i=0~$ if and only if $~\lim \|T_ix\|=0$ for every $x\in X$.
| A quick proof using the open mapping theorem: It follows easily from the uniform boundedness principle that $(B(X),SOT)$ is sequentially complete. If it were metrizable it would thus be a Fréchet space and the open mapping theorem implies that the continuous identity $(B(X),\|\cdot\|_{op})\to (B(X),SOT)$ would be open,... | <strong>No</strong>, it is not sequential (hence non-metrisable) unless $X$ is finite-dimensional. Otherwise, let $(z_n)_{n=1}^\infty$ be a linearly independent sequence that is dense in $X$. For each $k$ we may consider the subspace $Z_k$ of $B(X)$ comprising operators mapping ${\rm span}\{z_1, \ldots, z_k\}$ to itsel... | https://mathoverflow.net |
115,620 | [
"https://softwareengineering.stackexchange.com/questions/115620",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/886/"
] | I work in a bunch of tools that do things to customer's computers. Some of these tools allow scripting, which allows someone to run a script to nuke files, registry keys, or the like. Of course, if the script is bad, or if there's a serious bug in the tool, it could cause damage to the person's system. I'm concerned th... | I'm guessing you need the infamous "Disclaimer" message saying blah-blah-blah with the Accept \ Not Accept buttons.
If they do not accept, you do not install or run your software.
Does that prevent lawsuits? No. But it's ammunition for your defense lawyer should it come to that.
Of course, IF your software is the ... | It's a function of location.
If you are in the USA there is a 100% chance you will be sued by somebody, it's just part of doing business. It doesn't mean they will be successful or even have a chance - but just like Typhoons in SE Asia, snow in Scandinavia or rain in Seattle, it comes with the territory.
| https://softwareengineering.stackexchange.com |
186,727 | [
"https://softwareengineering.stackexchange.com/questions/186727",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/3382/"
] | I recently started at a new company, with a handful of programmers. Its a medium sized company, with around 70 employees, but IT only has 9-10, and there are 3 "programmers" beside myself. However, these guys have very limited experience and are doing a lot of stuff really terribly. For example, one of our projects is ... | I've found that the primary cause for sloppy work, outside of the programmer simply not caring, is a lack of knowledge. Unfortunately in a lot of environments, lack of knowledge is looked down on rather than openly discussed.
Some techniques that I've used with success to foster discussion, growth, and general excite... | Upon seeing that you were hired as the Sr. PHP dev and your job is to fix things, I suggest it's time you flex some muscle.
If I was in your place, I'd do a good survey of the code and see mistakes that are happening over and over again. Block off meeting time each week to go over these things with the team. Don't po... | https://softwareengineering.stackexchange.com |
5,601 | [
"https://engineering.stackexchange.com/questions/5601",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/2164/"
] | I am printing a wheel with a 2.5mm hole in the middle to accept a shaft of a motor with a set screw. The problem I am having is that the wheel is always wobbly when spinning (sometimes more, sometimes less without changing any parameters). Is there anything I can do to make this print as perfect as possible and prevent... | 3D printing bores/holes is inherently and wildly inaccurate. You can continuously tweak the model, material, and print configurations to get better results, but for best results, in my experience, redraw the hole to a slightly smaller size than your target and reprint. Then, after printing, use a drill to get the size ... | Also, the plastics used in most hobbyist printers are really not well suited to carrying any load and are usually too soft and flexible to machine properly.
However if you can find a piece of tube, either metal or rigid plastic, to fit the axle accurately, design the wheel bore so that the tube can be pressed in. It... | https://engineering.stackexchange.com |
716,247 | [
"https://physics.stackexchange.com/questions/716247",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/318676/"
] | When converting rpm of, say a helicopter blade, to m/s, the equation used is:<span class="math-container">$$v_{m/s} = \frac{2\pi{r}}{60}\times N_{rpm} $$</span> In the equation, we have radius as a variable, as the speed changes with change in radius. Assume that the rpm of the <strong>motor</strong> that the blade is ... | This is an example of 2+2=5.
First of all, not all reversible processes are isothermal. You have reversible isobaric, isochoric and adiabatic processes.
For a reversible adiabatic process, the temperature of the surroundings is irrelevant.
For a reversible isobaric and isochoric process, the temperature of the system a... | Maybe you are confusing the general processes involving a thermodynamic system and the particular case of a system in contact with a thermal reservoir at fixed temperature (for example, the typical system described in Statistical Mechanics via the canonical ensemble). You do not have to confuse the two things.
In gener... | https://physics.stackexchange.com |
23,367 | [
"https://mechanics.stackexchange.com/questions/23367",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/7882/"
] | I have been working on a 1999 Buick Century Custom that had rusted brake lines. I get strange pedal feel that I will attempt to describe:
<ul>
<li>From 0% to about 15% depression, there is resistance and most braking
force is generated</li>
<li>From about 15% to about 70% depression, there is less resistance and
no br... | It turned out the drum adjusters were set wrong and seized. As near as I can reason, what I was feeling at first was the fluid back-pressure needed to overcome the portioning valves (and some braking force from the discs). Then the "dead zone" was fighting the drum's wheel cylinder return spring after the portioning va... | Master cylinder is going out of business. Make sure to replace it and bench bleed it before re-installing.
| https://mechanics.stackexchange.com |
136,690 | [
"https://softwareengineering.stackexchange.com/questions/136690",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/31673/"
] | I find myself aiding novice programmers relatively often; explaining why their code won't work when they ask, suggesting solutions and the like. The people I'm helping do have a formal education in programming from a first-year degree-level module, in Java, but I feel like I can't communicate with them very well.
For ... | They'll have to learn the proper terms eventually, the sooner the better.
Use them correctly, and explain them whenever you get a blank stare. Just try to send the right signals, that it's OK to ask about anything they don't understand - the only stupid questions are those you don't ask.
| <h2>In general</h2>
When a person doesn't understand you, you have two alternatives:
<ol>
<li>Adapt the vocabulary according to what the person knows or not,
</li>
<li>Explain to the person the terms she doesn't understand.
</li>
</ol>
The first case works well when the person knows already the technical vocabulary qui... | https://softwareengineering.stackexchange.com |
7,645 | [
"https://mathoverflow.net/questions/7645",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2274/"
] | Let $\alpha\in(0,1)$ and $\eta\in\Lambda_0^\alpha(\mathbb{R})$ be a compactly supported Hölder continuous function of order $\alpha$. I would like to show that, for any $n\in\mathbb{N}$, it is possible to decompose $$\eta=f+g$$
in such a way that $f\in C^n(\mathbb{R})$ and $||f||_{C^n}=O(R^C)$, and $g\in L^\infty(\mat... | I have carried out the suggestion in the last paragraph of Yemon Choi's answer. Choose $\phi\in C^\infty(\mathbb{R})$, $\phi\ge0$ and $\int_{\mathbb{R}}\phi(x)dx=1$, and let $\phi_R(x)=R\phi(Rx)$. Define
$$ f=\phi_R\star\eta,\quad g=\eta-f.$$
Then it is easy to see that
$$ \|f\|\_{C^n}=O(R^{n-\alpha}),\quad \|g\|\_\... | This is only a partial suggestion of how to get an answer, rather than a complete one; but it was getting too long for the comment box.
While I don't remember the details off-hand, it seems like your question could be answered by known results on the rate of approximation in $\Lambda_0^\alpha({\mathbb R})$ by trigonom... | https://mathoverflow.net |
288,081 | [
"https://stats.stackexchange.com/questions/288081",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/81187/"
] | I'm looking to test for set enrichment and I'm wondering whether a fisher's exact test or hypergeometric test is more appropriate (and, if there isn't a straightforward answer, what the relative merits are).
To lay out an example problem, I have a set of 400 objects, 150 of which belong to class A. I draw 50 objects,... | <strong>I apologize in advance for the really long answer, I just don't want to assume any level of familiarity with linear regression. Also, the answer touches on 2-3 different topics, so I wanted to cover all bases.</strong>
The answer to your question has to do with <em>what</em> are $B1$ and $B2$. Linear regressi... | If you are asking which one is the main driver then it will be TV because spending on TV will result in statistically increased sales and online ad due to being close to zero represents that it has no effect on sales but I can't say that for sure because you haven't mentioned the p-value of online ad budget as it will ... | https://stats.stackexchange.com |
1,289,377 | [
"https://math.stackexchange.com/questions/1289377",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13293/"
] | I have seen a post here that says that you can convert an exponential generating function into an ordinary one with the aid of the Laplace transform. Is it possible to do the reverse transformation? i.e. I want to convert an ordinary generating function into an exponential one.
| There may be some cases where complex variables, the residue theorem
and the residue at infinity are helpful. Suppose your OGF is <span class="math-container">$f(z)$</span>
and the desired EGF is <span class="math-container">$g(w).$</span> Then we have
<span class="math-container">$$g(w) = \sum_{n\ge 0} \frac{w^n}... | Let $f(z)$ be the ordinary generating function and $\mathcal{L}$ be the Laplace transform. Then the EGF $g(z)$ has the form
$$
g(z)=\mathcal{L}^{-1}\left(\frac{1}{z} f(z)\Big |_{z=\frac{1}{z}}\right)
$$
| https://math.stackexchange.com |
53,679 | [
"https://electronics.stackexchange.com/questions/53679",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/6202/"
] | How can I have a LED either on or off (not in between) depending on night or day with basic electronics? I have created the circuit below, but it only shines and in darkness it dims.
<img src="https://i.stack.imgur.com/6a6qD.png" alt="This is my attemp">
The photo-resistor is about 3kΩ when light shines and about 1MΩ... | You need the LED to be lit when the photoresistor is high resistance. So replace the photoresistor with a fixed resistor R3, to supply the base current to turn the transistor on.
Then you need the LED to turn off when the light shines, and the photoresistor is low resistance.
So connect the photoresistor from base to g... | The logic is inverted in your circuit. Photoresistors have higher resistance when dark, so the current will be small when dark and larger when light. That means you need inversion between the LDR current and the LED current since you want the LED to light when it is dark.
Since you want the LED to be either full on ... | https://electronics.stackexchange.com |
142,876 | [
"https://softwareengineering.stackexchange.com/questions/142876",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/9536/"
] | I'm trying to figure out the right terminology for the different types of software development
Right now, the only development term I know is "web development", but I've also done a lot of Java and C# development for desktop applications. Obviously this isn't web development, but I'd like to be able to group these und... | I still see quite a few ads for Desktop Application Development. I think you might get more play if you specify the platform - Windows Application Development or OSX Application Development, for example, along with the languages (eg, C++) and libraries/frameworks (eg, Qt), so something like:
Developed applications for... | Desktop Application Development or Rich Client Development come to mind...
| https://softwareengineering.stackexchange.com |
19,589 | [
"https://dsp.stackexchange.com/questions/19589",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/11151/"
] | I am reading this paper about speech enhancement using a minimum mean square error short time spectral amplitude estimator for our speech enhancement project. Basically in the paper they mix a clean speech with noise and try to recover the clean speech.
The paper keeps mentioning <em>a priori</em> SNR and <em>a poster... | The <em>a priori</em> SNR is the ratio of the power of the clean signal and of the noise power. The <em>a posteriori</em> SNR is the ratio of the squared magnitude of the observed noisy signal and the noise power. Both SNRs are computed for each frequency bin.
Of course, the only signal we have is the observed noisy s... | @Matt L. I'm also using this same paper by Y. Ephraim and D. Malah and the decision directed approach mentioned in the paper. But there is this formula eq no 53 which uses recursion to find priori SNR but i am having hard time implementing the code. <img src="https://i.stack.imgur.com/tso5V.png" alt="enter image descri... | https://dsp.stackexchange.com |
20,478 | [
"https://bioinformatics.stackexchange.com/questions/20478",
"https://bioinformatics.stackexchange.com",
"https://bioinformatics.stackexchange.com/users/16067/"
] | Hi I am looking to sort a list of kmers into descending order. I used KMC to obtain a list of kmers from a fastq file separated by tab (e.g.; kmer count). From there I have written this python script to attempt to sort the kmers and their counts in descending order:
<pre><code>import csv
with open("6mers.tsv"... | Just make sure to cast the count to an integer prior to sorting. Assuming you need to do something with the counts, you could use:
<pre><code>import csv
from operator import itemgetter
from pprint import pprint
with open("6mers.tsv") as kmer_file:
reader = csv.reader(kmer_file, delimiter="\t"... | This is untested code ... without seeing to the raw file its tricky.
Could you try:
<pre><code>import csv
with open("6mers.tsv") as kmer_file:
tsv_reader = csv.DictReader(kmer_file, delimiter="\t")
mydict = {rows[0]:rows[1] for rows in tsv_reader if not rows[0] == 'kmer'}
sorted_kmers = sor... | https://bioinformatics.stackexchange.com |
318,482 | [
"https://softwareengineering.stackexchange.com/questions/318482",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/228398/"
] | Im a beginner using visual studio 2013, and I know what they are, but I'm puzzled, why would one use a local variable? I would always just use a global variable.
| This is a great question! Much programming advice and "best practices" comes down to the question of managing complexity. Or to put it plainly: How do we write and manage a large complex program without being overwhelmed. The solution is (like with most large problems) to split it into smaller, more manageable pieces. ... | A global variable allows different components to communicate by reading from and writing to a common memory location. In this way, different components are dependent on each other / coupled: each component has expectations about the values contained in the global variable, and all other components must fulfill these ex... | https://softwareengineering.stackexchange.com |
160,007 | [
"https://mathoverflow.net/questions/160007",
"https://mathoverflow.net",
"https://mathoverflow.net/users/12126/"
] | I have what should be a very simple questions for Brownian motion experts...
Let $[a,b]$ be a given time interval. Let $f(x)$ be the probability that a linear Brownian motion with initial value $x$ at time $t=0$ has a zero in the interval $[a,b]$. I want to argue that $f(x)$ is maximal for $x=0$. This seems intuitively... | For any other initial x, construct a coupling between BMs started at x and 0, where the processes move in opposite directions until they meet (if they do), then they stick together afterwards. Then the answer is apparent.
| There is an easy way to do it via calculation. Start by supposing that $x\geq 0$
Then we're asking for the probability that $x+W_t$ reaches $0$ in the interval $[a,b]$ where $W_t$ is a standard Brownian motion. This the same as
$$\begin{eqnarray}
P(\min_{a\leq t\leq b}x+W_t<0~and~\max_{a\leq t\leq b}x+W_t>0)=P(\... | https://mathoverflow.net |
475,526 | [
"https://math.stackexchange.com/questions/475526",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/91500/"
] | How to solve the following congruence equation?
$$3n^3+12n^2+13n+2\equiv0,\pmod{2\times3\times5}$$
If $t_n$ be the $n$th triangular number, then
$$t_1^2+t_2^2+...+t_n^2=\frac{t_n(3n^3+12n^2+13n+2)}{30}$$
so if we solve this congruence equation we find the values of $n$ that $t_n$ divides $t_1^2+t_2^2+...+t_n^2$.
| Work first modulo $2$. We can rewrite the congruence as $n^3+n\equiv 0\pmod{2}$. Note that this <em>always</em> holds.
Now work modulo $3$. The congruence can be rewritten as $n+2\equiv 0\pmod{3}$. This holds precisely if $n\equiv 1\pmod{3}$.
Finally, work modulo $5$. The congruence can be rewritten as $3n^3-3n^2+3n-... | We solve it by looking at different primes one at a time:<br>
<strong>modulo 2:</strong><br>
The equation becomes $0\equiv0\pmod2$, since $x^n\equiv x\pmod2$ for every integer $x\gt0$. Hence this is always true.<br>
<strong>modulo 3:</strong><br>
We obtain now: $n+2\equiv0\pmod3$, i.e. $n\equiv1\pmod3$.<br>
<strong>mod... | https://math.stackexchange.com |
325,162 | [
"https://math.stackexchange.com/questions/325162",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/59555/"
] | <blockquote>
<blockquote>
Let $ W_1 = \textrm{span}\left\{\begin{pmatrix}1\\2\\3\end{pmatrix}, \begin{pmatrix}2\\1\\1\end{pmatrix}\right\}$, and $ W_2 = \textrm{span}\left\{\begin{pmatrix}1\\0\\1\end{pmatrix}, \begin{pmatrix}3\\0\\-1\end{pmatrix}\right\}$. Find a basis for $W_1 \cap W_2$
</blockquote>
</blockqu... | Note that both the spaces have dimension $2$, this means that if their intersection had dimension $2$ they were equal. However it is immediate that no vector in $W_2$ can be written as $(x,y,z)$ with $y\neq 0$, and therefore $W_1\neq W_2$.
From this follows that the intersection has to have dimension $1$ or $0$. But w... | Let's try to make it easier: if you take a minute to read carefully what is $\,W_2\,$ , you'll see that
$$\begin{pmatrix}x\\y\\z\end{pmatrix}\in W_2\iff y=0$$
Now, since an element of $\,w_1\in W_1\,$ has the general form
$$w_1=a\begin{pmatrix}1\\2\\3\end{pmatrix}+b\begin{pmatrix}2\\1\\1\end{pmatrix}=\begin{pmatrix}... | https://math.stackexchange.com |
38,593 | [
"https://stats.stackexchange.com/questions/38593",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/14163/"
] | Hi I'm taking a graduate course in Statistics and we've been covering Test statistics, and other concepts.
However, I am often able to apply the formulas and develop a sort-of intuition on how stuff works but I am often left with a feeling that perhaps if I backed up my study with simulated experiments I will develop... | I like your question but don't have specific answers to 2 and 3? I imagine that software packages like <code>SAS</code> (broadly speaking of SAS products and not just SAS/STAT) may have tools that facilitate simulation but I can't say for certain. I don't think this sort of thing fits as a branch of mathematics or sta... | <ol>
<li>Yes. After all it is about <em>your</em> intuition.</li>
<li>R would suit you fine. Coding will be quite easy for you if you know Java already (or any other "standard programming language" for that matter).</li>
<li>Computational statistics deals with the design of algorithms for implementing statistical metho... | https://stats.stackexchange.com |
69,811 | [
"https://dsp.stackexchange.com/questions/69811",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/51878/"
] | MATLAB has a function named <code>dualtree3</code> which computes 3-D dual-tree complex wavelet transform. This function only retains the last low-pass coefficients/subband of the real tree. And, it does not save the low-pass subband of the imaginary tree. How can you justify this?
| TL,DR: <em>the low-pass component (approximation coefficients, <code>a</code>) has a size bigger than expected (<span class="math-container">$2^3$</span> times). So I guess that the 8 avatars of the approximation subbands are gathered into one.</em>
First, I did not take enough time to check the codes, so this may be a... | Prof. Nick Kingsbury kindly provide an answer to my question!.
<blockquote>
In 1-D, the lowpass basis functions (scaling functions) from the two
trees (a) and (b) of the dual tree WT tend to look very similar to
each other, apart from a shift of half the output sample period
between them. Hence it usually makes most se... | https://dsp.stackexchange.com |
115,535 | [
"https://cs.stackexchange.com/questions/115535",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/101890/"
] | this is a problem which was asked in GATE CS 2010.<br>
<strong>This is question statement:<br>
Q:</strong> Suppose the predicate F(x, y, t) is used to represent the statement that person x can fool person y at time t. which one of the statements below expresses best the meaning of the formula ∀x∃y∃t(¬F(x, y, t))?<br>
... | I'm not sure how general <em>this type of problem</em> is so I can't tell you if this will always be the best approach, but in this case you can move the negation to the top for more clarity.
<span class="math-container">$$\forall x\ \exists y\ \exists t\ [\neg F(x,y,t)]\equiv \forall x\ \exists y\ [\neg\ \forall t F(... | F(x,y,t)⟹ person x can fool person y at time t.
For the sake of simplicity propagate negation sign outward by applying De Morgan's law.
∀x∃y∃t(¬F(x,y,t))≡¬∃x∀y∀t(F(x,y,t)) [By applying De Morgan's law.]
Now converting ¬∃x∀y∀t(F(x,y,t)) to English is simple.
¬∃x∀y∀t(F(x,y,t))⟹ There does not exist a person who can fool... | https://cs.stackexchange.com |
235 | [
"https://mechanics.stackexchange.com/questions/235",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/136/"
] | Whats the best way to determine the source of coolant consumption? How should one differentiate between say a leaking radiator, leaking waterpump, leaking hoses, a blown head gasket, or crack in the block/head(s)?
| First thing is to initially determine if you're burning it or leaking it. Assuming your car isn't spewing a plume of white smoke when you're driving - you will have to do some additional diagnosis to determine the method of consumption.
First check the oil and coolant - if either contain a milky substance you have a ... | One way would be to have the vehicle running, and look for where the leak would be coming from. You may want to top off the coolant first for best results. However, if it's a slower leak, this technique may not work as well. But, you should still be able to get some indication of where the problem is occurring.
| https://mechanics.stackexchange.com |
466,280 | [
"https://physics.stackexchange.com/questions/466280",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/165277/"
] | Is this a correct application for the time dilation theorem?
Suppose an <strong>electronic</strong> clock has a copper wire of length <span class="math-container">$d$</span>, which allows the electrons to take <span class="math-container">$t$</span> seconds to complete a cycle on the <span class="math-container">$d$</... | To answer your first question, yes, the formula is correct, and it shows changed time interval for a moving observer. And, yes, the formula can be applied to all clocks and to all events.Time interval that takes one event to happen changes depending on the motion of the observer. In order to see this for all events, lo... | Note that the clock slows down <em>as viewed from someone else's reference frame</em>.
In the rocket: clocks, melting ice, human biology, time, and whatever else you can think of all proceed normally. (Same with length contraction: right now we are both pancake flat in the reference frame of a cosmic ray, but we don't... | https://physics.stackexchange.com |
22,974 | [
"https://engineering.stackexchange.com/questions/22974",
"https://engineering.stackexchange.com",
"https://engineering.stackexchange.com/users/16967/"
] | I am thinking of building a house with basement next to some existing structures. Are there rules of thumb on how closely/deeply you can excavate next to an existing structure? By moving farther away from the existing structure do I reduce the potential need for temporary retaining?
| This is the mechanism that allows the piston to move so absorbing the landing forces, while making sure that there is no rotation of the wheel assembly which would create a huge amount of side loading and possibly cause the landing gear to fail.
I have had the opportunity to visit Airbus and stand next to some of the ... | I have a small plane and also fly with other small single engine prop airplanes, Such as Cessna, Cherokee, Moony and the like.
They do have a similar structure providing alignment and resisting shimmying of the wheel when the plane hits a bump on the tarmac.
This is likely the same structure except possibly doing so... | https://engineering.stackexchange.com |
100,808 | [
"https://security.stackexchange.com/questions/100808",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/87324/"
] | I've been reading information on making passwords secure, but what are the reasons an attacker would want to put effort into getting the original password? If an attacker does indeed have a copy of the database, then they have a copy of the database, and all of the information they would gain by logging into the accoun... | <strong>TL;DR: The answer is no.</strong> A user cannot be stopped from reusing the given random password on other sites, so a text based password will always have value to an attacker. This is true for all sites with usernames, and passwords.
<em>Enforcing</em> random passwords rarely works: it makes your users (cust... | So one aspect that you did not mention but may be worthwhile. The attacker may only have a copy of the DB and not the live DB. In this case he/she would have access to the all the data up until he/she stole it but not ongoing. Having passwords would allow him to login legitimately and access the data. On this same ... | https://security.stackexchange.com |
278,691 | [
"https://physics.stackexchange.com/questions/278691",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/127448/"
] | The law of the conservation of energy describes that energy cannot be created nor destroyed however in fact only changes form.
How does this law explain the <em>energy</em> transferred by magnetic fields?
| Magnetism is not explained by conservation of energy. But magnetism is consistent with conservation of energy.
It is commonly stated that the magnetic field does no work. It is true that the magnetic field does no work on charged particles through the Lorentz force law. The force delivered on a charge due to a magneti... | Magnetic fields work like springs.
So for permanent magnets one can align the magnetic dipole moments of the involved subatomic particles and "freeze" this state. But themagnet is than under iner pressure and it is not advised to drop the magnet, it will explode in pieces and the contributed energy will be released.
... | https://physics.stackexchange.com |
220,976 | [
"https://dba.stackexchange.com/questions/220976",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/163632/"
] | In my table there are some records that have different name values for the same account number and I want to extract only the records that have different values in the name field, but that share the same account number. Records that always have the same name associated with the account number I want to ignore, regardle... | <pre><code>SELECT DISTINCT t1.*
FROM table t1, table t2
WHERE t1.accnr = t2.accnr
AND t1.name != t2.name
</code></pre>
| Looks like I achieved what I needed with :
<pre><code>SELECT NAME,ACCNR FROM tblAccounts WHERE (ACCNR) in (
SELECT ACCNR FROM tblAccounts
GROUP BY ACCNR
HAVING min(NAME) <> max(NAME))
</code></pre>
| https://dba.stackexchange.com |
681,341 | [
"https://physics.stackexchange.com/questions/681341",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/290362/"
] | I've been trying to relearn electronics and have run into a conceptual block. Everywhere I look defines current as something along the lines of
<span class="math-container">$$
i = \frac{dq}{dt}
$$</span>
where <span class="math-container">$i$</span> is current, <span class="math-container">$q$</span> is charge and <spa... | Current is not a vector; it doesn't have a direction in the same way that a velocity has a direction.
There is a good analogy between electric current in a wire and the flux or rate of flow of water through a pipe. The idea here is that we put an imaginary surface right across the interior of the pipe. It can be on the... | It is! Sort of.
You are thinking just straight Coulombs which might make sense in a 1D-application or so, you can pretend that charges have no spatial extent and are just individual point particles and travel along well-defined paths... But when you start dealing with three dimensions you start wanting to smear out ind... | https://physics.stackexchange.com |
239,471 | [
"https://mathoverflow.net/questions/239471",
"https://mathoverflow.net",
"https://mathoverflow.net/users/69275/"
] | If $X$ is a separable Banach space and $(x_n)$ is a basic sequence, then we can define biorthogonal functionals $(x^{*}_n)$ in $X^{*}$ such that $x^{*}_n(x_k)=\delta_{nk}$.
What about conversely? If $(x^{*}_n)$ is a basic sequence in $X^{*}$, can we always find vectors $(x_n)$ in $X$ such that $x^{*}_n(x_k)=\delta_{n... | No, that's not true. Let $\mathbb{N}^* = \mathbb{N} \cup \{\infty\}$ and set $X = C(\mathbb{N}^*) \cong c$ and $X^* = l^1(\mathbb{N}^*) \cong l^1$. Take as the basic sequence of $X^*$ the vectors $e_n$ for $n \in \mathbb{N}^*$. There is no vector $x$ in $c$ with $e_n(x) = 0$ for all $n \in \mathbb{N}$ but $e_\infty(x) ... | Yes, there is such a sequence in any non-reflexive Banach space.
It is known$^\#$ that if $Y$ is not reflexive, then $Y$ contains a basic sequence that is not boundedly complete. So if $X$ is not reflexive, then there is a semi-normalized basic sequence $(x_n^*)_{n=1}^\infty$ in $X^*$ s.t. $\sup_n \|\sum_{k=1}^n x_k^... | https://mathoverflow.net |
895,813 | [
"https://math.stackexchange.com/questions/895813",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145766/"
] | Is there a way to sum up this series:
$(((2N+1).2 + 1).2 + 1)\cdots $
The actual question that I encountered was on a coding site (HackerRank) where it said that you had a tree which grows twice in an year. Starting from the Monsoon cycle where the height doubles of what it is ($2N$) and then in the winters it adds 1... | Sum up to 1st term $=2N+1$
Sum up to 2nd term $=(2N+1)2+1=4N+3=2^2N+2^2-1$
Sum up to 3rd term $=(4N+3)2+1=8N+7=2^3N+2^3-1$
$\cdots$
So by observation, sum up to $m$th term $$2^m\cdot N+2^m-1$$ where integer $m\ge1$
which can be easily validated by induction
| This is a recurrence relationship where
$$\begin{cases}
u_n=2u_{n-1}+1\\
u_0=N
\end{cases}$$
Assume that
$$u_n=Ar^n+B
$$
Then solve for $A, r, B$ using $u_0, u_1, u_2$to give
$$u_n=(N+1)\cdot 2^n-1$$
| https://math.stackexchange.com |
56,315 | [
"https://physics.stackexchange.com/questions/56315",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/10549/"
] | I have this geometric optics exercise here, in which a man is looking at himself in a mirror.
<ol>
<li>Determine the minimum height at which the bottom of the mirror must be placed so the man can see his feet (his eyes are at 1.7m).</li>
<li>How does this height vary depending on the distance from the mirror to the ma... | This is easily explained if you use the method of images. The man sees a mirror image of himself which has an apparent location reflected about the plane of the mirror, i.e. equal distance from the mirror but in the opposite direction. Hence the apparent distance from man to his image is always twice the distance fro... | If you are looking at yourself in a mirror, the field of view at the plane of your eyes is always twice the size of the mirror in that dimension. The area you can see thru the mirror, again <i>at the plane of your eyes</i>, is therefore always 4 times the area of the mirror.
This is basic geometry. Draw a diagram an... | https://physics.stackexchange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.