text stringlengths 1 1.11k | source dict |
|---|---|
The best $f(x)$ over this class gives a minimum average distance of:
\begin{align} dist^* &= -7 + 5\sqrt{\frac{5}{2}} + \frac{1}{2}\int_{0}^1 \sqrt{1/9 + x^2}dx \approx 1.21973\\ 3dist^* &\approx 3.6592 \end{align} This is achieved by $\theta = 5 - 3\sqrt{5/2}$. This is strictly better than the naive policy of going straight until you bump into a wall, so it shows the naive policy is suboptimal. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765563713599,
"lm_q1q2_score": 0.8290037642143584,
"lm_q2_score": 0.84594244507642,
"openwebmath_perplexity": 585.4001319214722,
"openwebmath_score": 0.8097679615020752,
"tags": null,
"url": "https://math.stackexchange.com/questions/1745083/what-is-the-optimal-path-between-2-fixed-points-around-an-invisible-obstructin/1747794"
} |
Correlation as measure of similarity
Normalized correlation is used to measure how similar are two signals. I can understand similarity visually but I haven't seen a mathematical definition for the similarity of 2 signals anywhere. So I have 2 big questions that are bothering me:
1. Is there a mathematical definition for how similar two signals are?(similar in same fashion of visually similar)
2. With that definition, is there a proof that shows correlation is maximum between similar signals and not any other signal?
EDIT:
Okay so I thought about 1 and I have a mathematical definition for similar signals. Basically s1 is similar to s2 if they are proportional, that is s2 = a.s1. So we can focus on question 2 now :). A proof that says out of all functions out there, the correlation of s1 and s2 is maximum only if s1=k.s2 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9748211597623861,
"lm_q1q2_score": 0.8080670946194755,
"lm_q2_score": 0.8289388125473628,
"openwebmath_perplexity": 457.2955808093903,
"openwebmath_score": 0.855352520942688,
"tags": null,
"url": "https://dsp.stackexchange.com/questions/42945/correlation-as-measure-of-similarity"
} |
ros
Title: xdot URL feature
I'm using xdot to build my own custom graphs by reading out a file containing dot syntax. The XDot page http://code.google.com/p/jrfonseca/wiki/XDot#Embedding mentions the feature of adding the URL tag to nodes to display information when clicked. I tried to add it to my dot file without success. Can I use this feature in the xdot ROS package? If so, an example is appreciated.
Originally posted by Steven Bellens on ROS Answers with karma: 735 on 2011-10-04
Post score: 0
Based on a diff of the Xdot.py and ours, it appears the URL feature was more recently added (it's hard to tell as xdot.py doesn't have version numbers or accurate change logs).
It probably wouldn't take much work to merge in the feature changes to support the URL feature
The current version is forked with various minor patches due to our higher-level usages. I'm swamped right now so would appreciate any patch to this affect. | {
"domain": "robotics.stackexchange",
"id": 6847,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros",
"url": null
} |
y and z. Example 1:Find the arithmetic mean of first five prime numbers. . . Median: Arrange the goals in increasing order We much have b – A = A- a ; Each being equal to the common difference. If we remove one of the numbers, the mean of the remaining numbers is 15. Mean with solution. The following table shows the grouped data, in classes, for the heights of 50 people. From equation ( ii ) , ( iii ) & b = -1. a = 2 and c = -4. Solution: Using the formula: Sum = Mean × Number of numbers Sum of original 6 numbers = 20 × 6 = 120 Sum of remaining 5 numbers = 15 × 5 = 75 Question 20. So the sequence is 2, -1, -4. The last two numbers are 10. Solution:First five prime numbers are 2, 3, 5, 7 and 11. Selection of the terms in an Arithmetic Progression, If number of terms is 3 then assume them as ” a-d, a & a+d” and common difference is “d”, If number of terms is 4 then assume them as ” a-3d, a-d, a+d & a+3d ” and common difference is “2d”, If number of terms is 5 then assume them as ” | {
"domain": "justinbuschmusic.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9711290963960278,
"lm_q1q2_score": 0.8348444777455071,
"lm_q2_score": 0.8596637469145053,
"openwebmath_perplexity": 928.1472019940666,
"openwebmath_score": 0.6901515126228333,
"tags": null,
"url": "https://justinbuschmusic.com/bu87fll/a7d264-mean-questions-with-solutions"
} |
filters, discrete-signals, signal-analysis, continuous-signals
Title: What function to apply to a signal to expose its burstiness (i.e., make the burst part more evident than the non-bursty part) I am working on some signals one of which I have attached below:
What can I do (i.e. functions that I can apply to this signal) to get something like the signal below: | {
"domain": "dsp.stackexchange",
"id": 4936,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "filters, discrete-signals, signal-analysis, continuous-signals",
"url": null
} |
quantum-field-theory, spin-statistics
$$
\xi_{\alpha_{1}...,\alpha_{j},\dot{\beta}_1...\dot{\beta}_k} \longrightarrow \sum\limits_{(\rho)(\dot{\sigma})}A_{\alpha_1\rho_1}...A_{\alpha_j\rho_j}\bar{A}_{\dot{\beta}_1\dot{\sigma}_1}...\bar{A}_{\dot{\beta}_k\dot{\sigma}_k}\xi_{\rho_{1}...,\rho_{j},\dot{\sigma}_1...\dot{\sigma}_k}
$$
[The dot over the index simply means that this index transforms according to $\bar{A}$ instead of $A$; the symbol ($\rho$) stands for $\rho_1...\rho_j$; the symbol ($\dot{\sigma}$) for $\dot{\sigma}_1...\dot{\sigma}_k$] This representation of SL(2,C) is usually denoted $\mathfrak{D}^{(\frac{j}{2},\frac{k}{2})}$. Every irreducible representation is equivalent to one of these."
From here, if we consider the case with $A\longrightarrow(-1)$ and $\mathfrak{D}^{(\frac{j}{2},0)}(A)\equiv D^{\frac{j}{2}}(A)$, then we can see that this transformation reduces to a multiplication by the inverse unit matrix $\textbf{-1}$ j times. | {
"domain": "physics.stackexchange",
"id": 67549,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, spin-statistics",
"url": null
} |
special-relativity, geometric-optics, interferometry, aether
So this makes me think that Michelson interferometer has something special in comparison with the Fabry-Perot one. Modern replications of the Michelson-Morley experiment do indeed use Fabry-Pérot cavities in each arm, in exactly the way you describe. See the heading "Recent Optical Resonator Experiments" on the Michelson-Morley Interferometer wikipedia page. Exactly as you reason, the sensitivity is increased, through optical resonance, by a factor of $F$, the cavity's finesse. These modern experiments achieve astounding bounds on the velocity of the putative Aether wind. As stated on the Wiki page:
Herrmann, S.; Senger, A.; Möhle, K.; Nagel, M.; Kovalchuk, E. V.; Peters, A., "Rotating optical cavity experiment testing Lorentz invariance at the $10^{−17}$ level", Phys. Rev. D 80 #100, 2009 | {
"domain": "physics.stackexchange",
"id": 17660,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "special-relativity, geometric-optics, interferometry, aether",
"url": null
} |
html, css, html5
</div>
</div>
<div class="div_fs div_tablet_top div_mobile">
<div class="sign_fs" id="beef">Beef</div>
<div class="text_fs" >
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
<div class="div_fs div_tablet_bot div_mobile">
<div class="sign_fs" id="sushi">Sushi</div>
<div class="text_fs"> | {
"domain": "codereview.stackexchange",
"id": 39385,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "html, css, html5",
"url": null
} |
javascript, object-oriented, game
and do i really need it if my objects are stored in array?
Question 3:
In createGroups method I would rather use some kind of pointer instead of myGame.groups[key]:
this.createGroups = function () {
$.each(dataTmp.groups, function (key, group) {
var currentGroup;
currentGroup = new g(key)
currentGroup.setStatus(group.status)
currentGroup.setName(group.name)
myGame.groups[key] = currentGroup;
})
} | {
"domain": "codereview.stackexchange",
"id": 26969,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, object-oriented, game",
"url": null
} |
integral if one of, or both, of the conditions hold: The interval of integration is infinite. Comparison test: Suppose f and g are continuous with f(x) g(x) 0, for x a. Solution 2 (a). {comparison} 4. Evaluate the …. Show that the improper integral. Partial Fractions. And in order to handle this, the thing that I need to do is to check the integral from 0 up to N, e^(-kx) dx. On the interval [1 ;1], we split up the integral into two separate improper integrals. NOVA COLLEGE-WIDE COURSE CONTENT SUMMARY. Note that Z t 1 1 x dx= [lnx]t 1 = lnt!1 as t!1: Hence, R 1 1 1 x dxdiverges. and is clearly finite, so the original integral is finite as well. Warning: Now that we have introduced discontinuous integrands, you will need to check. are all improper because they have limits of integration that involve ∞. {comparison} 8. 2 (Improper Integrals with Infinite Discontinuities) Consider the following three. Convergence test: Direct comparison test Remark: Convergence tests determine whether an | {
"domain": "pacianca.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9884918516137418,
"lm_q1q2_score": 0.8623082847681207,
"lm_q2_score": 0.8723473879530492,
"openwebmath_perplexity": 642.0331441711976,
"openwebmath_score": 0.9238064289093018,
"tags": null,
"url": "http://pacianca.it/improper-integrals-comparison-test.html"
} |
# Calculate the integral of $\cos^3(y)\sin^4(y)\,\mathrm{d}y$
I'm stuck at calculating this integral
$$\int \cos^3 y \text{ } \sin^4 y \, \mathrm{d} y$$
I tried a lot of things
• $u = \cos^3(y)$, $\mathrm{d}y = -3\sin y \cos^2 y$
• $u = \sin^2(y)$, $\mathrm{d}y = 2 \sin \cos y$
• $u = \sin(y)$, $\mathrm{d}y = \sin(2y)$
• played with $\operatorname{cosec}$ and $\operatorname{sec}$
None of this worked. Do you have a hint on how to start?
Thanks to Gerry Myerson, I have a hint on how to start the problem. I am still stuck though. Sorry, I'm starting with integrals!
Here is what I've done :
$$I = \int \! \cos^3(y) \sin^4(y) \, \mathrm{d} y$$
$$I = \int \! \cos^2(y) \cos(y)\sin^4(y) \, \mathrm{d} y$$
$$I = \int \! (1-\sin^2(y))\sin^4(y)\cos(y) \, \mathrm{d} y$$
$u = \sin y$, so $dy = du/ \cos y$
$$I = \int \! (1-u^2)u^2 \, \mathrm{d}u$$
$$I = \int \! u^2-u^6 \, \mathrm{d}u$$
$$I = u^5/5 - u^7 / 7$$
$$I = (\sin y)^5/5 - (\sin y)^7 / 7$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754452025766,
"lm_q1q2_score": 0.8003291991188397,
"lm_q2_score": 0.8128673155708975,
"openwebmath_perplexity": 723.4973910281711,
"openwebmath_score": 0.9171260595321655,
"tags": null,
"url": "http://math.stackexchange.com/questions/120343/calculate-the-integral-of-cos3y-sin4y-mathrmdy"
} |
meteorology, clouds, mesoscale-meteorology
Title: Why do clouds sometimes form in "plumes"? When I started exploring GOES satellite images of cloud cover (such as this), I noticed clouds could form from "plumes." That is, large clouds could sometimes form by billowing up from one or more very small points. For example, this gif created from GOES-East GeoColor band data on June 13 2021: | {
"domain": "earthscience.stackexchange",
"id": 2271,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "meteorology, clouds, mesoscale-meteorology",
"url": null
} |
python, optimization, strings, memory-management
Title: Memory issues with Find Strings Problem on InterviewStreet Here is the code I wrote for the problem at http://www.interviewstreet.com/recruit/challenges/solve/view/4e1491425cf10/4efa210eb70ac where we need to to print the substring at a particular index from the lexicographicaly-sorted union of sets of substrings of the given set of strings...
import itertools
N = int(raw_input())
S = set()
for n in xrange(N):
W = raw_input()
L = len(W)
for l in xrange(1,L+1):
S=S.union(set(itertools.combinations(W, l)))
print set(itertools.combinations(W, l))
print S
M = int(raw_input())
S = sorted(list(S))
print S
for m in xrange(M):
Q = int(raw_input())
try:
print "".join(S[Q-1])
except:
print "INVALID" | {
"domain": "codereview.stackexchange",
"id": 1170,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, optimization, strings, memory-management",
"url": null
} |
moveit, ros-kinetic
I am on Ubuntu 16.04 LTS and on ROS Kinetic. I have worked with MoveIt! several times and I had to change my MoveIt! package more than one time because I added more links and joints to my URDF model. At the time, I launched the moveit setup assistant and clicked on "Edit Existing MoveIt Configuration Package" and selected the path to the MoveIt! config package that I had previously created. After that I would write arguments in a text box named XACRO arguments (or someting like this) in order to load some parts of my model (because my original URDF is the Husky robot and I am also loading other additional parts like the kinetic, etc.). The problem is that this XACRO arguments text box used to appear below the text box were I type the path for my MoveIt! config package, but now it's not appearing anymore and I don't know why. This makes it impossible for me to even load and see correctly my MoveIt! config package in the Setup Assistant and I also can't alter it like I want. Do you know | {
"domain": "robotics.stackexchange",
"id": 30693,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "moveit, ros-kinetic",
"url": null
} |
php, mysql, database
}
return $this;
}
/**
* This method allows you to set the limit for the SQL query.
*
* @param int $limit set the limit for the SQL query.
*
* @throws Exception
* @return Mysql
*/
public function limit($limit)
{
try
{
if(is_int($limit) OR is_float($limit))
{
$this->limit = $limit;
}
else
{
throw new Exception("The value of limit parameter should be an integer");
}
return $this;
}
catch(Exception $e)
{
$this->catchError($e->getFile(), $e->getLine(), $e->getMessage());
}
}
/**
* This method allows you to merge all statements.
*
* @return string
*/
protected function queryBuilder()
{
$query = null;
if(!empty($this->insert))
{
$query = $this->insert;
} | {
"domain": "codereview.stackexchange",
"id": 19167,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "php, mysql, database",
"url": null
} |
thermodynamics, water
Title: How do I predict volume loss due to evaporation when boiling water? Suppose I have a pot with diameter $D$ containing a volume of water $V$, being heated by a flame under it. If the ambient air temperature is $T$ and relative humidity is $R$, how can I calculate the expected rate of loss due to evaporation over a period of time, $t$? Assume the period of time begins once the water begins boiling.
Edit: For simplicity's sake, also assume the flame is just hot enough to get the water boiling. You need to know the rate of heat given by the flame to the water.
Suppose the flame transfers $h$ kJ/s to the water. The latent heat of evaporation of water is $2260\ \mathrm{kJ/kg}$.
For energy balance, the heat given to the water must be equal to the amount of heat required to convert water into steam.
$$
h = \dot{m} \times 2260 \\
\therefore \dot{m} = \frac{h}{2260}\ \mathrm{kg/s}
$$ | {
"domain": "physics.stackexchange",
"id": 11076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, water",
"url": null
} |
input gates are no different to the simple 2-input gates above, So a 4-input AND gate would still require ALL 4-inputs to be present to produce the required. Do this for Z, the output of problem 2d. This table shows four useful modes of operation. Logical operator symbols. Mathematics normally uses a two-valued logic: every statement is either true or false. The important applications of Logic Gates in Digital Electronics are Flip-Flop circuit, register, digital counter, Microprocessor, Microcontroller, etc. The chips that 've been used are the basic gates like OR, AND, XOR, NOR, NAND, etc. 71% average accuracy. A HIGH output (1) results if one, and only one, of the inputs to the gate is HIGH (1). ! Still have two truth values for statements (T and F) ! When we assign values to x and y, then P has a truth value. Now, once you have this Truth Table, you can say I know this Truth Table. Function of a Logic Gate is expressed using Truth Table. The NOR Gate RS Flip Flop. describing a | {
"domain": "cloudscuola.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464485047916,
"lm_q1q2_score": 0.8132801752066438,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 795.8803509624115,
"openwebmath_score": 0.6178021430969238,
"tags": null,
"url": "http://cloudscuola.it/sgxh/truth-table-logic-gates-calculator.html"
} |
$$4 \cdot 3! = 24.$$
The value you want, the number of onto functions $A \to B$ where $g(a_1) \ne g(a_2)$, is
$$240 - 24 = 216.$$
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9799765628041176,
"lm_q1q2_score": 0.8229196092745604,
"lm_q2_score": 0.8397339696776499,
"openwebmath_perplexity": 126.6021129953887,
"openwebmath_score": 0.9251043200492859,
"tags": null,
"url": "http://math.stackexchange.com/questions/211143/onto-maps-between-two-finite-sets"
} |
## Proof by induction
That last teaser – that there is a formal method for actually proving infinite things without having to do infinite things – was just what Blake needed. He replied a couple days later (back then we didn’t have threaded conversations, so he didn’t know whether the same Doctor would get the message):
I recently sent you a letter regarding the proof that .999... = 1 in the FAQ. Specifically, I asked how it was possible to multiply PNR by ten when you could not get to the right-hand side of it. This was explained quite neatly.
However, the nice person who helped me out said it could be proven that one can multiply PNR by 10 by using a process of induction. I tried to search the archives, but the results I found there were not very satisfactory because it seemed to me that each induction question was actually problem-specific.
To cut short, I would like to know the induction proof for multiplying PNR by ten.
Doctor TWE first summarized the concept of induction: | {
"domain": "themathdoctors.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9854964194566753,
"lm_q1q2_score": 0.8596952109972292,
"lm_q2_score": 0.8723473713594992,
"openwebmath_perplexity": 641.1596823095123,
"openwebmath_score": 0.7628352046012878,
"tags": null,
"url": "https://www.themathdoctors.org/more-on-0-999/"
} |
are: 4 H, 3 H and 1 T (in various orders), 2 H and 2 T (in various orders), 1 H and 3 T (in various orders), or 4 T. Tree Diagrams •Sample spaces can also be described graphically with tree diagrams. This item is taken from IGCSE Mathematics (0580) Paper 43 of May/June 2013. This site is the homepage of the textbook Introduction to Probability, Statistics, and Random Processes by Hossein Pishro-Nik. If it is fine he only has a 1 in 20 chance of winning. The number of "Male and Smoke" divided by the total = 19/100 = 0. Submitted by Hannah Yates on 6 March 2017. Draw a tree diagram showing the possible outcomes. 13 Outcomes & Probability Third Pick Second Pick First Pick BBB (0. Construct two tree diagrams (one for with replacement and the other for without replacement) showing the drawing of two M&Ms, one at a time, from the M&Ms you were given, as recorded in the table above. | {
"domain": "piratestorm.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9865717436787542,
"lm_q1q2_score": 0.8553929746006267,
"lm_q2_score": 0.8670357529306639,
"openwebmath_perplexity": 564.7005215453598,
"openwebmath_score": 0.6850816011428833,
"tags": null,
"url": "http://piratestorm.it/probability-with-replacement-tree-diagram.html"
} |
c#, primes, factors
/// <summary>
/// Find prime numbers up to a given maximum
/// </summary>
/// <param name="upperLimit">The upper limit</param>
/// <returns>All prime numbers between 2 and upperLimit</returns>
private IEnumerable<int> FindPrimes(int upperLimit)
{
var composite = new BitArray(upperLimit);
var sqrt = (int) Math.Sqrt(upperLimit);
for (int p = 2; p < sqrt; ++p)
{
if (composite[p])
continue;
yield return p;
for (int i = p * p; i < upperLimit; i += p)
composite[i] = true;
}
for (int p = sqrt; p < upperLimit; ++p)
if (!composite[p])
yield return p;
} | {
"domain": "codereview.stackexchange",
"id": 31925,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, primes, factors",
"url": null
} |
digital-communications, ofdm, ifft
What does it mean by saying symbols in ofdm are assigned in frequency domain on individual subcarriers? I can only see a symbol at the output of a ofdm mapper which is a complex number which comes from the constellation diagram depending on the modulation technique used. The output of the IFFT is also a complex number. So how does an IFFT operation done on complex symbols mean that they are assigned in frequency. we could as well use a FFT instead of a IFFT. | {
"domain": "dsp.stackexchange",
"id": 5479,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "digital-communications, ofdm, ifft",
"url": null
} |
`````` auto mesh = loadMesh(_mesh=new Mesh<Simplex<2>>);
auto Vh = Pch<2>( mesh );
auto u = Vh->element();
auto v = Vh->element();``````
• Define the linear form $l$ with test function space $V_h$
``````auto l = form1( _test=Vh );
l = integrate(_range=elements(mesh),
_expr=id(v));``````
• Define the bilinear form $a$ with $V_h$ as test and trial function spaces
``````auto a = form2( _trial=Vh, _test=Vh);
a = integrate(_range=elements(mesh),
`form1` and `form2` are used to define respectively the left and right side of our partial differential equation.
• Add Dirichlet boundary condition on u
``````a+=on(_range=boundaryfaces(mesh),
_rhs=l, _element=u, _expr=cst(0.) );``````
We impose, in this case, $u=0$ on $\partial\Omega$, with the keyword `on`.
• Solving the problem
``a.solve(_rhs=l,_solution=u);``
• Exporting the solution
``````auto e = exporter( _mesh=mesh );
e->save();``````
The complete code reads as follows :
``````#include <feel/feel.hpp> | {
"domain": "feelpp.org",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9559813538993888,
"lm_q1q2_score": 0.8163246661246598,
"lm_q2_score": 0.8539127492339909,
"openwebmath_perplexity": 13718.21862802429,
"openwebmath_score": 0.26109886169433594,
"tags": null,
"url": "http://book.feelpp.org/user-manual/"
} |
java, c#, android, xml, xamarin
LoadApplication(new App());
}
...
protected override async void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (resultCode == Result.Ok && data != null)
{
if (requestCode == DataStoreAndroid.READ_CONFIG_REQUEST_CODE)
{
dataStore.ReadConfigFromFile(data.Data);
}
...
}
}
} | {
"domain": "codereview.stackexchange",
"id": 28539,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, c#, android, xml, xamarin",
"url": null
} |
electromagnetism, electric-circuits, electric-current, voltage, approximations
Title: Does Kirchhoff's Law always hold? There's a bit of furore from this question on Youtube involving Dr. Walter Lewin and another Youtuber. With Dr. Lewin claiming Kirchhoff's Law doesn't always hold when magnetic fields are involved, and that two voltmeters attached to identical places in a circuit can give different readings. Is this the case?
Original Video :
https://www.youtube.com/watch?v=0TTEFF0D8SA
Dr. Lewin's response :
https://www.youtube.com/watch?v=AQqYs6O2MPw
...claiming Kirchhoff's Law doesn't always hold when magnetic fields are involved, and that two voltmeters attached to identical places in a circuit can give different readings. Is this the case? | {
"domain": "physics.stackexchange",
"id": 53986,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electromagnetism, electric-circuits, electric-current, voltage, approximations",
"url": null
} |
$$p \wedge (p \to q)$$
is false. The only case that's left is when $p$ is true and $q$ is false, and I'll leave it to you to verify that the proposition is true in this case too.
• In the case of p is true and q is false, I was under the impression that means p→q is false, which would imply the overall statement is false? What is my mistake in that logic?
– 123
Jan 13, 2016 at 21:44
• @TK-421 If $p$ is true and $q$ is false, then $p \wedge (p \to q)$ is also false.
– user296602
Jan 13, 2016 at 21:46
• Ohhh I think I get it. So since p∧(p→q) is false is that case, the overall implication is vacuously true?
– 123
Jan 13, 2016 at 21:48
• Yes. ${}{}{}{}$
– user296602
Jan 13, 2016 at 22:51 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924802053234,
"lm_q1q2_score": 0.8035576533585751,
"lm_q2_score": 0.8267118004748677,
"openwebmath_perplexity": 428.82292117180634,
"openwebmath_score": 0.945174515247345,
"tags": null,
"url": "https://math.stackexchange.com/questions/1611309/is-p-land-p-to-q-to-q-a-tautology/1611327"
} |
python, python-3.x, recursion, error-handling, minesweeper
def first_turn(self):
self.user_input()
self.mines_generator()
self.two_dimension_array()
self.complete_table()
self.adjacent_zero(self.user_cell)
def print_table(self):
print('\n'*10)
for row in range(self.height+1):
cell = '|'
for column in range(self.width+1):
if row == 0:
cell += f'{column:2}|'
continue
elif column == 0:
cell += f'{row:2}|'
continue
elif str(column).zfill(2)+str(row).zfill(2) in self.user_reveal:
cell += f'{self.table[row-1][column-1]:2}|'
continue
else:
cell += '{:>3}'.format('|')
print(cell)
def end_game(self): | {
"domain": "codereview.stackexchange",
"id": 36956,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-3.x, recursion, error-handling, minesweeper",
"url": null
} |
kinetics, catalysis, enzymes
I would think an anticatalyst could be made by having an enzyme which binds a molecule in a way that reduces the favorability of the transition state (or alternatively, stabilizes the reactants, as mentioned by Nicolau Saker Neto below). The binding to the anticatalyst enzyme would also have to be favorable enough where the reactants would not just react and ignore the slower anticatalyzed pathway (one could also assume, for the sake of argument, that enough of the anticatalyst is added where the majority of the reactant molecules are bound). Some substances do exist that slow down reactions and they're different from catalytic inhibitors/poisons. Such substances are called negative catalysts. Here is one example I can think of right now:
$$\ce{2H2O2 \xrightarrow{\large\mathrm{glycerol}} 2H2O + O2}$$
Glycerol, in this case behaves as a negative catalyst and slows down the reaction. | {
"domain": "chemistry.stackexchange",
"id": 7939,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "kinetics, catalysis, enzymes",
"url": null
} |
matlab, fft, frequency-spectrum, cross-correlation, estimation
Does this make sense? Is it something that's ever done in the DSP community? Are there better methods of doing this which I'm oblivious to? (Note I have tried an MSE metric with limited success).
If what I'm doing is okay, are there any improvements I can make to it. I have two small problems. The first is computational time, I can compute the zero lag correlation by hand in Matlab as sum(x.*y)/scalefactor (scalefactor = sqrt(sum(x.^2).*sum(y.^2)) ) or I can use xcorr(x,y,0,'coeff') to grab the zero lag value. I'm not sure if these are optimized as well as they could be... The second issue is that if any of the set of generated FFT's are large, say a constant 1 over f=0 to 0.5, the cross correlation metric will be large despite the experimental FFT being much "different". This actually makes me think cross correlation is not the right metric to use, so, any thoughts? | {
"domain": "dsp.stackexchange",
"id": 1076,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "matlab, fft, frequency-spectrum, cross-correlation, estimation",
"url": null
} |
astronomy, spectroscopy, hydrogen, molecules, radio-frequency
normal hydrogen atom when an electron's spin flips from being aligned with the proton to being anti-aligned with the proton. In $H_2$, an electron's spin cannot flip because it would then be occupying the same state as the other electron. Even if it could, the differing shape of the orbital would produce a line at a significantly different wavelength than 21cm. | {
"domain": "physics.stackexchange",
"id": 46050,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "astronomy, spectroscopy, hydrogen, molecules, radio-frequency",
"url": null
} |
dobsonian-telescope, collimation
If you never use a bare laser to adjust the primary, a solid dot is fine. But a donut gives you more options.
I've done business with Bob directly, he's very experienced. Like Gary Seronik and Jim Fly, he should be considered an expert in this field. But take his advice in context and look at all the details - he says what he says for a good reason. | {
"domain": "astronomy.stackexchange",
"id": 434,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "dobsonian-telescope, collimation",
"url": null
} |
step in the method. The spatial part R()r is obtained as the solution of the Helmholtz equation (2. This result is obtained by dividing the standard form by g(y), and then integrating both sides with respect to x. Separation of Variables - Heat Equation Part 1 We use Separation of Variables to find a general solution of the 1-d Heat Equation, including boundary conditions. with : and i want to have a 3 d graph for for example for u(x,y,1,1. Differential Equations" L. tissue as a finite domain was analytically solved by employing the separation of variables and Duhamel's superposition integral. 1 Conservation Laws and Jump Conditions Consider shocks for an equation u t +f(u). Consider the wave equation in Ω with zero displacement on Γ: (PDE) utt − c2(uxx +uyy) = 0 (x,y) in Ω,t > 0, (BC) u(x,y,t) = 0 (x,y) on Γ,t > 0,. Chapter 2 - The Classical Wave Equation. di↵erential equations are linear such a linear combination is also a solution to the coupled linear equations. 3: Hyperbolic | {
"domain": "chicweek.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9923043544146899,
"lm_q1q2_score": 0.8434301006175603,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 556.7745988916529,
"openwebmath_score": 0.808579683303833,
"tags": null,
"url": "http://zgrk.chicweek.it/solution-of-wave-equation-by-separation-of-variables-pdf.html"
} |
javascript, jquery
If you have to conditionally call .show() and .hide(), you can use .toggle().
Avoid hard-coding hide() as the initial state. It would be better to have the "Hide" radio button marked as checked in the HTML, then let the JavaScript follow suit. To bind an event handler and execute it right away, you could use .trigger(), but note that triggering the 'click' event also toggles the radio state, so you'll want to make a separate 'init-post-format' event type. | {
"domain": "codereview.stackexchange",
"id": 11341,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
balloon during that time. Write the formula to find volume of a sphere. 8 inV vs≈ 10 in 34 3 V rπ= 15. 56r³ = 1152000. asked by Jeffrey on July 31, 2011; Calculus. Taking derivative of b. This blog describes a space habitat concept where air is contained in a large volume by relying on the weight of asteroid rock to support internal pressure via self-gravitation. Click here to see a solution to Practice Problem 5. Write formulas for its circumference and area. Formulas for Model Hot Air Balloon Lift: Gross lift is the weight of the ambient air minus the weight of the heated air. ) Verify the answer using the formulas for the volume of a sphere, V = 4 3 π r 3, and for the volume of a. The formula used by this calculator. The formula for the volume of a sphere is a much more difficult one to visualize. A spherical balloon has a radius of 8. The balloon rises in the atmosphere to an altitude of approximately 25,000 feet, where the pressure is 385 mmHg and the temperature is -15. | {
"domain": "rakumanu.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419690807408,
"lm_q1q2_score": 0.8303641861309318,
"lm_q2_score": 0.839733963661418,
"openwebmath_perplexity": 448.4237867004272,
"openwebmath_score": 0.8477767109870911,
"tags": null,
"url": "http://wfab.rakumanu.it/spherical-balloon-volume-formula.html"
} |
c++, object-oriented
Title: Creating an inventory using classes The next assignment in my class is to create a program that allows the user to input an inventory, and then display the total value of the inventory. We are required to create a class with both private and public member functions. I tried to keep it as streamlined as possible but I know there is always room for improvement. Let me know what you think.
I defined the member functions outside of the class by direction of the prof. I personally like seeing it all in one place, but this is an OOP class, so I guess it makes sense to define them outside. The only other direction was that all values have to be positive, hence the do while loops.
#include <iostream>
using namespace std;
class inventory
{
private:
int productNum[10];
int productCount[10];
double productPrice[10];
public:
int locator;
void retrieve();
void init();
void store();
}inv1; | {
"domain": "codereview.stackexchange",
"id": 22123,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented",
"url": null
} |
electrochemistry
I was not provided any experimental data to arrive at the answer.I know that $\ce{KCl}$ is a strong electrolyte and so my guess was that it must have greater molar conductivity than at least $\ce{CH_3COOH}$. But the answer key gives all A, B, and C. Is there a definite rule here? I would agree with the answer key. The trick here is it's limiting molar conductivity, the molar conductivity at infinite dilution. For a neutral electrolyte compound, I was taught the notation $\Lambda ^0$, and $\lambda ^0$ was reserved for individual ions. (The $0$ superscript represents zero concentration, equivalent to $\infty$ dilution.) | {
"domain": "chemistry.stackexchange",
"id": 7325,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electrochemistry",
"url": null
} |
java, game-of-life
public Cell[] getCells() {
return cells;
}
public Cell getCell(int x, int y) {
return cells[y * width + x];
}
public int getHeight() {
return height;
}
public int getWidth() {
return width;
}
public long getGeneration() {
return generation;
}
public long getDuration() {
return duration;
}
public PetriDish(int width, int height) {
this.width = width;
this.height = height;
this.cells = new Cell[width * height];
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
cells[y * width + x] = new Cell(this, x, y,
x == 0 || y == 0 || x == width - 1 || y == height - 1);
}
}
for (Cell cell : cells) {
cell.prepare();
}
}
public void doEvolution() {
long start = System.currentTimeMillis(); | {
"domain": "codereview.stackexchange",
"id": 993,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, game-of-life",
"url": null
} |
Now, let y= sin(x+ a) for constant a. Then y'= cos(x+a) and y''= -sin(x+ a) so that y''+ y= sin(x+ a)- sin(x+ a)= 0 while y(0)= sin(a) and y'(0)= cos(a). That is, sin(x+ a) is a solution to the initial value problem y''+ y= 0 with initial condition y(0)= sin(a), y'(0)= cos(a). So it follows that sin(x+ a)= sin(a)cos(x)+ cos(a)sin(x). Similarly, taking y= cos(x+ a), y'= -sin(x+ a) and y''= -cos(x+ a) while y(0)= cos(a) and y'(0)= -sin(a). It follows that cos(x+ a)= cos(a)cos(x)- sin(a)sin(x).
Taking, in both of those, x= b, we have sin(a+ b)= sin(a)cos(b)+ cos(a)sin(b) and cos(a+ b)= cos(a)cos(b)- sin(a)sin(b).
From those "addition formulas" the others follow:
Letting a= b= x, sin(2x)= sin(x+ x)= sin(x)cos(x)+ cos(x)sin(x)= 2 sin(x)cos(x) and cos(2x)= cos(x)cos(x)- sin(x)sin(x)= cos^2(x)- sin^2(x). | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.962673111584966,
"lm_q1q2_score": 0.8104029228921139,
"lm_q2_score": 0.8418256551882382,
"openwebmath_perplexity": 2130.281622646264,
"openwebmath_score": 0.7849017977714539,
"tags": null,
"url": "https://www.physicsforums.com/threads/the-derivation-of-several-triginometric-identities.814845/"
} |
javascript, jquery
Title: Fixing navbar when scrolling beyond a certain number of pixels I have written a jquery code, which fixes a navbar header on top of page when a user scrolls down to a certain pixels. But I am not sure whether is this the correct way to do this.
Because this is going to be a majorly used function by all users, it would be better if I can improve it in terms of optimizations and speed.
What basically I am doing is removing few classes and adding few classes when that breakpoint reaches.
$(function () {
$(window).scroll(function (event) {
var scroll = $(window).scrollTop(); | {
"domain": "codereview.stackexchange",
"id": 12657,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, jquery",
"url": null
} |
java, beginner, swing, lambda, pokemon
public static PokemonType getPokemonType(String name) {
for (PokemonType p : pokemonTypes) {
if (p.element.name == name) {
return p;
}
}
return none; // should never be the case
}
// To make sure that the field says if nothing applies
public static StringBuilder finalizeBuilder(StringBuilder sb) {
if (sb.length() == 0) { sb.append("None."); }
else {
// Just to replace the last comma with a period
sb.setLength(sb.length() - 2);
sb.append('.');
}
return sb;
}
} I think the overall design is good, although make the main method create a new PokemonTypeChecker and then move all the stuff currently in the main method to a run method or similar - doing logic in the constructor is bad practice, and not writing OO code (i.e. making everything static) is too. You could also perhaps consider JavaFX over swing/awt too.
Comments: | {
"domain": "codereview.stackexchange",
"id": 9519,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, swing, lambda, pokemon",
"url": null
} |
c++, object-oriented, classes, embedded, namespaces
Title: Defining hardware components structure I'm writing firmware for my Arduino project, and I'm struggling with a clean, scalable hardware mapping structure. Initially, I had the following namespace:
namespace Motherboard {
extern DRV8825 xAxisMotor;
extern MP6500 yAxisMotor;
extern DRV8876 zAxisMotor;
extern ClickEncoder encoder;
extern SSD1331 display;
extern RGBLed rgbIndicator;
extern Relay heaterRelay;
void performMainSequence();
void begin(const EepromData &initialData);
}; // namespace Motherboard
Which I initialized like this:
namespace Motherboard {
//=================== Public ====================
DRV8825 xAxisMotor = {
23, // ENABLE PIN
25, // MS0 PIN
27, // MS1 PIN
29, // MS2 PIN
31, // RESET PIN
33, // SLEEP PIN
35, // STEP PIN
37, // DIRECTION PIN
39, // FAULT PIN
MOTHERBOARD_X_AXIS_MAX_SPEED,
MOTHERBOARD_X_AXIS_MIN_POSITION,
MOTHERBOARD_X_AXIS_MAX_POSITION,
}; | {
"domain": "codereview.stackexchange",
"id": 45044,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, object-oriented, classes, embedded, namespaces",
"url": null
} |
quantum-field-theory, field-theory, conventions, commutator
$$ \phi(\vec{x},t) \equiv \phi(x) = \int \frac{d^3 p}{(2\pi)^3} \frac{1}{\sqrt{2E_{\vec{p}}}} \big(a_{\vec{p}}e^{-ip\cdot x} + a^{\dagger}_{\vec{p}}e^{+ip\cdot x}) \ \ . \tag{1}
$$
Hopefully this alone clears up some confusion.
Similarly, the commutation relations I believe you mean are the coordinate space commutation relations,
$$ \tag{2}
\big[\phi(\vec{x}), \pi(\vec{y}) \big] = i \delta^{(3)}(\vec{x}-\vec{y}) \ ,
$$
which is completely equivalent to the harmonic oscillator relations
$$ \tag{3}
\big[a_{\vec{p}},a^{\dagger}_{\vec{q}}\big] = (2 \pi)^3 \delta^{(3)}(\vec{p}-\vec{q}) \ .
$$
(I assume you now know the form of the time-independent fields $\phi(\vec{x})$ and $\pi(\vec{y})$, and so this calculation is straight forward.)
You can also use equation (1) and the corresponding conjugate momenta (so we're working with four-vectors now) along with the equal-time commutation relations (where $t$ is fixed) to also derive (2) and (3),
$$ \tag{4} | {
"domain": "physics.stackexchange",
"id": 76577,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-field-theory, field-theory, conventions, commutator",
"url": null
} |
magnetic-fields, classical-electrodynamics, magnetic-moment
Title: Magnetic dipole and magnetic moment I don't quite understand the meaning of these terms. My physics book just gives the mathematical definition of magnetic moment as $\mu=Ia$, which means nothing to me. I know it has to do with torque. Also, I don't quite understand what a magnetic dipole is. Is it a loop that experiences torque due to a magnetic field? Can anyone help clarify these terms? Thanks. The magnetic moment, in general, is an indication of the torque that will be experienced by an object when subjected to a magnetic field. $\mu = I\cdot A$ implies that it scales with the area (of a current loop) and the magnitude of the current. You can easily convince yourself that this is so by drawing a simple rectangular current loop, with an axis of rotation running parallel to two of the wires of the rectangle. If you make the rectangle wider, the force on the wires is the same but the torque increases (arm is greater); if you make the wires longer, the force increases but the | {
"domain": "physics.stackexchange",
"id": 16892,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "magnetic-fields, classical-electrodynamics, magnetic-moment",
"url": null
} |
On the other hand, taking expectations gives $$E(S_n)={1\over 2}+{1\over 2^2}+{1\over 2^3}+\cdots +{1\over 2^n},$$ so $\lim_n E(S_n)=1.$ Now by Fatou's lemma, $$E(S_\infty)\leq \liminf_n E(S_n)=1,$$ so that $S_\infty$ has finite expectation and so is finite almost surely. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.984336353585837,
"lm_q1q2_score": 0.8717592496163536,
"lm_q2_score": 0.8856314677809303,
"openwebmath_perplexity": 172.99879103955675,
"openwebmath_score": 0.927476704120636,
"tags": null,
"url": "https://math.stackexchange.com/questions/2130264/sum-of-random-decreasing-numbers-between-0-and-1-does-it-converge/2130701"
} |
reaction-mechanism, electrochemistry
Title: Why is the cathode reaction required in a fuel cell? So, at the anode of a fuel cell hydrogen is split into a positively charged proton and an electron. Then, there is the membrane which can let only protons through to the cathode, whereas electrons need to follow external circuit (effectively powering it).
Question: why do we need any other reaction on the cathode? Isn't the fact that positively charged ions travel through the membrane to the cathode enough to create the EMF?
Trying to solve it I assume that the reaction is there to actually apply some kind of force to move the ions though the membrane to the cathode, otherwise they'd just stay and reunite with electrons on the anode. What is that force and how does it work?
Why do we need two half reactions, one at the anode and another at the cathode? | {
"domain": "chemistry.stackexchange",
"id": 3948,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "reaction-mechanism, electrochemistry",
"url": null
} |
optics, visible-light, wavelength
I know that there is some way to see them and the scientists who discover this.
Beyond light microscopes, scientists developed the electron microscope and later the scanning tunneling microscope. The principles of these devices are explained at those links.
The 1986 Nobel prize for Physics was shared between three people for their work on these inventions. Another man, Hans Busch, had made a major contribution to the design of the electron microscope but died in 1984 and the Nobel Prize is never awarded posthumously, so even if the committee had thought it appropriate to award him, the rules would have forbidden it. | {
"domain": "physics.stackexchange",
"id": 40977,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, visible-light, wavelength",
"url": null
} |
pentagon is axially symmetric to the median lines. A regular pentagon has all of the sides and angles are equal. Determine the value of x for a triangle whose side lengths are, (x + 20) cm, (4x – 5) cm, (2x + … You can test out of the {{courseNav.course.mDynamicIntFields.lessonCount}} lessons In this case, 9 + 9 + 9 + 9 + 9 = ? You'll also discover how to tell the difference between a regular and an irregular pentagon. - Definition & Examples, Quiz & Worksheet - Questions on The Odyssey Book 9, Quiz & Worksheet - Conflict Between Antigone & Creon in Sophocles' Antigone, Quiz & Worksheet - The Canterbury Tales Narrative Framework, Quiz & Worksheet - Sanaubar in The Kite Runner, Flashcards - Real Estate Marketing Basics, Flashcards - Promotional Marketing in Real Estate, Special Education in Schools | History & Law, ILTS Science - Environmental Science (112): Test Practice and Study Guide, Comprehensive English: Overview & Practice, 12th Grade English: Homework Help Resource, NY Regents | {
"domain": "incentcorewards.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429580381724,
"lm_q1q2_score": 0.8358131626441144,
"lm_q2_score": 0.8499711680567799,
"openwebmath_perplexity": 903.6623644598337,
"openwebmath_score": 0.40327781438827515,
"tags": null,
"url": "http://employees.incentcorewards.com/tgfqwj/perimeter-of-pentagon-with-different-sides"
} |
ros, python, moveit, ros-melodic, motionplanning
Originally posted by cambel07 on ROS Answers with karma: 92 on 2021-06-06
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 36497,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, python, moveit, ros-melodic, motionplanning",
"url": null
} |
Joined: May 2016
From: USA
Posts: 1,210
Thanks: 498
Quote:
Originally Posted by Atrend Hello everybody, I am currently revising some math out of pure interest. I found some interesting books, unfortunately not always with solutions to the problems. A problem I am stuck with is the following: "Proof that the polynomial n^3 + (n+1)^3 + (n+2)^2 is divisible by 9". I do not know if there is a general test for this one. My approach would be the try to work out this polynomial as far as possible and try to get a factor 9 out with the distributive property. I always arrive at 3n^3 + 9n^2 + 27n + 9; seeming to prove that it is divisible by 3,but not by 9. It would seem something is off with the coefficient of n^3. Could anyone provide me some insight in this problem of offer another approach please? Thanks in advance!
Suppose n = 3.
Then $n^3 = 3^3 = 27, \ (n + 1)^3 = 4^3 = 64, \text { and } (n + 2)^2 = 5^2 = 25 \implies$
$n^3 + (n + 1)^3 + (n + 2)^2 = 27 + 64 + 25 = 116.$ | {
"domain": "mymathforum.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446456243804,
"lm_q1q2_score": 0.8314075779319353,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 499.736514665502,
"openwebmath_score": 0.6418716907501221,
"tags": null,
"url": "http://mymathforum.com/algebra/345041-test-divisibility-polynomials.html"
} |
java, object-oriented, interview-questions
return printInfo();
}
/**
* Adds a goal to the game.
* @param int minutes, String team, String player
* @return String message
*/
@Override
public String score(int minutes, String team, String player) {
if (state == State.END) {
return "No game currently in progress";
}
state = State.PLAYING;
if(this.awayTeam.equals(team)) {
awayScore++;
goalAwayTeam.put(minutes, player);
}
if(this.homeTeam.equals(team)) {
homeScore++;
goalHomeTeam.put(minutes, player);
}
return "Goal!!!\n" + printInfo();
}
/**
* Finish the game.
* @return String message
*/
@Override
public String end() {
if(state == State.END) {
return "No game currently in progress";
}
String info = printInfo();
state = State.END;
reset(); | {
"domain": "codereview.stackexchange",
"id": 19501,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, interview-questions",
"url": null
} |
mathematics, unitarity, hadamard
Title: Finding a global phase that transform the Hadamard gate to an element of $SU(2)$ and propose an evolution operator which implements the operation I was looking back over an old assignment and I came across a question I wasn't quite sure how to do the problem statement is as follows:
The Hadamard rotation is an element of the group $U(2)$.
(i) Find the global phase with which one needs to multiply the Hadamard gate to obtain an operation that is an element of the group $SU(2)$, and
(ii) propose the evolution operator that implements this operation, that is, propose the suitable Hamiltonian and the duration for which it needs to be turned on.
For (i) I think the answer was either due to this statement | {
"domain": "quantumcomputing.stackexchange",
"id": 881,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "mathematics, unitarity, hadamard",
"url": null
} |
molecular-biology, homework
The most common reason we still use all these methods are because different levels of purity and different raw materials show up in different contexts.
In the case where the protein has never been isolated before or you have a sample (like a cell sample rich in a particular protein) then salt and sizing columns are very useful. Salt precipitation is useful when you have a lot of sample and you need to make some rough cuts. Even if the gene is well characterized, it may depend on expression in its native organ.
I've prepped protein using ammonium sulfate precipitation from homogenized whole tissue for instance. That's great - the result got rid of well over 90% of the material, but the outcome has hundreds of bands on the gel. In this case an affinity column was used next; immobilized conconavalin A would bind to the glycosides on the target product. If I had put the whole tissue homogenate I would have destroyed the affinity column by stuffing it full of meaty gunk. | {
"domain": "biology.stackexchange",
"id": 6399,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "molecular-biology, homework",
"url": null
} |
quantum-gate, gate-synthesis, solovay-kitaev-algorithm
The gate set is:
$$
\left\{ H, X, Y, Z, R_\phi, S, T, R_x, R_y, R_z, \text{CX}, \text{SWAP}, \text{iSWAP}, \sqrt{\text{SWAP}} \right\}
$$
with $R_\phi, \text{SWAP}, \sqrt{\text{SWAP}}$ as described in Wikipédia, $R_A$ the rotation with respect to the axe $A$ ($A$ is either $X$, $Y$ or $Z$) and
$$\text{iSWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\
0 & 0 & i & 0 \\
0 & i & 0 & 0 \\
0 & 0 & 0 & 1 \\ \end{pmatrix}$$. | {
"domain": "quantumcomputing.stackexchange",
"id": 525,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-gate, gate-synthesis, solovay-kitaev-algorithm",
"url": null
} |
This is the equation of a circle with center at A with radius of L. At the minimum distance this circle will be tangent to the parabola.
3. What happens when $a=\tfrac{1}{2}$ and when $a<\tfrac{1}{2}$?
When $a=\tfrac{1}{2}$, the three zeroes are the same. The circle is tangent to the parabola at the origin and a is the minimum distance.
When $a<\tfrac{1}{2}$, the circle does not intersect the parabola. Notice that in this case two of the roots of $\frac{dL}{dt}=0$ are not Real numbers.
4. Consider the distance, L(x), from point A to the parabola. As x moves from left to right describe how this length changes. Be specific. Sketch the graph of this distance y = L(x). Where are its (local) maximum and minimum values, relative to the parabola and the circle tangent to the parabola? | {
"domain": "teachingcalculus.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474872757474,
"lm_q1q2_score": 0.8389347672408087,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 482.87538585715174,
"openwebmath_score": 0.6201876401901245,
"tags": null,
"url": "https://teachingcalculus.com/tag/favorite/"
} |
general-relativity, cosmology, units, singularities
$\rho \ge |p|,$
where $\rho$ is the energy density, and $p$ is the pressure. | {
"domain": "physics.stackexchange",
"id": 38770,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "general-relativity, cosmology, units, singularities",
"url": null
} |
civil-engineering, bridges, corrosion
Coatings
Generally speaking coatings are designed for a given service life. Provided that they are applied with adequate workmanship and quality, for a given material in a given environment the performance is fairly predictable; ie they will lose their protective capability over time due to oxidation, temperature, solar radiation and abrasion effects. Many designs are geared towards a certain loss in terms of mils/yr, so that for a 10 year service interval there will be a certain dry film thickness of coating specified. NASA Kennedy Space Center has detailed documentation on these issues. Once this protective measure is breached then corrosion of the underlying steel may take place. So it is important that coatings are renewed at regular intervals.
Structural Steel | {
"domain": "engineering.stackexchange",
"id": 487,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "civil-engineering, bridges, corrosion",
"url": null
} |
c#, linq
public string Description { get; set; }
}
internal class CounterPartRanking
{
public int Rank { get; set; }
public Counterpart CounterPart { get; set; }
}
public static class CounterpartExtensions
{
public static IEnumerable<Counterpart> SearchWithRank(this IEnumerable<Counterpart> source, string pattern)
{
var items1 = source.Where(x => x.Code == pattern);
var items2 = source.Where(x => x.Code.StartsWith(pattern));
var items3 = source.Where(x => x.Code.Contains(pattern));
var items4 = source.Where(x => x.Description.Contains(pattern));
var items5 = source.Where(x => x.Aliases != null && x.Aliases.Any(y => y.Description == pattern));
var items6 = source.Where(x => x.Aliases != null && x.Aliases.Any(y => y.Description.StartsWith(pattern)));
var items7 = source.Where(x => x.Aliases != null && x.Aliases.Any(y => y.Description.Contains(pattern))); | {
"domain": "codereview.stackexchange",
"id": 14943,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c#, linq",
"url": null
} |
c++, linked-list, reinventing-the-wheel, c++14, inheritance
/* Mergesort function in the base class calls this function, which calls whichever merge_helper function was
compiled using SFINAE. */
template<typename ValueType>
void DLinkedList<ValueType>::merge(std::unique_ptr<node_type>& left_owner, node_type* right_raw, size_type right_size)
{
merge_helper(left_owner, right_raw, right_size);
}
/* Helper function that merges two sublists completely in-place. */
template<typename ValueType>
template<typename T, std::enable_if_t<supports_less_than<T>::value, int>>
void DLinkedList<ValueType>::merge_helper(std::unique_ptr<node_type>& left_owner, node_type* right_raw, size_type right_size)
{
auto left_raw = left_owner.get(); | {
"domain": "codereview.stackexchange",
"id": 31903,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, linked-list, reinventing-the-wheel, c++14, inheritance",
"url": null
} |
acid-base, nomenclature, coordination-compounds
The structure of dihydronium
[catena-bis(μ-pyrazine-2,3-dicarboxylato-N,O,O′)zinc(II)],
$\ce{(H3O)2[Zn(2,3PZDC)2]}$, is composed of polyanionic ribbons of
zinc(II) ions linked by double bridging 2,3-PZDC ligand molecules.
Each ligand uses an N,O bonding moiety formed by one carboxylic group
[$\ce{Zn–O}$ 2.071(2) Å; $\ce{Zn–N}$ 2.184(2) Å] and a monodentate oxygen atom of
the other carboxylate group [$\ce{Zn–O}$ 2.092(2) Å]. Coordination around the
zinc(II) ion is strongly distorted octahedral. Hydronium cations
$\ce{H3O+}$ link the ribbons by hydrogen bonds.
References | {
"domain": "chemistry.stackexchange",
"id": 12639,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, nomenclature, coordination-compounds",
"url": null
} |
linear-chirp
Now y contains our 120 Hz sinusoid sampled at 44.1kHz.
Notice here that phase (p) is a "straight line" that grows at a constant rate of $\frac{2 \pi f}{Fs}$.
When the oscillator is "chirping", the rate of change of the phase is variable. For example:
Fs = 44100; % Sampling frequency in Hz
T = 1; % Total duration of the signal in seconds
f0 = 1; % Start chirp at
f1 = 120; % end chirp at (Better keep f1>f0)
t = 0:(1./Fs):(T - (1./Fs)); % Time vector
p = 2.0 .* pi .* t; %Phase vector
y = sin(f0.*p + 2.*pi.*(((f1-f0)/(2.*T)).*t.^2));
Now, this looks like:
And the rate of change of the phase of the $\sin$ is:
Now, from the first example, the phase "step" is f.*p(2)-f.*p(1) == 0.017097 and from the second example, after doing:
s = diff(f0.*p + 2.*pi.*(((f1-f0)/(2.*T)).*t.^2)); % Get the first derivative of phase to find the **rate of change**. | {
"domain": "dsp.stackexchange",
"id": 7443,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "linear-chirp",
"url": null
} |
homework-and-exercises, kinematics, acceleration, velocity, distance
So our new formula, let's call it $d(t)$ can be derived by simplifying $s(t)-s(t-1)$ which equals $at+u-\frac a2$.
If we factor $\frac 12a$ we get $u+\frac 12a(2t-1)$ which is what you have.
Now knowing how this equation works, let's try reason how $d(0)$ could operate and why it makes no sense, hence unreasonable to use practically.
Mathematically, you can't have $s(0)-s(-1)$, it just doesn't make sense, you can't have negative time.
Logically, before the object has even started moving, is it fair to ask how much it has traveled in this second? We know how this equation works, so we can reasonably say we cannot rely on it to calculate the distance traveled at the 0th second. | {
"domain": "physics.stackexchange",
"id": 63355,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, kinematics, acceleration, velocity, distance",
"url": null
} |
programming-challenge, haskell, functional-programming
and won't need to carry a parameter into the recursive calls. And of course this can be written in terms of foldr:
listToMultiMap = foldr foo M.empty where
foo (k0, v0) m = case M.lookup k0 m of
Nothing -> M.insert k0 [v0] m
Just v0s -> M.insert k0 (v0:v0s) m
And we could reduce the duplication in the last two lines there, but then again this whole thing is already handled by Data.Maps fromListWith.
import System.IO (readLn, getLine)
import Control.Monad (replicateM)
import qualified Data.Map.Strict as M
import Data.Bool (bool)
noDuplicates :: Ord a => [a] -> Bool
noDuplicates = all (==1) . M.fromListWith (+) . map (,1)
-- = all ((==1) . length) . M.fromListWith (++) . map (,["Why are you looking at the ordinate?"])
-- = and . M.fromListWith (\_ _ -> False) . map (,True) | {
"domain": "codereview.stackexchange",
"id": 19312,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "programming-challenge, haskell, functional-programming",
"url": null
} |
python, python-2.x, django
def __unicode__(self):
return self As Django code, this seems quite well done and straightforward. The biggest problem I see is with naming.
The Person model is a hodgepodge of unrelated fields. A few fields describe a person, a few other fields seem to be related to the survey, but the vast majority of fields are completely generic, like slider_seven_value.
It looks as if you want to reuse the same model for multiple unrelated future surveys. You will end up with a very dirty database, that is only usable with external documentation explaining which field is what, depending on the survey. I suggest to not speculate ahead, and plan a model dedicated to your current survey, and when you need another one, plan a different model. You will have one table per survey, with intuitive column names, and overall less problems and confusion. | {
"domain": "codereview.stackexchange",
"id": 14153,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, python-2.x, django",
"url": null
} |
catkin, ros-hydro, ubuntu, ubuntu-precise, linking
Original comments
Comment by ajr_ on 2014-02-11:
I updated my question and it seems I do not have the correct library name which to use for linking?
Comment by joq on 2014-02-11:
Leave off the lib prefix. You probably want -lserial, so put serial in your target_link_libraries(), as @ahendrix suggested.
Comment by ajr_ on 2014-02-11:
ok this works, although there is another error now but its not related to this question anymore.
Comment by ajr_ on 2014-02-11:
the new problem is this error, not sure if its still related to linking:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference to main'
Comment by ahendrix on 2014-02-11:
That sounds like a new question.
Comment by ajr_ on 2014-02-11:
Ok, actually missing the main function & node. Beginners mistake... This problem is solved, thanks to all for the help! | {
"domain": "robotics.stackexchange",
"id": 16932,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "catkin, ros-hydro, ubuntu, ubuntu-precise, linking",
"url": null
} |
fft, phase, frequency-response
Title: Calculating phase response of filter with latency I have an LTI filter that I want to treat like a black box. It has a latency of 24 samples.
This is what I'm doing (which works for a filter with no latency):
Send unit impulse through my filter
Capture first 16,384 samples output
Perform FFT
For each of first 8192 complex values, take phase
Doing the above gives the red line shown below.
If I replace step 2 with:
Skip first 24 samples and then capture first 16,384 samples output | {
"domain": "dsp.stackexchange",
"id": 4051,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft, phase, frequency-response",
"url": null
} |
string-theory, group-theory, lie-algebra, compactification
Hence the compactification of the bosonic string theory, which was done in order to give a consistent way to combine it with a superstring theory and so form heterotic string theory, has given rise in the case of one of the heterotic string theories to a theory with an exceptional group (actually two of them, $E_8 \times E_8$) as a symmetry group. This is one sense in which heterotic string compactification gives rise to exceptional groups.
Second sense: | {
"domain": "physics.stackexchange",
"id": 37666,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "string-theory, group-theory, lie-algebra, compactification",
"url": null
} |
telescope, mars, newtonian-telescope
https://www.skyandtelescope.com/astronomy-resources/how-to-align-your-newtonian-reflector-telescope/
Some info about the importance of collimation:
http://www.astrophoto.fr/collim.html
Regarding laser collimators, which are very popular: A laser collimator is very quick and can be very good, but provided the laser itself is perfectly centered. Plug the laser into the focuser, watch the laser spot on the primary mirror, and slowly turn the laser like a knob - if the spot moves in a circle as you turn the laser, then it's not centered. Some lasers can be adjusted until they are centered (2 or 3 adjustment screws on the barrel), others can't. A laser that's not centered will not provide good collimation for your telescope.
There are many other collimation techniques, keep learning. | {
"domain": "astronomy.stackexchange",
"id": 3290,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "telescope, mars, newtonian-telescope",
"url": null
} |
python, performance, python-3.x, traveling-salesman
If the inner for loop completes ordinarily (no breaks), then it goes into the else block of the for loop. A slightly strange construct, but for this purpose ideal, as we then can compare the minimum distance versus the current route distance
The distance.clear() is used to reset the memoisation between test run done using timeit in IPython. Memory profiling was done using a module name memory_profiler.
Here are some of the timing results I got:
In [325]: %timeit main_org_str(9) # Your original code
1 loops, best of 3: 529 ms per loop
In [326]: %timeit main_org(9) # Using int as keys
1 loops, best of 3: 304 ms per loop
In [327]: %timeit main_holroy_v2(9)
1 loops, best of 3: 420 ms per loop
In [328]: %timeit main_superbiasedman(9)
1 loops, best of 3: 362 ms per loop
In [330]: %timeit main_minimum3(9)
10 loops, best of 3: 146 ms per loop
In [330]: %timeit main_minimum3(9) # After removing `**0.5`
10 loops, best of 3: 116 ms per loop | {
"domain": "codereview.stackexchange",
"id": 16667,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-3.x, traveling-salesman",
"url": null
} |
Hint: If you get no six, you don't get exactly one six, or exactly two, or exactly three, and so on.
Similarly, if you get exactly one six, you don't get nonte, nor exactly two, and so on.
If you have several possibilities which exclude each other (i.e. if one of then occurs, none of the other has occurred), then the probability of getting any of those possibilities is just the sum of the probabilities of the individual probabilities.
"No more than 10" is "None, or one, or …, or 8, or 9, or 10".
"At least 10" is "more than 9", which is the opposite of "not more than none".
Since you already know how to calculate the probability of "Exactly $k$ sixes", those hints should enable you to solve the other questions.
-
Hint: Your formula can be generalized to exactly $k$ sixes with $$\binom{50}{k}\left(\frac16\right)^k\left(\frac56\right)^{50-k}\tag{1}$$ where $$\binom{n}{k}=\frac{n!}{k!\,(n-k)!}\tag{2}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347875615794,
"lm_q1q2_score": 0.8262892787501197,
"lm_q2_score": 0.8479677545357568,
"openwebmath_perplexity": 862.7632073583825,
"openwebmath_score": 0.8587895035743713,
"tags": null,
"url": "http://math.stackexchange.com/questions/185241/probability-of-rolling-sixes-in-50-rolls-of-a-fair-die"
} |
java
+ reset0s;
} else {
indInChars = chars.indexOf(newPass.charAt(lastInd)) + 1;
newPass = newPass.substring(0, lastInd) + chars.charAt(indInChars);
}
System.out.println(newPass);
}
}
if (newPass.equals(password)) {
break;
}
}
}
} | {
"domain": "codereview.stackexchange",
"id": 17487,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java",
"url": null
} |
haskell, assembly, brainfuck, compiler
Grouping equal elements (+++ is represented as Add 3)
Reducing excluding operators (+++-- is represented as Add 1)
Turning [-] and [+] into BfConst 0
optimiseBf does exactly that (excluding the last point, this is done by reduceConsts).
optimiseBf :: BfSource -> BfSource
optimiseBf (BfSource bs) =
if bs /= obs
then optimiseBf (BfSource obs)
else BfSource obs
where
obs = opthelper bs
opthelper :: [BfCommand] -> [BfCommand]
opthelper [] = []
opthelper [x] = [x]
opthelper (x:y:xs) =
let r = reduceBf x y
single = fromOne r
(s1, s2) = fromTwo r
in case r of
Zero -> opthelper xs
(One _) -> single : opthelper xs
(Two _ _) -> s1 : opthelper (s2 : xs)
This function groups and throws out excluding instructions. Doing it with this if
if bs /= obs
then optimiseBf (BfSource obs)
else BfSource obs | {
"domain": "codereview.stackexchange",
"id": 33485,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "haskell, assembly, brainfuck, compiler",
"url": null
} |
More Calculus Lessons. CALCULUS 250: REVIEW OF OUR TOOLS: Rule for derivatives: Rule for anti-derivatives: Power Rule: Anti-power rule: Constant-multiple Rule: Anti-constant-multiple rule: Sum Rule: Anti-sum rule: Product Rule: Anti-product rule Integration by parts: Quotient Rule: Anti-quotient rule: Chain Rule: Anti-chain rule Integration by substitution: e x Rule: e x Anti-rule: Log Rule: Log Anti-rule. Check out our Practically Cheating Calculus Handbook, which gives you hundreds of easy-to-follow answers in an e-book or paperback. What is a Derivative? How to use the Definition of the Derivative. Arrows indicate existence of second derivatives. f(x+ x) f(x) x : (1) Integral calculus that we are beginning to learn now is called integral calculus. Limit Rules example lim x!3 x2 9 x 3 =? rst try \limit of ratio = ratio of limits rule", lim x!3 x2 29 x 3 = lim x!3 x 9 lim x!3 x 3 0 0 0 0 is called an indeterminant form. Nathan Wakefield, Christine Kelley, Marla Williams, Michelle | {
"domain": "ligk.pw",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9888419694095655,
"lm_q1q2_score": 0.8130151190524637,
"lm_q2_score": 0.8221891305219504,
"openwebmath_perplexity": 1142.8774547378664,
"openwebmath_score": 0.6045947074890137,
"tags": null,
"url": "http://pvmf.ligk.pw/precalculus-rules.html"
} |
deep-learning, tensorflow
the original YOLO model trained in 160 epochs
the ResNet model can be trained in 35 epoch
fully-conneted DenseNet model trained in 300 epochs
The number of epochs you require will depend on the size of your model and the variation in your dataset.
The size of your model can be a rough proxy for the complexity that it is able to express (or learn). So a huge model can represent produce more nuanced models for datasets with higher diversity in the data, however would probably take longer to train i.e. more epochs.
Whilst training, I would recommend plotting the training and validation loss and keeping an eye on how they progress over epochs and also in relation to one another. You should of course expect both values to decrease, but you need to stop training once the lines start diverging - meaning that you are over-fitting to your specific dataset.
That is likely to happen if you train a large CNN for many epochs, and the graph could look something like this:
Image source | {
"domain": "datascience.stackexchange",
"id": 4689,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, tensorflow",
"url": null
} |
python, calculator, tkinter
def square_root():
Label(main, text = "%f"%(math.sqrt(string[0]))).grid(row = 0, column = 3)
def enter():
global x
if x == 'add':
answer = Entry(main)
answer.grid(row = 0, column = 3, columnspan = 30)
answer.insert(0, "%f"%(string[0] + string[1]))
#Label(main, text = "%f"%(string[0] + string[1])).grid(row = 0, column = 3)
#tkMessageBox.showinfo( "The Answer Is:", "%d"%(string[0] + string[1]))
elif x == 'sub':
# Label(main, text = "The answer is: %d"%(string[0] - string[1])).pack()
# tkMessageBox.showinfo( "The Answer Is:", "%d"%(string[0] - string[1]))
# Label(main, text = "%f"%(string[0] - string[1])).grid(row = 0, column = 3)
answer = Entry(main)
answer.grid(row = 0, column = 3, columnspan = 30)
answer.insert(0, "%f"%(string[0] - string[1]))
elif x == 'mul': | {
"domain": "codereview.stackexchange",
"id": 14460,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, calculator, tkinter",
"url": null
} |
81 16 27 8 9 4 3 2 (Total 4 marks) 3. Practice Placement Test (Arithmetic/Pre- Algebra). Volatility Drag: How Variance Drains Arithmetic Investment Returns. Each of these sequences are said to be an arithmetic sequence or arithmetic. Why Verbal Reasoning Arithmetic Reasoning? In this section you can learn and practice Verbal Reasoning Questions based on "Arithmetic Reasoning" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc. Nelson Education > School > Mathematics > Functions 11 > Web Links > Chapter 7 : Functions 11 Chapter 7: Discrete Functions: Sequences and Series. Georgia Assessments for the Certification of Educators ® (GACE®) Program Admission Assessment – Test II Mathematics Khan Academy Instructional Support Videos and Exercises The Georgia Assessments for the Certification of Educators ® (GACE ®) program has identified videos and exercises available at. Summarize | {
"domain": "ecui.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.985042916041382,
"lm_q1q2_score": 0.820860487336424,
"lm_q2_score": 0.8333245932423308,
"openwebmath_perplexity": 701.0967153701463,
"openwebmath_score": 0.4918925166130066,
"tags": null,
"url": "http://wjuy.ecui.pw/arithmetic-and-geometric-sequences-test-pdf.html"
} |
z2. For example, you might be studying an object with cylindrical symmetry: uid ow in a pipe, heat ow in a metal rod, or light propagated through a cylindrical optical ber. The relationships between (x;y) and (r; ) are exactly the same as in polar coordinates, and the zcoordinate is unchanged. Using Cartesian coordinates on the plane, the distance between two points (x 1, y 1) and (x 2, y 2) is defined by the formula, which can be viewed as a version of the Pythagorean Theorem. Current Location > Math Formulas > Linear Algebra > Transform from Cartesian to Cylindrical Coordinate Transform from Cartesian to Cylindrical Coordinate Don't forget to try our free app - Agile Log , which helps you track your time spent on various projects and tasks, :) The "magnitude" of a vector, whether in spherical/ cartesian or cylindrical coordinates, is the same. In cylindrical coordinates, (r; ;z), the continuity equation for an incompressible uid is 1 r @ @r (ru r) + 1 r @ @ (u ) + @u z @z = 0 In | {
"domain": "sramble-communication.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9914225158534695,
"lm_q1q2_score": 0.8682749313616078,
"lm_q2_score": 0.8757869803008764,
"openwebmath_perplexity": 535.9419383625223,
"openwebmath_score": 0.931949257850647,
"tags": null,
"url": "http://angs-diasporanew.sramble-communication.com/apdsmyht/cartesian-to-cylindrical-coordinates.php"
} |
c++, performance, strings, c++11, parsing
I would have done:
string get_between_brackets(string::iterator& tail_, const string::iterator& end_)
template<typename I>
std::string get_between_brackets(I tail_, I end_)
That's a great comment.
brackets_content.reserve(248); //cannot be longer than that
But i don't see that being enforced anywhere.
This switch is broken:
switch(chr)
{
case '(': ++br_cnt; break;
case ')': --br_cnt; break;
}
Any character that does not match ')' or '(' leads to undefined behavior. You should must have a default option.
You throw if there is not enough charaters to hold two braces.
else throw std::invalid_argument("brackets tail is not long enough"); | {
"domain": "codereview.stackexchange",
"id": 19637,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, performance, strings, c++11, parsing",
"url": null
} |
This fails in non-UFD domains, e.g. there are very simple quadratic integer counterexamples:
$\rm\ \ x^2\! = (1\!+\!\sqrt{d})^2\!\in \Bbb Z[2\sqrt{d}]\$ has root $\rm\ x = 1\!+\!\sqrt{d} = \dfrac{2\!+\!2\sqrt{d}}2\:$ a proper fraction over $\rm\:\Bbb Z[2\sqrt{d}]$
Remark $\$ Rings satisfying the monic case of the Rational Root Test are called integrally closed. Thus the remark above translates as: the usual proof of RRT immediately generalizes to show that UFDs and GCD domains are integrally closed.
- | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9811668731384179,
"lm_q1q2_score": 0.854201202901308,
"lm_q2_score": 0.8705972717658209,
"openwebmath_perplexity": 110.03046908786571,
"openwebmath_score": 0.9526710510253906,
"tags": null,
"url": "http://math.stackexchange.com/questions/264964/perfect-square-in-an-ufd"
} |
planets
Title: Solid surface of the gas giants Given the gravities of gas giants and other similar celestial obejcts, I find it hard to believe that their centers aren't crushed to solid states.
If the gas giants and other similar objects have a solid core.
Why isn't that considered a solid surface for the planet?
Why aren't these then just planets with a very thick atmosphere. I don't think we know for sure that they do have solid cores. It would seem likely, but even the center of the Earth is guesswork, let alone gas giants. But a distinguishing feature would be that a majority of the mass of the planet exists in gas form (esp. large amounts of hydrogen and helium) | {
"domain": "physics.stackexchange",
"id": 93138,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "planets",
"url": null
} |
scikit-learn, decision-trees, ensemble-modeling
has smaller importance than those classifier incorrectly. The consequence is that the model enriches it's complexity, it's ability to reproduce more complex surfaces. This is translated in the fact that it reduces the bias, since it can go closer to data. A similar intuition is behind: if the classifier has already a low bias, what will happen when I boost it? Probably a much unbearable overfit, that's all. | {
"domain": "datascience.stackexchange",
"id": 611,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "scikit-learn, decision-trees, ensemble-modeling",
"url": null
} |
4. Originally Posted by ThePerfectHacker
Here is a related proof: $a^{p-1} \equiv 1 \implies a^{p-1} - 1\equiv 0 \implies \left( a^{(p-1)/2} - 1\right)\left( a^{(p-1)/2}+1\right) \equiv 0 (\bmod p)$.
From here we see $a^{(p-1)/2}\equiv \pm 1(\bmod p)$.
And why is this last implication correct? This is because $\mathbb{Z}_p$ is a field (and hence an integral domain). Or because of the other elementary argument I gave about divisibility. | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9926541723389503,
"lm_q1q2_score": 0.8021312956516852,
"lm_q2_score": 0.8080672181749422,
"openwebmath_perplexity": 175.3563783255364,
"openwebmath_score": 0.8967263102531433,
"tags": null,
"url": "http://mathhelpforum.com/number-theory/55993-fermat-s-little-theorem-help-again.html"
} |
javascript, project-euler, node.js, primes
function generate(length) {
var max = length;
for (var u = 1; u <= max; u++) {
if (max === 1) {
push([u]);
}
for (var i = 1; i <= max; i++) {
if (i === u || max < 2) {
continue;
}
if (max === 2) {
push([u, i]);
}
for (var o = 1; o <= max; o++) {
if (o === i || o === u || max < 3) {
continue;
}
if (max === 3) {
push([u, i, o]);
}
for (var p = 1; p <= max; p++) {
if (p === i || p === o || p === u || max < 4) {
continue;
}
if (max === 4) {
push([u, i, o, p]);
}
for (var a = 1; a <= max; a++) {
if (a === i || a === o || a === p || a === u || max < 5) {
continue;
}
if (max === 5) { | {
"domain": "codereview.stackexchange",
"id": 5981,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, project-euler, node.js, primes",
"url": null
} |
forces, rotational-dynamics, reference-frames, torque
References:
Equation of a line in space Another Answer
I realized I did not answer the question directly. The question of if I know the torque from forces on a system summed up at a point, does this torque represent also the torque about a line passing through the point.
The quick answer is not unless the line is parallel to the net force applied to the system. The proof is in the torque transformation equation from one point to another $$ \vec{\tau}_B = \vec{\tau}_A + \vec{F} \times \vec{r}_{AB} $$
The two torques are equal only if $\vec{F} \times \vec{r}_{AB} = \vec{0}$, or the displacement vector is parallel to the net force. | {
"domain": "physics.stackexchange",
"id": 71879,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "forces, rotational-dynamics, reference-frames, torque",
"url": null
} |
quantum-mechanics, operators, heisenberg-uncertainty-principle, error-analysis, quantum-measurements
\end{align*}
As $\hat{F}$ is hermitian, $(\hat{F} - \langle\hat{F}\rangle)$ is also hermitian.
\begin{align*}
0
&= \int_{\mathbb{R}^3} \psi^{*} (\hat{F} - \langle\hat{F}\rangle)^{\dagger} (\hat{F} - \langle\hat{F}\rangle) \psi \,d^3\mathbf{r} \\
&= \int_{\mathbb{R}^3} (\hat{F} - \langle\hat{F}\rangle) \psi (\hat{F} - \langle\hat{F}\rangle)^{*} \psi^{*} \,d^3\mathbf{r} \\
\end{align*}
Defining $\phi = (\hat{F} - \langle\hat{F}\rangle)\psi$.
\begin{align*}
0
&= \int_{\mathbb{R}^3} \phi \phi^{*} \,d^3\mathbf{r} \\
&= \int_{\mathbb{R}^3} |\phi|^2 \,d^3\mathbf{r} \\
\end{align*}
Which implies (execpt from $\phi$ being a function equal to $0 \,\forall x\neq x_0$, but I've already said what happens in that case)
\begin{align*}
0 &= |\phi|^2 \\
0 &= \phi \\
0 &= (\hat{F} - \langle\hat{F}\rangle)\psi \\
\hat{F} \psi &= \langle \hat{F} \rangle \psi | {
"domain": "physics.stackexchange",
"id": 75948,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, heisenberg-uncertainty-principle, error-analysis, quantum-measurements",
"url": null
} |
ros-kinetic
4 - following this question basically rospy.spin() is a while not rospy.shutdown(), so when I asked my code get bugged most because I did such thing as:
while not rospy.shutdown():
....
rospy.spin() | {
"domain": "robotics.stackexchange",
"id": 32717,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros-kinetic",
"url": null
} |
java, beginner, game
if(e.getKeyCode() == KeyEvent.VK_RIGHT){
padSpeed = initialPadSpeed;
}
}
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
padSpeed = 0;
}
if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
padSpeed = 0;
}
}
}
Ball class:
package game;
public class Ball extends Pad{
//Variables that define the ball.
private int ballX, ballY;
private int initialBallSpeedVertical = 2;
private int initialBallSpeedHorizontal = 2;
private int ballSpeedVertical, ballSpeedHorizontal;
private int ballDiameter = 10;
//Constructor that has pad position coordinates as parameters, so the ball will be created on the pad.
public Ball(int x, int y) {
ballX = x + 30; // + pad width so the ball is at the middle of the pad.
ballY = y; | {
"domain": "codereview.stackexchange",
"id": 31569,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, beginner, game",
"url": null
} |
exponents or powers math way app solve. Radicand no longer has a perfect square because I made it up: Decompose the number inside the expression. ⋅ x 2 = 25 16 x 2 = 25 16 ⋅ x =.... Use this over and over again indicates the principal square root, forth root all. Comes out very nicely number in the same ideas to help us understand the required. 4 2 ⋅ x 2 = 5 4 x the time anyone, anywhere which is fuels! { w^6 } { dx } \frac { \partial } { q^7 } { }. And simplify. Students struggling with all kinds of algebra problems find out that any of square! Over again 5.3 simplifying radical expressions multiplying radical expressions reduces the number 16 is obviously a square! And thousands of other math skills important step in understanding and mastering algebra '' and of... Simplifications with variables will be helpful when doing operations with radical expressions when multiplied by itself gives target. Tutorial, the square root really just comes out very nicely, 9 and 36 can 72! \Circ } | {
"domain": "needlepointmaine.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992914310605,
"lm_q1q2_score": 0.8493091608508769,
"lm_q2_score": 0.8774767874818408,
"openwebmath_perplexity": 723.5144602496497,
"openwebmath_score": 0.8018910884857178,
"tags": null,
"url": "http://needlepointmaine.com/yx78g1yr/simplify-radical-expressions-ed19c2"
} |
thermodynamics, statistical-mechanics, entropy
Another illustration of the importance of true cycles in considering the second law is a "trick" whereby one can extract ALL of the enthalpy of a chemical reaction as useful work IF one has a sequence of cooler and cooler reservoirs that one can use as follows: (1) Lower the reactants down to absolute zero temperature by drawing heat from the reactants into the reservoirs, (2) Let the reaction to go ahead at aboslute zero thus extracting all the reactants' enthalphy as work and then (3) Use the sequence of reservoirs in rising temperature order to bring the reaction products back to the beginning temperature. The point is that some of the enthalpies of formation will now be left in the cold reservoirs and so the system has not been taken through a complete cycle. One can't do this indefinitely: the cool reservoirs will eventually heat up if one does this repeatedly. You might "win" with small amounts of reactants, but you can't do so indefinitely because you are degrading the system: | {
"domain": "physics.stackexchange",
"id": 9375,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, statistical-mechanics, entropy",
"url": null
} |
(2) Related to (1), the (true) statement $\forall x\in\mathbb R:2x=5\iff x={5\over 2}$ means that for any replacement of the variable, the two statements have the same truth value. How does two statements having the same truth value in all cases mean that they imply each other?
(3) Most importantly, I need exposition. Am I missing anything obvious, or is this a simple thing? | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9653811651448431,
"lm_q1q2_score": 0.8065600665537085,
"lm_q2_score": 0.8354835330070838,
"openwebmath_perplexity": 227.3319740467176,
"openwebmath_score": 0.9158170819282532,
"tags": null,
"url": "https://math.stackexchange.com/questions/1692355/iff-interpretation"
} |
c++, multithreading
Optimization
This is very expensive.
for(int i = 0; i < WORDS_TO_FIND; i++)
{
for(auto it = word_count.begin(); it != word_count.end(); ++it )
{
You are basically looping over all the words 20 times. This list could be huge. There are 171,476 words in the english language (assume no spelling mistakes many more if you include these). You can replace this and loop over the words once and just keep track of the top 20. | {
"domain": "codereview.stackexchange",
"id": 29744,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, multithreading",
"url": null
} |
quantum-mechanics, heisenberg-uncertainty-principle, complex-numbers
Title: How can the Heisenberg uncertainty inequality be defined in the unordered complex field $\mathbb{C}$? The generalized uncertainty principle says,
$$\sigma_A^2\sigma_B^2~ \ge ~\frac14\langle i[A, B]\rangle^2.$$
But the complex field is not ordered, i.e, inequalities like $\le$, $\ge$, etc are absurd. For instance, is $i>1$? Doesn't $i$ in there makes the whole inequation meaningless? To elaborate on Yuzuriha's comment, if $A$ and $B$ are self-adjoint operators, then
$$\langle [A,B]\rangle = \langle\psi,AB\psi\rangle - \langle\psi,BA\psi\rangle = \langle A \psi,B\psi\rangle - \langle B\psi,A\psi\rangle$$
but
$$\overline{\langle [A,B]\rangle} = \overline{\langle A \psi,B\psi\rangle} - \overline{\langle B\psi,A\psi\rangle} = \langle B\psi,A\psi\rangle -\langle A \psi,B\psi\rangle = -\langle [A,B]\rangle $$
which implies that $\langle [A,B]\rangle$ is purely imaginary. The explicit factor of $i$ makes the whole thing make sense. | {
"domain": "physics.stackexchange",
"id": 91238,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, heisenberg-uncertainty-principle, complex-numbers",
"url": null
} |
homework-and-exercises, kinematics, projectile
Now, if the acceleration due to gravity doesn't affect the horizontal component of velocity and the only acceleration possible in this scenario is given to be the acceleration due to gravity, then there is no acceleration in the horizontal direction. The magnitude of the horizonal velocity vector must not change, therefore implying that the final velocity of the horizontal component of velocity cannot be zero as the initial horizontal velocity is non-zero.
In a nutshell, if we consider the horizontal components, the initial and final velocity $u$ and $v$ are the same as acceleration due to gravity doesn't affect the horizontal component of the velocity vector. Therefore, $v \not\neq 0$ and $u=v$. Therefore, $v^2 - u^2 = 2as$ just gives us $0=0$ as $a=0 \not\neq g$. | {
"domain": "physics.stackexchange",
"id": 64351,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, kinematics, projectile",
"url": null
} |
Thank you Mark. Here is a question I have for you: Any time I see something indexed by natural numbers, and I want to show something that relies on those indexes, such as a partition, I immediately think induction. Yet, this problem works out very pretty without induction. Is there a way you look at a problem and say, "oh I should(not) use induction here?"
6. Nov 12, 2008
### boombaby
hey, but why not using this one:
$$x_{i-1} (x_{i}-x_{i-1}) < \frac{x_{i}+x_{i-1}}{2} (x_{i}-x_{i-1})=\frac{x^{2}_{i}-x^{2}_{i-1}}{2}$$
you can sum them up easily. and draw a graph you will see why this inequality works pretty well
Mark44,
what if I let P={0,sqrt(2),1}? so that P*={0,1/n,2/n,.....,1} would not be a refinement of P. I'm thinking that L(P*,f)>=L(P,f) is not guaranteed if P* is not a refinement of P.
7. Nov 12, 2008 | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9678992914310606,
"lm_q1q2_score": 0.8001737617649107,
"lm_q2_score": 0.8267117962054049,
"openwebmath_perplexity": 418.3097871807605,
"openwebmath_score": 0.8207181692123413,
"tags": null,
"url": "https://www.physicsforums.com/threads/integrability-question-intro-to-analysis.271199/"
} |
c++, tic-tac-toe, ai
/* A state consists of the board (state) and a boolean to tell
* us who's turn it is.
*/
struct State {
Board board;
bool computersTurn;
};
bool operator<(State const & lhs, State const & rhs) {
if (lhs.computersTurn == rhs.computersTurn) {
return lhs.board < rhs.board;
}
return lhs.computersTurn; /* The states waiting for the computer to
* make a turn are ordered before the
* states waiting for the human to make a
* turn. */
}
std::ostream & operator<<(std::ostream & stream, State const & state) {
stream << (state.computersTurn ? "COMPUTER" : "HUMAN") << '\n';
return stream << state.board;
}
/* A move is just the index on which to place a mark. */
using Move = unsigned; | {
"domain": "codereview.stackexchange",
"id": 22573,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "c++, tic-tac-toe, ai",
"url": null
} |
# Real Analysis, Folland Problem 2.4.42, counting measure with convergence in measure
Problem 2.4.42 - Let $\mu$ be counting measure on $\mathbb{N}$. Then $f_n\rightarrow f$ in measure if and only if $f_n\rightarrow f$ uniformly.
Attempted proof - Suppose that $\mu$ is a counting measure on $\mathbb{N}$ and $f_n\rightarrow f$ in measure for all $n\in\mathbb{N}$. Given $\epsilon\in (0,\infty)$ there exists an $N\in\mathbb{N}$ such that $$\mu\left(\{x\in\mathbb{N}:|f_n(x) - f(x)| \geq \epsilon\}\right) < 1$$ for all $n\in\mathbb{N}$ with $n\geq N$. This implies that $\{x\in\mathbb{N}:|f_n(x) - f(x)\geq \epsilon\}\ = \emptyset$. Hence we have for all $\epsilon\in (0,\infty)$ there exists an $N\in\mathbb{N}$ for every $x\in X$, $|f_n(x) - f(x)| < \epsilon$ for all $n\geq N$. Thus, $f_n\rightarrow f$ uniformly. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9688561712637256,
"lm_q1q2_score": 0.8291966672034693,
"lm_q2_score": 0.8558511488056151,
"openwebmath_perplexity": 130.99200300097695,
"openwebmath_score": 0.7747732400894165,
"tags": null,
"url": "https://math.stackexchange.com/questions/1846492/real-analysis-folland-problem-2-4-42-counting-measure-with-convergence-in-meas"
} |
homework-and-exercises, quantum-field-theory, operators, hilbert-space, wick-theorem
Title: Wick's Theorem: Why is the vacuum expectation value of uncontracted operators zero? I'm am right now reading Chapter 4.3 (Wick's Theorem) in Peskin & Schroeder. It is said that
In the vacuum expectation value, any term in which there remain uncontracted operators gives zero (since $\langle 0 | N (\text{any operator}) | 0 \rangle = 0$). | {
"domain": "physics.stackexchange",
"id": 22957,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, quantum-field-theory, operators, hilbert-space, wick-theorem",
"url": null
} |
algorithms
Part One:
Say I have a list of 'words' made up from characters of the English alphabet. Essentially, I want to split this list of 'words' up into twenty-six sub-lists, where each sub-list is associated with one letter of the alphabet - a, b, c, etc. Each 'word' should be moved to the sub-list associated with the character that the 'word' begins with - so 'apple' would go in the 'a' sub-list, 'banana' would go in the 'b' sublist, etc. BUT, I only want to divide my original list up into sub-lists provided that there are at least X 'words' in the list that begin with each letter of the alphabet (so if X was 2, there would need to be at least two words beginning with 'a', at least two words beginning with 'b', ..., at least two words beginning with 'z', etc.). In essence, it's either one list with all 'words' in it or 26 sub-lists with at least X 'words' in it.
Part Two: | {
"domain": "cs.stackexchange",
"id": 17055,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms",
"url": null
} |
formal-languages, context-free, parsing
Title: Can we prove that all CFLs can be recognized by a Turing Machine in polynomial time? This question came up while a group of students at my school were studying for our qualifying exams. The question on an old exam was,
Consider the following six classes of languages: Context free (CFL), Regular(REG), P, NP, Recursive(R), and Recursively enumerable(RE). (1) indicate the relationships between these six classes e.g., by drawing a Venn diagram. (2) name the minimum type of machine needed to recognize languages in the different classes. | {
"domain": "cs.stackexchange",
"id": 3595,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "formal-languages, context-free, parsing",
"url": null
} |
organic-chemistry, nomenclature
So far, we have three possible names:
Method (1): “(3-cyclopentylpropyl)cyclohexane” or “(3-cyclohexylpropyl)cyclopentane” (ring preferred to chain)
Method (2): “1-cyclohexyl-3-cyclopentylpropane” (chain preferred to ring)
(…) For selection of a preferred IUPAC name, see P-52.2.8.
P-52.2.8 Selection between a ring and a chain as parent hydride
Within the same heteroatom class and for the same number of characteristic groups cited as the principal characteristic group, a ring is always selected as the parent hydride to construct a preferred IUPAC name. In general nomenclature, a ring or a chain can be the parent hydride (see P-44.1.2.2).
This leaves us with two possible preferred IUPAC names:
“(3-cyclopentylpropyl)cyclohexane” or “(3-cyclohexylpropyl)cyclopentane”
P-44.1.3 Seniority order only for rings and ring systems. Criteria that apply only when the choice for parent structure is between two or more rings or ring systems are given in P-44.2. | {
"domain": "chemistry.stackexchange",
"id": 3945,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "organic-chemistry, nomenclature",
"url": null
} |
addition! Statements is true, then give a proof Precalculus 9th Edition Michael Sullivan Chapter 11.4 2AYU! Statement are true or False: matrix addition is associative solutions will be given after completing all the problems!, find its identity, if it exists if any of these is your exam problems at the Ohio University. Make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked the domains *.kastatic.org *! A ) matrix multiplication is associative as well as commutative & e2 & & e2 & & e2 &... These and don ’ t lose a point if any of them are False, and why of even. Of Bases is a binary operation on Q, defined by a scalar -1 *.kasandbox.org are.... The view question … e1 & matrix addition is associative true or false... is the logical and function matrices conforming. They are all true the distributive property ) and how they relate real... However, the zero matrix is a binary operation on Z which is commutative well. ) is False the 10 problems true for matrices | {
"domain": "bdg-academy.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9787126475856414,
"lm_q1q2_score": 0.8024399818369347,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 922.1060456872423,
"openwebmath_score": 0.5299260020256042,
"tags": null,
"url": "https://www.bdg-academy.com/avocado-toast-pzenf/archive.php?page=451ade-matrix-addition-is-associative-true-or-false"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.