text stringlengths 49 10.4k | source dict |
|---|---|
string-theory, standard-model
Title: What is the obstacle to writing down a String Theory that describes our universe? It seems like, at this point, string theory is a reasonably well-developed mathematical framework. Tools from string theory are being used to understand things in QCD and condensed matter with no small success.
So what is the obstacle to actually writing down a string theory (using 'string theory' in the most general sense) in $N+1$ dimensions with $N-3$ dimensions compactified in some way? Presumably there is one, but I can't find it discussed in any of the overview papers I've read (and I'm not really in a position to be able to understand anything deeper than an overview paper).
To clarify, I don't mean obstacle in the sense of 'makes predictions we can't yet test', but either mathematical obstacles, or making predictions we already know to be false. I understand that there's a challenge in finding vacuum that has the right value of $\Lambda$, but is this the only thing?
Edit: Just to doubly clarify: it's well known that string theory has a large parameter space. Is finding the correct set of parameters the only thing stopping us from writing down a string theory that describes our universe? Even though string theorists have constructed huge classes of exciting semi-realistic compactifications (see this for a modern example), the problem is our lack of understanding of how to systematically achieve string theory compactifications that share properties with the universe we observe.
The paper Life at the Interface of Particle Physics and String Theory is an excellent divulgative discussion on the problems and advantages of many specific string constructions. | {
"domain": "physics.stackexchange",
"id": 67851,
"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, standard-model",
"url": null
} |
quantum-field-theory, klein-gordon-equation
Title: Derivation of total momentum operator QFT The expansion of the Klein Gordon field and conjugate momentum field are
$\hat{\phi}(x) = \int \frac{d^3k}{(2 \pi)^3} \, \frac{1}{ \sqrt{2 E_{k}}} \left( \hat{a}_{k} + \hat{a}^{\dagger}_{-k} \right) e^{i k \cdot x}$
and
$\hat{\pi}(x) = \int \frac{d^3k}{(2 \pi)^3} \, \sqrt{\frac{E_{k}}{2}} \left( \hat{a}_{k} - \hat{a}^{\dagger}_{-k} \right) e^{i k \cdot x}$
The total momentum in the classical field is given by
$P^{i} = -\int d^3x \, \pi(x) \, \partial_{i} \phi(x)$
which is promoted to an operator
$\hat{P}^{i} = -\int d^3x \, \hat{\pi}(x) \, \partial_{i} \hat{\phi}(x)$
We are told that putting the expansion into this should give
$\int \frac{d^3p}{(2\pi)^3} \, p^i \left( \hat{a}_{p}^{\dagger} \hat{a}_{p} + \frac12 (2\pi)^3 \delta^{(3)}(0) \right)$ | {
"domain": "physics.stackexchange",
"id": 2915,
"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, klein-gordon-equation",
"url": null
} |
• 1 Solving recurrences Stanford University
• Section 2 Solving Recurrence Relations by Iteration
• SOLVING LINEAR RECURRENCE RELATIONS cs.ioc.ee
• ers generating functions only, he does not use the term “recurrence relation” even when he talks about the Fibonacci numbers. In other cited textbooks RR are used in analy- sis of the time-complexity of algorithms (mostly of the type “divide-and-conquer”), but their solutions are not derived, they are simply given. During the last 15–20 years we can see a trend to the opposite Week 9-10: Recurrence Relations and Generating Functions April 12, 2018 1 Some number sequences An inflnite sequence (or just a sequence for short) is an ordered array
4.2 Solving Linear Recurrence Relations 4.4 Generating Functions 2 Agenda Ch. 4.1, 4.2 & 4.5 Recurrence Relations Modeling with Recurrence Relations Linear NonhomogeneousRecurrence Relations with Constant Coefficients Generating Functions Useful Facts About Power Series Extended Binomial Coefficient Extended Binomial Theorem Counting Problems and Generating Functions Using Generating Functions initial conditions and satis es the recurrence relation, it must match the sequence an exactly! 2. a 0 = 2;a 1 = 2. The characteristic function is the same, with roots r 1 = 2 and r 2 = 1.
Week 10-11: Recurrence Relations and Generating Functions April 20, 2005 1 Some Number Sequences An inflnite sequence (or just a sequence for short) is an ordered array Chapter 1 Introductory ideas and examples A generating function is a clothesline on which we hang up a sequence of numbers for display. What that means is …
A simple technic for solving recurrence relation is called telescoping. Start from the first term and sequntially produce the next terms until a clear pattern emerges. If you want to be mathematically rigoruous you may use induction. Recurrence Relations and Generating Functions. Recurrence Realtions This puzzle asks you to move the disks from the left tower to the right tower, one disk at a On 28 January 2017 MathCounts will discuss Solving Basic Recurrence Relations with Generating Functions 2 . These problems are posed to help guide the discussion. | {
"domain": "severemusick.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9838471637570105,
"lm_q1q2_score": 0.8342706664773966,
"lm_q2_score": 0.8479677506936878,
"openwebmath_perplexity": 616.8304921082495,
"openwebmath_score": 0.6817836165428162,
"tags": null,
"url": "https://severemusick.com/victoria/solving-recurrence-relations-using-generating-functions-pdf.php"
} |
xgboost, multiclass-classification, probability
Excerpt 1:
"Probability estimation is known to be a quite hard problem, especially in comparison to standard classification. This comes at no surprise, noting that proper probability estimation is a sufficient but not necessary condition for proper classification: If the conditional class probabilities (1) are predicted accurately, an optimal classification can simply be made by picking the class with highest probability"
Excerpt 2:
"More generally, the Bayes decision can be taken so as to minimize any loss
in expectation. On the other hand, a correct classification can also be obtained
based on less accurate probability estimates. In fact, the classification will remain correct as long as the estimated probability is highest for the true class. Or, stated differently, an estimation error will remain ineffective unless it changes the result of the arg max operation in (2). This is also the reason for why methods like naive Bayes show competitive performance in classification despite producing relatively inaccurate probability estimates [7]."
Excerpt 3:
Methods like naive Bayes and decision trees are multi-class classifiers and
can in principle be used to produce probability estimates in this setting. In
practice, however, one often prefers to estimate probabilities in the two-class
setting, especially because estimating a single probability (of the positive class) is much simpler than estimating K − 1 probabilities simultaneously
Example with probabilities close to 1:
from sklearn import datasets
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
iris = datasets.load_iris()
X = iris.data
y = iris.target
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 0)
from sklearn.tree import DecisionTreeClassifier
dtree_model = DecisionTreeClassifier(max_depth = 2).fit(X_train, y_train)
dtree_predictions = dtree_model.predict(X_test) | {
"domain": "datascience.stackexchange",
"id": 7754,
"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": "xgboost, multiclass-classification, probability",
"url": null
} |
human-physiology
Title: Countercurrent multiplier mechanism How exactly does the countercurrent multiplier mechanism work in formation of urine in the body? I am unable to find a satisfactory answer to this. The countercurrent system permits forming a concentrated urine
In the presence of ADH, which increases water permeability, the hyposmotic fluid that enters the distal tubule (DT) from the thick ascending limb (TAL) looses most of its water by osmotic equilibration with the surrounding cortical interstitium along the CNT and cortical collecting duct (CCD). It also continues loosing NaCl through reabsorptive transport along DT, CNT and CCD, until the tubule fluid becomes isoosmotic with plasma, by the end of the CCD.
The relatively small amount of isoosmotic fluid that flows into the medullary collecting ducts losses progressively more and more water to the hyperosmotic medullary and papillary interstitia and is finally excreted as hyperosmotic, highly concentrated urine.
The countercurrent system permits forming a dilute urine
In the absence of ADH, the hyposmotic fluid that enters the DT from the loop of Henle, continues to be diluted by transport of NaCl via NaCl (thiazide sensitive) cotransporters into DT cells and via Na channels (amiloride sensitive) along the CD. Water reabsorption is limited so that the tubule fluid becomes more and more dilute along DT, CNT and collecting ducts (CCD, OMCD and IMCD), until it is excreted as a large volume of hyposmotic urine.
Sources:
Barac-Nieto, Prof. Mario. "Countercurrent System and the Loop of Henle." Countercurrent System and the Loop of Henle. Kuwait University. Web. 08 Feb. 2016.
Wikipedia. Wikimedia Foundation. Web. 08 Feb. 2016. https://en.wikipedia.org/wiki/Countercurrent_multiplication.
"7. Urinary Concentration (countercurrent Mechanism)." 7. Urinary Concentration (countercurrent Mechanism). Web. 08 Feb. 2016. | {
"domain": "biology.stackexchange",
"id": 5108,
"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": "human-physiology",
"url": null
} |
php, array, random
I use this all the time if I want to dump a quick <ul> to the screen:
echo '<ul><li>', implode('</li><li>', $array), '</li></ul>';
So, your code ends up looking like:
for($i=0;$i<10;$i++)
{
$products[$i] = mt_rand(1,10);//$i is the key, so we don't need any other vars
$products[$i] .= 'car '.($products[$i] > 1 ? 's' : '')
}
echo implode('<br/>', $products);
Or, if regexes don't scare you and you like some unmaintainable code, you could even do this:
$arr = array();
$i=0;
while($i++<10)
{
$arr[] = mt_rand(1,10);
}
echo preg_replace('/(([2-9]+|10)\s+car)(?!s)/','$1s',implode(' car<br/>',$arr).' car');
But that's just terrible code to maintain...
If the array you're echo-ing isn't of any use to you except for your printing it out, you could just as well drop the array:
for($i=0, $j=mt_rand(1,10);$i<10;$i++, $j=mt_rand(1,10))
{
echo $j, ' car', $j > 1 ? 's' : '', '<br/>';
}
Which, if you're a massochist, you can turn into a one-liner quite easily:
for($i=0, $j=mt_rand(1,10);$i<10;$i++, $j=mt_rand(1,10)) echo $j, ' car', $j > 1 ? 's' : '', '<br/>'; | {
"domain": "codereview.stackexchange",
"id": 4222,
"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, array, random",
"url": null
} |
Related integer sequences:
• Nr. of solutions for the mod2 case: A210370
• Nr. of solutions for the non mod2 case: A171503
# Updated
• Updated answer to give solutions for modular arithmetic (mod 2)
• You could give multiple dimensions to Tuples to get arrays directly, e.g. Tuples[legalmatrixentries, {n, n}], so you can avoid the Partition. – MarcoB Dec 10 '19 at 15:25
• wrong range btw – Alucard Dec 10 '19 at 15:26
• @MarcoB thanks for pointing that out, didn't know about it, i like! thanks! – Thies Heidecke Dec 10 '19 at 15:28
• @Alucard The title and the code example in the OP are not matching, so i just picked the example from the title. – Thies Heidecke Dec 10 '19 at 15:28
• Thanks a lot. Actually I did a little mistake while making the question... I wish to make the list of matrices with modular arithmetic 2 along with det one condition. I tried Modulus==2 & but it didn't work. Please let me how to incorporate the additional condition. Thanks a lot. – ricci1729 Dec 10 '19 at 15:49 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9579122756889438,
"lm_q1q2_score": 0.821666600947377,
"lm_q2_score": 0.8577681086260461,
"openwebmath_perplexity": 1541.8771751331558,
"openwebmath_score": 0.2597038149833679,
"tags": null,
"url": "https://mathematica.stackexchange.com/questions/211106/generating-all-2x2-matrices-with-entries-from-0-to-3-whose-det-is-1-with-mod-2-a"
} |
physical-chemistry, quantum-chemistry
$$ \ldots $$
$${F_{K1}}{\kern 1pt} {c_{1K}} + {F_{K2}}{c_{2K}} + \cdots + {F_{KK}}{c_{KK}} = {\varepsilon _K}\left( {{S_{K1}}{\kern 1pt} {c_{1K}} + {S_{K2}}{\kern 1pt} {c_{2K}} + \cdots {S_{KK}}{\kern 1pt} {c_{KK}}} \right) $$
In matrix form you will get
$${\mathbf{FC}} = {\mathbf{SCE}}$$
Addendum: The Fock operator
The Fock operator $\widehat {\rm{F}}$ that appears in the Hartree-Fock equations
$$\widehat {\rm{F}}{\kern 1pt} {\psi _i} = {\varepsilon _{\rm{i}}}{\kern 1pt} {\psi _i}$$
is a one-electron operator.
This operator can be written as
$$\begin{array}{c}\widehat F(1) = - \frac{1}{2}\nabla _1^2 - \sum\limits_\mu {\frac{{{Z_\mu }}}{{{r_{\mu 1}}}}} + \sum\limits_{j = 1}^N {(2{{\widehat {\mathop{\rm J}\nolimits} }_j} - {{\widehat K}_j})} \\ = \widehat h(1) + \sum\limits_{j = 1}^N {(2{{\widehat J}_j} - {{\widehat K}_j})} \end{array}$$
where "(1)" just reminds as that the operator is a single electron operator. | {
"domain": "chemistry.stackexchange",
"id": 17232,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "physical-chemistry, quantum-chemistry",
"url": null
} |
java, object-oriented, mvc, swing, chess
private void replacePawnWithQueen(Position end) {
board[end.row()][end.column()] = new Queen(pieceAt(end).getTeam());
}
// Uses cache to reverse a move where a pawn has turned into a queen
private void checkForReversePawnReplacement() {
Position pos = pawnToQueenConversionCache.pop();
if (pos != null)
board[pos.row()][pos.column()] = new Pawn(pieceAt(pos).getTeam());
}
private List<Move> generatePossibleMovesForPiece(Position start) {
Piece piece = pieceAt(start);
if (piece instanceof Pawn)
updatePawnSurroundings(start);
return removeInvalidMoves(piece.generateMoveList(start));
}
// Tells a pawn object where its surrounding pieces are so it can make a move
private void updatePawnSurroundings(Position pawnPosition) {
boolean leftTake = false, rightTake = false;
boolean isPieceInFront = false, isPieceTwoInFront = false;
Pawn pawn = (Pawn) pieceAt(pawnPosition);
int directionModifier = getDirectionModifier(pawn.getTeam());
Position pos;
// True if an opposing teams piece is at top left of pawn
pos = new Position(pawnPosition.row() + directionModifier, pawnPosition.column() + 1);
if (pieceAt(pos) != null && pieceAt(pos).getTeam() != pawn.getTeam())
rightTake = true;
// True if an opposing teams piece is at top right of pawn
pos = new Position(pawnPosition.row() + directionModifier, pawnPosition.column() - 1);
if (pieceAt(pos) != null && pieceAt(pos).getTeam() != pawn.getTeam())
leftTake = true; | {
"domain": "codereview.stackexchange",
"id": 38934,
"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, mvc, swing, chess",
"url": null
} |
homework-and-exercises, newtonian-mechanics, rotational-dynamics, friction
Title: A pure rolling sphere problem Question: A sphere $S$ rolls without slipping, moving with a constant speed on a plank $P$. The firction between the upper surface of plank $P$ and the sphere is sufficient to prevent slipping. Friction between plank and ground is negligible. Initially plank $P$, is fixed to ground with help of a pin $N$. How will motion of sphere and plank be affected if, the pin $N$ is suddenly removed?
According to me the plank should move in opposite direction to that of sphere, since centre of mass must remain at rest.
But according to my teacher's explanation, the motion of plank and sphere will remain unaffected because since in question, it is given that that sphere is moving with constant speed, which means no acceleration. This implies there is no force acting hence, there would be no friction acting between plank and sphere. This explanation seems odd to me.
Please give appropriate explanation and point out any faults in any of the explanation mentioned above. Any suggestions are massively appreciated. This is indeed a tricky concept. Consider a perfectly rigid cylinder on a perfectly rigid horizontal plane moving in a direction perpendicular to its axis. Let the radius of the cylinder be $R$, its velocity be $v$ and its angular velocity by $\omega$.
If there is no friction between the cylinder and plane, the cylinder will continue with constant $v$ and $\omega$ forever. It is not necessary for $v=R\omega$. $v$ and $\omega$ are independent of each other.
If there is sufficient friction between the cylinder and plane and $v \neq R\omega$, friction will act such that the cylinder ends up with $v=R\omega$. At this point, once $v=R\omega$, there will be no friction at all. The cylinder will continue with $v=R\omega$ forever. The velocity of the point of contact with respect to the plane is zero.
It's the same idea with a block on a rough table: If no force pushes on the block, and the block has no velocity relative to the table, there will be no friction. | {
"domain": "physics.stackexchange",
"id": 98294,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "homework-and-exercises, newtonian-mechanics, rotational-dynamics, friction",
"url": null
} |
quantum-mechanics
I have three questions:
Firstly, what is the meaning of $p(\lambda)$? $\lambda$ is a parameter (such as position in Bohmian mechanics). Does it just give the probability that a randomly selected system has a particular value of $\lambda$? That's the only way I can interpret it - $\lambda$ is meant to be predetermined.
Secondly, what within the framework of QM dictates that measurements of the components $\sigma_1\cdot a$ and $\sigma_2 \cdot a$ must be opposite? I'm not questioning the rule, I just want to know where it comes from.
Finally, how does the rule for the expectation value $\langle \sigma_1 \cdot a \sigma_2 \cdot b\rangle=-a\cdot b$ come about? The answers to your three questions are:
I) You should have better denoted the hidden parameter by, say, $\Lambda$ , and by ${λ}$ the set of his values. So, $p(λ)$ is the probability that the variable $\Lambda$ take the value $λ$.
II) The state named spin-singlet has the form
$$|S\rangle = \frac {|\uparrow\rangle |\downarrow\rangle - |\downarrow\rangle |\uparrow\rangle}{\sqrt {2}}. \tag{1}$$
The states $|\uparrow\rangle$ and $|\downarrow\rangle$ are the eigenstates of the operator $\hat {\sigma}_z$. However, if you choose another axis in space instead of $z$, the spin-projection eigenstates will transform, but the resulting singlet state will have an analogous form. For instance, if you prefer to pass from the axis $z$ to the axis $x$, the singlet becomes
$$|S\rangle = \frac {|\rightarrow\rangle |\leftarrow\rangle - |\leftarrow\rangle |\rightarrow\rangle}{\sqrt {2}}. \tag{2}$$ | {
"domain": "physics.stackexchange",
"id": 19860,
"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",
"url": null
} |
python, sorting, python-2.x
return sequence
The function uses a quadruple nested loop. I think that is overkill, and other (non-Python) code on the Internet only a double loop. On my computer, this is twice as slow as linear insertion. How can I reduce the number of loops? Shell sort requires 3 loops because of the nature of the algorithm, you can get rid of one looping construct by making a recursive call but there's always loops+recursive calls >= 3. So I don't see how other code you have found uses only 2 loops. The main issue with precomputing the indexes that you are iterating over is that you start to negate one of the best benefits of shell sort, specifically if you do that you no longer have O(1) additional space used You will have fewer loops but you'll get some higher space complexity.
Syntactically you might be able to get less levels of indentation with some other approaches but it may not be more readable.
With that said there are a few changes I would make. I'd break out the increment generation into it's own function, taking your code mostly as-is this would become:
def generate_increments_sequence(length):
"""Generate the sequence of increments needed by shellsort
for a sequence of the given length"""
e = 2.718281828459
increment_sequence = []
counter = 0
while True:
counter += 1
current_value = int(round(e ** (counter - 2)) + 1)
if current_value >= length:
break
increment_sequence.append(current_value)
return increment_sequence
Now it's worth noting that there's library function for exponentiation math.exp
import math
def generate_increments_sequence(length):
"""Generate the sequence of increments needed by shellsort
for a sequence of the given length"""
increment_sequence = []
counter = 0
while True:
counter += 1
current_value = int(round(math.exp(counter - 2)) + 1)
if current_value >= length:
break
increment_sequence.append(current_value)
return increment_sequence | {
"domain": "codereview.stackexchange",
"id": 15240,
"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, sorting, python-2.x",
"url": null
} |
------------EDIT--------------------
You are looking for minimax polynomials. In this case we want to minimize $||f(x)-P^*(x)||_\infty$ hence $$\text{min}_{a,b}\big(\text{max}_{[-1,1]}|2x^3+x^2+2x-1-(ax+b)|\big)$$ Since the derivative on $[-1,1]$ is positive maximum error can ocur in three possibilities $$x=-1\Rightarrow\quad -4-(-a+b)=e\qquad (1)$$ $$x=k\Rightarrow\quad 2k^3+k^2+2k-1-ak-b=-e\qquad (2)$$ $$x=1\Rightarrow\quad 4-(a+b)=e\qquad (3)$$ To find the point $x=k$ we have to maximize the error such as $$\frac{d}{dx}\big( 2x^3+x^2+2x-1-(ax+b)\big)_{x=k}=0\Rightarrow=a=6k^2+2k+2\qquad (4)$$ By solving equations $(1)$ and $3$ we find that $a=4$. Then we can solve equation $(4)$ to give $$k_1=-0.7676\text{ and }k_2=0.4343$$ If we set $k_1=-0.7676$ then $b=0.1099$ which produces below graph
If we set $k_2=0.4343$ then $b=-0.7581$ which produces below graph
For these results we can say the best uniform approximation can be given by $P^*(x)=4x-0.7581$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9603611643025386,
"lm_q1q2_score": 0.8044176890690375,
"lm_q2_score": 0.8376199694135332,
"openwebmath_perplexity": 276.1960300489305,
"openwebmath_score": 0.8403192758560181,
"tags": null,
"url": "http://math.stackexchange.com/questions/415458/how-to-best-approximate-higher-degree-polynomial-in-space-of-lower-degree-polyno/417276"
} |
complexity-theory, finite-automata, space-complexity, nondeterminism, polynomial-time-reductions
Title: How to construct complement of NFA universality? Given an input NFA, can one construct an NFA that is universal (that is, accepts all its inputs) if and only if, the input NFA isn't universal?
I tried to use the fact that NFA-universality is PSPACE-complete, and the fact that PSPACE = coPSPACE. I am also interested in the details of a simple construction. Consider the language $ALL_{NFA} = \{\langle A\rangle: \text{$A$ is an NFA with $L(A) = \Sigma^*$}\}$.
If you want a non-PTIME reduction from $\overline{ALL_{NFA}}$ to $ALL_{NFA}$, then you can simply do the following naive approach. On input $\langle A\rangle$ for the reduction, the reduction checks whether $L(A) \neq \Sigma^*$, and outputs an NFA $B$ that accepts all its inputs only when $L(A)\neq \Sigma^*$. Clearly, this works but comes at a high cost: we are deciding $\overline{ALL_{NFA}}$ to output the NFA $B$ accordingly. As the non-universality check can be performed in PSPACE, the latter reduction is a PSPACE reduction.
More abstractly, if you don't care about the complexity of the reduction, you can use the fact that every non-trivial language is $R$-hard (see my answer here). | {
"domain": "cs.stackexchange",
"id": 21693,
"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": "complexity-theory, finite-automata, space-complexity, nondeterminism, polynomial-time-reductions",
"url": null
} |
# Question Question B4: The ideas of linear recurrences show how some of the summation formulas from section 2.4 arise. Let $$a_{n}=\sum_{i=1}^{k}(n+2)(n+1)(n)$$, and observe that $$a_{n}=a_{n-1}+n^{3}+3 n^{2}+2 n$$ is a non-homogeneous linear recurrence with initial condition $$a_{0}=0$$. (a) Show that $$a_{n}$$ must be a polynomial function of $$n$$ with degree 4 . (b) Determine the coefficients of this polynomial. Check that this is the same formula you would obtain by using the table of summations from section 2.4? | {
"domain": "studyxapp.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9867771766922545,
"lm_q1q2_score": 0.8306943315461699,
"lm_q2_score": 0.8418256432832333,
"openwebmath_perplexity": 148.70201903506012,
"openwebmath_score": 0.9513243436813354,
"tags": null,
"url": "https://www.studyxapp.com/homework-help/question-b4-the-ideas-of-linear-recurrences-show-how-some-of-the-summation-form-q1636603971707904002"
} |
filters, digital-communications, soft-question
Bandwidth of bandpass filter $<$ QPSK signal bandwidthIn this case, the filtered QPSK signal now has intersymbol interference (ISI) in it whereas the incoming signal did not, which makes the subsequent matched filtering and demodulation more problematical. Equalization might be needed to ameliorate the ISI which will add to the cost/weight/power consumption of the receiver, and error probability will likely suffer.
I didn't bring up the issue of the center frequency of the bandpass filter in the previous paragraph, but if the center frequency is different from the carrier frequency, then there is a whole 'other can of worms that you will have opened up.
Bandwidth of bandpass filter $>$ QPSK signal bandwidthThis is a much better notion that the previous one. The issue of mismatch between center frequency of the filter and the carrier frequency is still there, though. But, is this a good idea? Maybe, maybe not. Remember that the matched filter is also a bandpass filter. Indeed, as pointed out here, the matched filter has transfer function $S^*(f)$ where $S(f)$ is the Fourier transform of the QPSK signal, and so the matched filter has large gain at frequencies where the signal is strong and low gain at frequencies where the signal is weak -- a resume'-writer, no less, since it is emphasizing the strong points and playing down the weak ones. Thus, additional bandpass filtering ahead of the matched filter is not really necessary from a purely DSP perspective. However, your circuit designer colleagues might well insist on the extra bandpass filtering on the grounds that it helps with dynamic range issues in low SNR situations.
So, explore all the ramifications before jumping into bandpass filtering. Do you really need to use a bandpass filter, or can you get by without it? | {
"domain": "dsp.stackexchange",
"id": 7617,
"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, digital-communications, soft-question",
"url": null
} |
python, beginner, python-3.x, game, battleship
#Takes and cleans the input to prevent errors
def inputCleaner():
global y, x
num = []
repeat = True # Secondary variable to handle loops
# Checks to make sure input is 2 items instead of one
while repeat:
try:
xy = input("Were do you want to shoot your shot? (num1 num2):")
x, y = xy.split() # Gives error if its only one number
repeat = False # If there is an error, this does not run, making the loop keep running
# If error is given, runs this instead of any code left to run
except ValueError:
print("Please enter two numbers")
true = True # Primary variable to handle loops
# Main loop to check if input is right
while true:
true = False # *Starts chuckling*
try:
# Sets the variable to numbers instead of characters they came in as. If this fails, it runs the except code below
x = int(x)
y = int(y)
if y > 10 or y < 1: # Makes sure that the first number is on the board, if not asks for another number to replace it
true = True
y = input(
"Please make sure that your first number is at least 1 and no more than 10. Re-enter only your first number:")
elif x > 10 or x < 1: # Same as above, but with x
true = True
x = input(
"Please make sure that your second number is at least 1 and no more than 10. Re-enter only your second number:")
else: # If neither of the above are true, puts the numbers in the num list
num.append(int(x))
num.append(int(y))
except ValueError or TypeError: # If something other than a number is entered, it runs this code
repeat = True
# This code makes sure at least two numbers were entered
while repeat:
try:
xy = input("Please use only numbers. Enter you shot location again:")
x, y = xy.split()
repeat = False
true = True
except ValueError:
print("Please enter two numbers")
return num | {
"domain": "codereview.stackexchange",
"id": 36504,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, beginner, python-3.x, game, battleship",
"url": null
} |
#### LCKurtz
##### Junior Member
Does this mean more numbers are transcendental than not? How is that?
Yes. The rationals and the algebraic numbers are both countable infinity. The transcendentals are an uncountable infinity.
#### Romsek
##### Full Member
The golden ratio is NOT a transcendental number. It is root of x2 - x - 1 = 0
Staff member
#### Jomo
##### Elite Member
Yes. The rationals and the algebraic numbers are both countable infinity. The transcendentals are an uncountable infinity.
Can we please a proof of this. I'm not say you are wrong, I just want to see this proof.
#### Subhotosh Khan
##### Super Moderator
Staff member
Can we please a proof of this. I'm not say you are wrong, I just want to see this proof.
For that you have to read a paper by George Cantor. Internet is full of reference to that paper. | {
"domain": "freemathhelp.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9777138118632622,
"lm_q1q2_score": 0.8060878190992679,
"lm_q2_score": 0.824461932846258,
"openwebmath_perplexity": 723.8323704810002,
"openwebmath_score": 0.7306343913078308,
"tags": null,
"url": "https://www.freemathhelp.com/forum/threads/difference-between-transcendental-and-irrational-numbers.119387/"
} |
GMAT Question of the Day - Daily to your Mailbox; hard ones only
It is currently 21 Jan 2019, 23:11
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
## Events & Promotions
###### Events & Promotions in January
PrevNext
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
272829303112
Open Detailed Calendar
• ### The winners of the GMAT game show
January 22, 2019
January 22, 2019
10:00 PM PST
11:00 PM PST
In case you didn’t notice, we recently held the 1st ever GMAT game show and it was awesome! See who won a full GMAT course, and register to the next one.
• ### GMAT Club Tests are Free & Open for Martin Luther King Jr.'s Birthday!
January 21, 2019
January 21, 2019
10:00 PM PST
11:00 PM PST
Mark your calendars - All GMAT Club Tests are free and open January 21st for celebrate Martin Luther King Jr.'s Birthday.
# Two numbers differ by 2 and sum to S. Which of the following is the gr
Author Message
TAGS:
### Hide Tags
Director
Status: I don't stop when I'm Tired,I stop when I'm done
Joined: 11 May 2014
Posts: 535
GPA: 2.81
Two numbers differ by 2 and sum to S. Which of the following is the gr [#permalink]
### Show Tags
23 Jun 2016, 10:36
6
23
00:00
Difficulty:
35% (medium)
Question Stats:
67% (01:17) correct 33% (01:32) wrong based on 688 sessions
### HideShow timer Statistics | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241982893259,
"lm_q1q2_score": 0.8056470665018691,
"lm_q2_score": 0.831143045767024,
"openwebmath_perplexity": 4941.035560572777,
"openwebmath_score": 0.7322189211845398,
"tags": null,
"url": "https://gmatclub.com/forum/two-numbers-differ-by-2-and-sum-to-s-which-of-the-following-is-the-gr-220814.html"
} |
$\displaystyle \cos^2{x} + 2\cos{x} + 1 = 0$
$\displaystyle (\cos{x}+1)^2 = 0$
$\displaystyle \cos{x} = -1$
$\displaystyle x = \pi$
i think is depend on the interval of x...
if $\displaystyle 0<x<360$
and use this formula
$\displaystyle if \cos {x}= \cos {a}$
$\displaystyle x=a + k (360)$ or $\displaystyle x=-a+k(360)$
in this case:
$\displaystyle \cos{x} = -1$
so,$\displaystyle \cos{x} = cos{180}$
$\displaystyle x=180 + k (360)$
let$\displaystyle x=0$ so $\displaystyle x=180 + (0) (360)= 180$
let$\displaystyle x=1$ so $\displaystyle x=180 + (1) (360)= 540$ (rejected, bcause 540 not in the interval $\displaystyle 0<x<360$)
or
$\displaystyle x=-a+k(360)$
let$\displaystyle x=0$ so $\displaystyle x=-180 + (0) (360)= -180$ (rejected, bcause -180 not in the interval $\displaystyle 0<x<360$)
4. Originally Posted by skeeter
$\displaystyle \sec{x} + \cos{x} = -2$
multiply every term by $\displaystyle \cos{x}$ ...
$\displaystyle 1 + \cos^2{x} = -2\cos{x}$
$\displaystyle \cos^2{x} + 2\cos{x} + 1 = 0$
$\displaystyle (\cos{x}+1)^2 = 0$
$\displaystyle \cos{x} = -1$ | {
"domain": "mathhelpforum.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347853343058,
"lm_q1q2_score": 0.8011696825360464,
"lm_q2_score": 0.8221891239865619,
"openwebmath_perplexity": 835.750059176817,
"openwebmath_score": 0.8424559235572815,
"tags": null,
"url": "http://mathhelpforum.com/trigonometry/113744-solve-trigonometric-equation.html"
} |
textbook-and-exercises, resource-request
Title: Should one learn the math of quantum computing from a "pure" perspective, or are quantum computing texts "good enough"? Math for quantum computing includes advanced linear algebra, functional analysis, group and representation theory, probability theory, and more.
There are plenty of pure math books out there for those, but there are also quantum computing/information theory books that contain only the parts relevant for QC.
Is there any advantage to learning the math from a pure math perspective first, then learning QC, or learning the math directly from quantum computing textbooks? I guess before I crack open Dummit and Foote, I want to make sure I'm not doing overkill.
I ask as someone who is slightly more interested in the math/computer science side of QC, and probably less of the physical implementation. The goal would be to read/understand research papers in the field and possibly contribute. This is just my opinion...
There is certainly an advantage in understanding the mathematics used in quantum information and computation from a pure mathematics perspective. I wrote a book on quantum information, and I included only the mathematical background I needed to explain the material on quantum information I wanted to cover, and nothing more. That sort of background material is not intended to give the reader a deep understanding of the subject matter, it's just meant to explain to the reader the tools that are needed for the rest of the book. New discoveries will surely require additional background material, and it can only be an advantage to know more.
However, that does not mean that you should study this material first. If you try to do that, your career might be half over by the time you get to quantum information. My recommendation is to focus your studies on what you find to be interesting, and to think of strengthening your background as a continual ongoing process that will never be finished. | {
"domain": "quantumcomputing.stackexchange",
"id": 3333,
"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": "textbook-and-exercises, resource-request",
"url": null
} |
fluid-dynamics, hamiltonian-formalism
Title: Help me understand the skipped steps regarding Hamiltonian Fluids In "Hamiltonian Fluid Dynamics" by P. J. Morrison, the author skipped the steps when doing solving the variation problem from equations 19 - 23. Can you better help me understand what he is doing?
I put a snippet of the paper below. I am mostly stuck on the second terms in 20 and 22. I don't see how the Jacobian and the density get within the derivative term. Also why $ \frac{\partial U}{\partial \rho} $ remains within the derivative because I thought he was doing chain rule. I figured he is holding $ \rho_0 $ constant because he doesn't differentiate $ \rho_0 $. Got it. The right way to think of things is that $ q(a, t) $ is a field. Then we need to take field variations. With, $ \frac{\partial \rho_0}{\partial a_\mu} = 0 $ and $ a_0 = t $.
\begin{align}
\delta S &= \int dt\ d^3a\ \left[ \rho_0 \dot{q}_i \delta \dot{q}_i - \rho_0 \left( \frac{\partial U}{\partial \rho} \delta \rho + \frac{\partial U}{\partial s} \delta s \right) \right] \\
&= \int dt\ d^3a\ \left[ -\rho_0 \ddot{q}_i \delta q_i - \rho_0^2 \frac{\partial U}{\partial \rho} \frac{\partial \frac{1}{\mathcal{J}}}{\partial \frac{\partial q^k}{\partial a^j}} \delta \frac{\partial q^k}{\partial a^j} \right] \\ | {
"domain": "physics.stackexchange",
"id": 41026,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fluid-dynamics, hamiltonian-formalism",
"url": null
} |
c#, .net, validation, winforms
Title: Validating a string under few conditions Following code validates NIC number of a person (National Identity Card, no like SSN)
Requirements are...
Length should be 10 digits or characters
All should be digits except the last one
Last one would be x or v in simple letters
Currently I'm using following method and its working. I just want to know that could this be make better or simplified?
private bool ValidateNIC(string nic)
{
if (!string.IsNullOrEmpty(nic))
{
char[] letter = nic.ToCharArray();
if (letter.Length == 10)
{
if (letter[9] == 'v' | letter[9] == 'x')
{
for (int i = 0; i <= (letter.Length - 2); i++)
{
if (char.IsNumber(letter[i]) == false)
{
MessageBox.Show(string.Format("letter {0 } is not allowed, all Should be numbers except the last one.", letter[i]));
return false;
}
}
return true;
}
else
{
MessageBox.Show("Last letter should be x or v in simple letters");
return false;
}
}
else
{
MessageBox.Show("Length should be 10 ");
return false;
}
}
else
{
MessageBox.Show("NIC is null");
return false;
}
}
As I think George Howarth was suggesting in his answer you can reduce nesting and avoid the Arrow code effect by returning early from the
method. This helps with code flow as well as readability.
As already mentioned if you can remove constant literals from your code that is good. One way to do this is to move these to
private static or const variables or even supply them to the method.
private const int RequiredLength = 10;
private readonly char[] _acceptedLastCharacters = { 'x','v' }; | {
"domain": "codereview.stackexchange",
"id": 8089,
"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#, .net, validation, winforms",
"url": null
} |
mechanical-engineering, materials
Title: Impact damage in composite materials I want to do a test where I use composite materials to mimic impact damage on aircraft materials such as impact from hailstone while the aircraft is in flight.
I will cut out specimen sheets using a water jet cutter and they will have different size notches and then I will use a drop weight impact machine to create a hole in the material and assess any cracks or deformations etc.
Here is the design of the specimen sheets that I will cut out from the larger material sheet:
My question is what are some good objectives that I can set for this experiment before the test is carried out. Don't forget to maintain the temperature while carrying out the test. The material will behave differently when subjected to impacts on different temperatures.
Also, if the part you are experimenting on is the outside surface in contact with the air, then also don't forget to put on the necessary paint or any other surface coating that is originally used on it. This can also create a difference.
After cutting out the necessary specimens, make sure that the cuts are done gently and the cutted faces are smoothened enough to mimic the real life structure. The reason being after the cut out, the amount of pre-present cracks in the structure can increase and may make it more vulnerable to fracture than what can be expected in reality.
Since you are trying to model hail by dropping weights, you have to ensure that the weights has somewhat the same Elastic Modulus and rigidity as the hails. The reason being, if the weights are more rigid, then the cracks or even fracture can appear on the composite sample while it may not the case when hail of same weight is dropped on it. (Since in the situation of impact where drop weight is more rigid than a hail, all of the energy during impact will be taken by the composite sample). | {
"domain": "engineering.stackexchange",
"id": 4347,
"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": "mechanical-engineering, materials",
"url": null
} |
Again, I welcome any critique of my reasoning and/or my style as well as alternative solutions to the problem.
Thanks.
-
Reasoning is sound, although you should point out somewhere that $\overline{10^n}=\overline{10}^n=\overline{1}^n=\overline{1}$. Also, it looks weird to have $\overline{\cdots}$, just $\cdots$ suffices. And if you aren't going to distinguish between the regular + and its modular version then you need to carry that really long \overline through until the last line. – Alex Becker Jan 17 '12 at 0:45
I second @AlexBecker's comments. – user21436 Jan 17 '12 at 0:52
## 4 Answers
Your suggestion works if you are satisfied $\overline{a_n\cdot10^n} \equiv \overline{\overline{a_n}\cdot\overline{10^n}} \equiv \overline{\overline{a_n}\cdot1} \equiv \overline{a_n} \mod 9$, which is indeed true.
Another way is
\begin{align} s&={a_n\cdot10^n+\cdots+a_2\cdot10^2+a_1\cdot10^1+a_0\cdot10^0}\\ &={a_n\cdot 99\ldots99+\cdots+a_2\cdot 99+a_1\cdot 9 +a_0\cdot 0 }+\sum_{i=0}^n a_i\\ &=9({a_n\cdot 11\ldots11+\cdots+a_2\cdot 11+a_1\cdot 1 +a_0\cdot 0 )}+\sum_{i=0}^n a_i \end{align}
so $s \equiv \sum_{i=0}^n a_i \mod 9.$
-
Just another way. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429565737233,
"lm_q1q2_score": 0.8194438631988561,
"lm_q2_score": 0.8333245870332531,
"openwebmath_perplexity": 490.52173750433656,
"openwebmath_score": 0.9139912128448486,
"tags": null,
"url": "http://math.stackexchange.com/questions/99725/every-integer-is-congruent-to-the-sum-of-its-digits-mod-9/99738"
} |
javascript, css, angular.js, controller
This is the Plunkr. One simple thing you can do is remove the need for the $observe and place the template inside the directive and use ngShow to handle the show/hide action. (also added in scope that has two way binding to the alertData object.)
Updated Directive
var myApp = angular.module('myApp', []);
myApp.directive('notification', ['$timeout', function ($timeout) {
return {
restrict: 'E',
template:"<div class='alert alert-{{alertData.type}}' ng-show='alertData.message' role='alert' data-notification='{{alertData.status}}'>{{alertData.message}}</div>",
scope:{
alertData:"="
}
};
}]);
And html
<div class="container" style="width: 480px; margin-top: 50px;">
<notification alert-data="notification"></notification>
<button id="submit" name="submit" class="btn btn-default" type="submit" ng-click="notification.status = 'show'; notification.message = 'Oh yeah!'; notification.type = 'info';">Show</button>
Updated plunkr | {
"domain": "codereview.stackexchange",
"id": 9532,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, css, angular.js, controller",
"url": null
} |
machine-learning, neural-network, svm, computer-vision, object-recognition
Title: How to calculate mAP for detection task for the PASCAL VOC Challenge? How to calculate the mAP (mean Average Precision) for the detection task for the Pascal VOC leaderboards?
There said - at page 11:
Average Precision (AP). For the VOC2007 challenge, the interpolated
average precision (Salton and Mcgill 1986) was used to evaluate both
classification and detection. For a given task and class, the
precision/recall curve is computed from a method’s ranked output.
Recall is defined as the proportion of all positive examples ranked
above a given rank. Precision is the proportion of all examples above
that rank which are from the positive class. The AP summarises the
shape of the precision/recall curve, and is defined as the mean
precision at a set of eleven equally spaced recall levels
[0,0.1,...,1]:
AP = 1/11 ∑ r∈{0,0.1,...,1} pinterp(r)
The precision at each recall level r is interpolated by taking the
maximum precision measured for a method for which the corresponding
recall exceeds r: pinterp(r) = max p(r˜), where p(r˜) is the measured
precision at recall ˜r
About mAP
So does it mean that:
We calculate Precision and Recall:
A) For many different IoU > {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1} we calculate True/False Positive/Negative values
Where True positive = Number_of_detection with IoU > {0, 0.1,..., 1}, as said here and then we calculate:
Precision = True positive / (True positive + False positive)
Recall = True positive / (True positive + False negative)
B) Or for many different thresholds of detection algorithms we calculate:
Precision = True positive / (True positive + False positive)
Recall = True positive / (True positive + False negative)
Where True positive = Number_of_detection with IoU > 0.5 as said here
C) Or for many different thresholds of detection algorithms we calculate:
Precision = Intersect / Detected_box
Recall = Intersect / Object
As shown here?
Then we build Precision-Recall curve, as shown here: | {
"domain": "datascience.stackexchange",
"id": 3314,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "machine-learning, neural-network, svm, computer-vision, object-recognition",
"url": null
} |
go, http
// HTTPHelper hangs Request and RequestWithTimeout methods
type HTTPHelper struct{}
var singleton *HTTPHelper
// NewHTTPHelper returns a pointer to the HTTPHelper singleton
func NewHTTPHelper() *HTTPHelper {
if singleton == nil {
singleton = &HTTPHelper{}
}
return singleton
}
func sendErr(out chan HelperResponse, err error) {
out <- HelperResponse{
Result: "",
StatusCode: 0,
Error: err,
}
}
// Request wraps RequestWithTimeout with default 30 second timeout
func (h *HTTPHelper) Request(method string, url string, payload interface{}) (out chan HelperResponse) {
return h.RequestWithTimeout(method, url, payload, 30)
}
// RequestWithTimeout returns Response, StatusCode, and any Errors from an http request
func (h *HTTPHelper) RequestWithTimeout(method string, url string, payload interface{}, timeout int) (out chan HelperResponse) {
go func() {
payloadJSON, err := json.Marshal(payload)
if err != nil {
sendErr(out, err)
}
req, err := http.NewRequest(method, url, bytes.NewReader(payloadJSON))
req.Header.Add("Content-Type", "application/json")
client := http.Client{Timeout: time.Second * time.Duration(timeout)}
resp, err := client.Do(req)
if err != nil {
sendErr(out, err)
}
respBytes, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
out <- HelperResponse{
Result: string(respBytes),
StatusCode: resp.StatusCode,
Error: err,
}
}()
return out
} | {
"domain": "codereview.stackexchange",
"id": 40094,
"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": "go, http",
"url": null
} |
& \Rightarrow \tilde{\sigma}^{2}\\
&=\frac{\sum_{i=1}^{a}\sum_{j=1}^{n_{i}}(y_{ij}- \bar{y}_{..})^{2}}{n}\\
\mbox{}\\ % help balance
\mbox{}
\end{align*}
\end{multicols}
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
Some text some text some text some text.
\end{document} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9504109728022221,
"lm_q1q2_score": 0.8152322208301828,
"lm_q2_score": 0.8577681068080748,
"openwebmath_perplexity": 5609.070389382092,
"openwebmath_score": 0.999531626701355,
"tags": null,
"url": "https://tex.stackexchange.com/questions/288075/how-to-align-equations-in-two-columns"
} |
classical-mechanics, rigid-body-dynamics, solid-mechanics
\end{align*}
which can be integrated in order to derive $\boldsymbol{r}_{0}(t)$:
\begin{align*}
\boldsymbol{r}_{0}(t) & =U\intop_{0}^{t}\boldsymbol{e}_{z}^{\prime}\left(\tau\right)d\tau=\frac{U}{\Omega_{y}-\Omega_{z}}\left[\Omega_{y}-\Omega_{y}\cos\left(\Omega_{y}t\right)\cos\left(\Omega_{z}t\right)-\Omega_{z}\sin\left(\Omega_{y}t\right)\sin\left(\Omega_{z}t\right)\right]\boldsymbol{e}_{x}\\
& \hspace{8em}+\frac{U}{\Omega_{y}-\Omega_{z}}\left[-\Omega_{y}\cos\left(\Omega_{y}t\right)\sin\left(\Omega_{z}t\right)+\Omega_{z}\sin\left(\Omega_{y}t\right)\cos\left(\Omega_{z}t\right)\right]\boldsymbol{e}_{y}\\
& \hspace{8em}+\frac{U}{\Omega_{y}}\sin\left(\Omega_{y}t\right)\boldsymbol{e}_{z}
\end{align*}
This is in general a complex and very intriguing curve, but we will
limit our study here to the case where $\Omega_{y}\ll\Omega_{z}$.
A series expansion of $\boldsymbol{r}_{0}$ around $\Omega_{y}$ yields
\begin{align*} | {
"domain": "physics.stackexchange",
"id": 57219,
"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": "classical-mechanics, rigid-body-dynamics, solid-mechanics",
"url": null
} |
python, python-2.x, quiz
def printall(entries):
if len(entries) == 0:
print("No words stored.")
return
for word_pair in entries:
print("{} : {}".format(*word_pair))
def backup_wordpairs(entries, file_path):
with open(file_path, 'w') as words:
for word_pair in entries:
words.write("{},{}\n".format(*word_pair))
def main(file_path=FILE_PATH):
if os.path.isfile(file_path):
with open(file_path) as words:
entries = [Entry(*map(str.strip, line.split(",")))
for line in words]
else:
print("File does not exist")
sys.exit()
while True:
command = input("Please enter a command: ")
if command == "add":
insert(entries)
backup_wordpairs(entries, file_path)
elif command == "test":
query(entries)
elif command == "list":
printall(entries)
elif command == "end":
break
elif command == "reset":
entries.clear()
if os.path.isfile(file_path):
os.remove(file_path)
else:
print("No known command.")
print(" ------- Vocabulary becomes terminated. ---------- ")
sys.exit()
if __name_ == "__main__":
main()
As you can see now, almost all functions take entries as the first argument and modify it somehow. This should tell you that you could easily make this a class. | {
"domain": "codereview.stackexchange",
"id": 31085,
"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, quiz",
"url": null
} |
New series formula for $\arctan(x)$? Ln(x)?
I discovered this equation, but have no idea if it has been previously discovered. Please help determine if it has been previously developed. Or please prove that the equation is not correct.
$$\sum_{n=0}^\infty \frac{x^{2n+1}}{(x^2+1)^{n+1}}\cdot\frac{(2n)!!}{(2n+1)!!}=\arctan(x),$$
for $|x|\leq \pi$, or possibly all $x$.
Likewise, using the same method
for $x> .001$, or possibly x > 0.
$$\sum_{n=1}^\infty \frac{x^{n}-1}{(1+x)^{n}}\cdot\frac{(1)}{(n)}=Ln(x),$$
all follows from dx/dx =1. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822877007780706,
"lm_q1q2_score": 0.8007928541795087,
"lm_q2_score": 0.8152324960856175,
"openwebmath_perplexity": 679.3937672315192,
"openwebmath_score": 0.9521764516830444,
"tags": null,
"url": "https://math.stackexchange.com/questions/1835310/new-series-formula-for-arctanx-lnx"
} |
javascript, programming-challenge, combinatorics, iteration
const digitMapping = {
2: ['a', 'b', 'c'],
3: ['d', 'e', 'f'],
4: ['g', 'h', 'i'],
5: ['j', 'k', 'l'],
6: ['m', 'n', 'o'],
7: ['p', 'q', 'r', 's'],
8: ['t', 'u', 'v'],
9: ['w', 'x', 'y', 'z']
}
//Get the digits, ignore ones and zeroes
let digits = s.split('').filter(i => i > 1);
let out = [], tmp = [];
//Some shortcuts
if(!digits.length){
return out;
}
if(digits.length == 1){
return digitMapping[digits[0]];
}
//We're still here, prep out and digits (shift modifies digits)
out = digitMapping[digits.shift()];
while(digits.length){
const nextLetters = digitMapping[digits.shift()];
tmp = out;
out = [];
tmp.forEach(s => nextLetters.forEach(c => out.push(s+c)));
}
return out;
}
console.log(mapDigits("23")); | {
"domain": "codereview.stackexchange",
"id": 35339,
"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, programming-challenge, combinatorics, iteration",
"url": null
} |
c++, vectors
1. More recently the standard has been rewritten so it can still use only one bit per element, but can also use an entire bool per element if it prefers. | {
"domain": "codereview.stackexchange",
"id": 23831,
"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++, vectors",
"url": null
} |
navigation, ros-kinetic, robot-localization
And the x and y measurements covariance of uwb and odom are set to 1e-3.
I have config the setting for days, nothing improvement, and I'm sad now.
update on 15,Jan:
Reply to Mike: Thank you for your reply , I am using uwb sensor to get the /loc topic that only includes x and y, and wheel odometer on the two wheel differential robot to get the /odom.
Reply to Tom: Thank you for your reply , the samples are below:
/loc:
header:
seq: 404
stamp:
secs: 1642126436
nsecs: 242936955
frame_id: "odom"
pose:
pose:
position:
x: -0.0739352678571
y: 0.090203125
z: 0.996699772049
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
covariance: [0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1000000.0] | {
"domain": "robotics.stackexchange",
"id": 37323,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "navigation, ros-kinetic, robot-localization",
"url": null
} |
gazebo
Originally posted by Wonyoung on Gazebo Answers with karma: 37 on 2013-03-22
Post score: 0
hello.
There is a section in the tutorial version 1.3, that is not on 1.4 and 1.5, "Controling a robot".
specialy (http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model) and (http://gazebosim.org/wiki/Tutorials/1.3/control_robot/mobile_base) ,
this should get you a good idea how to move robots with the model velocity or with joint commands.
i advise you to first get a simple plugin controlling the robot movement avoiding obstacles and then, if you want to control it with ROS, make a ROS-enabled plugin like the one in the tutorials and edit it to subscribe linear and angular velocity from a ROStopic with geometry_msgs/Twist (http://ros.org/doc/api/geometry_msgs/html/msg/Twist.html).
You should research about message types for rostopics, publishing and subscribing to ROStopics with diferent message types before trying to create your own plugin to talk with ROS
SIDE NOTE:
once you have some insight of the tutorials this might be usefull to save you sometime later on if you are not familiar with quaternions (i wasn't), so remember this when you try to get a robot Roll Pitch Yaw angles:
math::Quaternion r = model->GetWorldPose().rot;
//from quaternion to roll pitch yaw, in radians
qw=r.w; qx=r.x; qy=r.y; qz=r.z;
Rrad=atan2( 2*(qw*qx+qy*qz), 1-2*(qx*qx+qy*qy) ); //roll
Prad=asin(2*(qw*qy-qz*qx)); //pitch | {
"domain": "robotics.stackexchange",
"id": 3148,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo",
"url": null
} |
magnetic-fields, biology, nuclear-magnetic-resonance
Title: Nuclear relaxation time in absence of a magnetic field It seems that after reading about how MRI scans work, and it appears that I had a misconception of what T1 relaxation times mean. From what I think I understand now, the T1 relaxation time refers to the time it takes for nuclei to realign with an applied static magnetic field. What I'm curious about is what determines and what is used to refer to the time for the alignment of hydrogen protons within a magnetic field to become disordered after this static magnetic field is turned off/removed? IN a molecular structure, nuclei are in constant rotational and vibrational motion, and create a magnetic field.
The magnetic field caused by thermal motion of the nuclei within the lattice is called the lattice field.
This lattice field of a nucleus with lower energy can interact with the lattice field of a nucleus with higher energy, thus distributing the energy.
Now if there is a radiofrequency pulse, it is dissipated as increased rotation and vibration in the lattice (increasing temperature).
Spin-lattice relaxation is when the spins give the energy (they gained from the FR pulse) back to the lattice, restoring equilibrium. The same is for when the spins have been altered by an external magnetic field.
The relaxation time, T1 (the average lifetime of nuclei in the higher energy state) is dependent on the gyromagnetic ratio of the nucleus and the mobility of the lattice. As mobility increases, the vibrational and rotational frequencies increase, making it more likely for a component of the lattice field to be able to stimulate the transition from high to low energy states. However, at extremely high mobilities, the probability decreases as the vibrational and rotational frequencies no longer correspond to the energy gap between states.
https://en.wikipedia.org/wiki/Spin%E2%80%93lattice_relaxation
The answer to your question is, that the T1 rate depends on the:
gyromagnetic ratio of the nucleus
mobility of the lattice
The question after the comments is about when the static magnetic field is removed. | {
"domain": "physics.stackexchange",
"id": 59705,
"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, biology, nuclear-magnetic-resonance",
"url": null
} |
c++, error-handling, logging
const path LogFilePath = ( ( argc >= 4 ) ? path( argv[3] ) : defaultLogFilePath );
Log.open( LogFilePath.string() );
if ( !Log )
{
cerr << "Error creating " << absolute( LogFilePath ) << " : " << strerror( errno ) << endl;
return -1;
}
try
{
Snapshot( canonical( argv[1] ), canonical( argv[2] ) );
}
catch ( const filesystem_error& ex )
{
LogErrorStream << ex.what() << endl;
}
if ( Log )
{
if ( LogErrorStream.str().empty() )
{
cout << "The program ran without any errors.\n";
}
else
{
Log << "\nERRORS -:\n\n" << LogErrorStream.str() << endl;
cout << "There were some errors during the execution of this program !\n\nCheck " << absolute( LogFilePath ) << " for details.\n";
return -1;
}
}
} | {
"domain": "codereview.stackexchange",
"id": 14187,
"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++, error-handling, logging",
"url": null
} |
In the case above, each $f_n(x)=x^{1/n}$ is continuous on $D=[0,1]$ but $f$ is not continuous on $D,$ so the convergence can't be uniform. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693241965169939,
"lm_q1q2_score": 0.8180079403255036,
"lm_q2_score": 0.8438951005915208,
"openwebmath_perplexity": 61.36502785343427,
"openwebmath_score": 0.9998385906219482,
"tags": null,
"url": "https://math.stackexchange.com/questions/2056447/pointwise-uniform-convergence-of-a-sequence-of-functions"
} |
ros, 3d-navigation, pointcloud-to-laserscan, laserscan, velodyne
Title: Velodyne HDL-32E to laserscan
I'm planning to use gmapping to create the 3D environment for our robot, so I'm assemble a tilting hokuyo laser scanner and using the corresponding driver.
For long term, I plan to use the velodyne laser scanner. The issue is the velodyne package appears to be outputting in pointcloud2 format, instead of laserscan format.
I see options such as using the pointcloud_to_laserscan to create the map. There is also ethzasl package I saw recommended on another post, but we need loop closer.
I basically would like to hear your experiences with using a velodyne lidar for a fast/higher quality 3D map or if the tilting hokuyo would be a viable permanent solution.
Any advice is greatly appreciated!
Originally posted by pwong on ROS Answers with karma: 447 on 2013-10-09
Post score: 0
I think pointcloud_to_laserscan is the usual solution for reducing 3D point cloud data for 2D mapping applications.
I've seen papers describing more elaborate schemes, depending on your environment and requirements.
Beware that the Velodyne does not see things nearer than 90cm away. See this discussion.
Originally posted by joq with karma: 25443 on 2013-10-10
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 15815,
"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, 3d-navigation, pointcloud-to-laserscan, laserscan, velodyne",
"url": null
} |
transfer-function, impulse-response, real-time
Title: Calculating numerator and denominator polynomials of a transfer function I was reading this passage in a Doctoral Thesis about Adaptive cancellation.
Using MATLAB, if i were to write a simple code, it would look something like this.
transferFunction=tf(numerator,denominator);
%construction of impulse signal
dt=1e-3;
t = -1:dt:1;
impulse= t==0;
%computing impulse response
impulseResponse=fftshift(fft(lsim(transferFunction,impulse,t)));
I'm trying to understand the basics of how to calculate the numerator/denominator polynomials. so please bear with me when i explain how i visualize it. Lets assume the input to this linear time invariant system is a 1kHz sine wave sampled at 16 kHz.
Reading upon the function of 'tf' in MATLAB documentation, it says,
Transfer functions are a frequency-domain representation of linear
time-invariant systems. For instance, consider a continuous-time SISO
dynamic system represented by the transfer function sys(s) =
N(s)/D(s), where s = jw and N(s) and D(s) are called the numerator and
denominator polynomials, respectively. The tf model object can
represent SISO or MIMO transfer functions in continuous time or
discrete time.
If i take a 32 point FFT of that 1 kHz input signal, i'll have 16 bins with the 1 kHz at the 2nd bin.
Assuming there is a linear gain of 1 applied at every bin in the frequency domain. the output would be exactly the same as the input and therefore
N(s)/D(s) = S(x)
if the gain applied is 2 at every bin,
N(s)/D(s) = 2 S(x)
if the gain applied is 0.5 , then
N(s)/D(s) = S(x)/2
Is my understanding wrong ? if I'm wrong, how would you calculate the numerator and denominator polynomials of a system | {
"domain": "dsp.stackexchange",
"id": 10724,
"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": "transfer-function, impulse-response, real-time",
"url": null
} |
c, regex
Title: Doing a re.findall with pcre library I am trying to get an array of all regex matches. For example, something like this:
PATTERN: (\d+)[a-z]+
STRING: 123asd
RESULT: ["123asd", "123"]
^ ^
full capture group 1
Additionally, if there are multiple matches, it should continue matching, for example:
123asd 123asd
[ ["123asd", "123"], ["123asd", "123"] ]
^ ^
match 1 match 2
Here is what I came up with, where I try and create functions to do each of the items (though I haven't yet added a fetch_all() function):
// pcretest.c
#include <stdio.h>
#include <string.h>
#include <errno.h>
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
pcre2_code* pcre_compile_pattern(PCRE2_SPTR pattern, uint32_t options)
{
PCRE2_SIZE error_offset;
int error_number;
pcre2_code *re_compiled = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, options, &error_number, &error_offset, NULL);
if (re_compiled == NULL) {
PCRE2_UCHAR buffer[256];
pcre2_get_error_message(error_number, buffer, sizeof(buffer));
printf("Error: Compiling of pattern '%s' failed at offset %d: %s\n", pattern, (int)error_offset, buffer);
}
return re_compiled;
}
struct match_obj {
int size;
char** matches;
};
// will return the offset of the full-match (or an error-code), and populate the struct match_obj
int get_next_match(pcre2_code *re_compiled, PCRE2_SPTR8 string, struct match_obj *matches, int max_matches)
{
#define MAX_MATCHES_EXCEEDED (-99) | {
"domain": "codereview.stackexchange",
"id": 44158,
"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, regex",
"url": null
} |
javascript, strings, node.js, functional-programming, ramda.js
console.log(extractString(firstObject)); // 'some random description'
console.log(extractString(secondObject)); // 'some description within text'
console.log(extractString(thirdObject)); // false
I would really appreciate it if a seasoned functional programmer might provide me with some alternative approaches to implementation. Thanks. A few points:
your isString function isn't exactly checking if it's a string, as it's also returning false if not. The typeof check can be simplified to R.is(String)
It's probably better to push all the inputs to the edge of the logic, in this case making paths an argument too. Just splits out our logic an our inputs a bit better.
Instead of wrapping each path in R.path, you can make a function which turns all paths into path functions
For applying the list of path functions to the object, we can use R.juxt
Possible refactoring:
const isString = R.is(String)
const makePaths = R.map(R.path)
const extractStringFor = (paths) =>
R.compose(
R.defaultTo(false),
R.find(isString),
R.juxt(makePaths(paths))
)
const firstObject = { description: 'some random description' };
const secondObject = { description: { text: 'some description within text' } };
const thirdObject = { foo: 'bar' };
const paths = [['description'], ['description', 'text']]
const extractString = extractStringFor(paths)
extractString(firstObject), // 'some random description'
extractString(secondObject), // 'some description within text'
extractString(thirdObject) // false
caveat: This runs all paths against each object, and then find the match that's a string. That could be optimised though, potentially with R.takeWhile/R.reduceWhile or something. | {
"domain": "codereview.stackexchange",
"id": 27727,
"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, strings, node.js, functional-programming, ramda.js",
"url": null
} |
computability, database-theory
Query equivalence in this schema is undecidable by a reduction to the satisfiability of Diophantine equations (Hilbert's 10th problem):
A system of Diophantine equations can be described as a multivariate-polynomial with integer coefficients $p(x_1, \dots, x_n) = 0$. Determining whether or not there is any tuple $(x_1, \dots, x_n) \in \mathbb{Z}^n$ that satisfies the equation is known to be an undecidable problem.
This condition can be directly represented as the WHERE clause in the SQL described above: WHERE p(x_1, ..., x_k) = 0 (expanded using * and +).
Determining whether or not SELECT * FROM t WHERE p(x_1, ..., x_k) = 0 is equivalent to SELECT * FROM t WHERE false is determining whether or not p(x_1, ..., x_k) has some assignment of integers $x_1, \dots, x_k$ such that $p(x_1, \dots, p_k) = 0$; thus if we were able to determing the equivalence of SQL queries, we would be able to determine the satisfiability of Diophantine equations.
Because the satisfiability of Diophantine equations is undecidable, so must this query equivalence problem. | {
"domain": "cs.stackexchange",
"id": 18574,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "computability, database-theory",
"url": null
} |
Tools » Screen Aspect Ratio & Dimension Calculator Screen Aspect Ratio & Dimension ... with a diagonal screen size of and ... ) takes up ??? Then drag the corners to create an arbitrary rectangle.Calculate the length of the diagonals.Click 'show details' to verify your answer. Mathematics - Mathematical rules and laws - numbers, areas, volumes, exponents, trigonometric functions and more ; Related Documents . Height. A = a × b A = a × b. where a a and b b are the length and width of the rectangle, respectively. Keep in mind that this is a decimal fraction; for example .5 is 1/2 inch and .75 is 3/4 inch. Length of Diagonal of Rectangle Formula: The diagonal of a rectangle is determined by the following formula. Width = 10 in Simply enter the length of a side of the square and the diagonal will be calculated quickly. Use our online diagonal of a rectangle calculator to find diagonal of rectangle by entering the width and height. Diagonal of a Square Calculator - calculate the diagonal of a square. Use this square calculator to find the side length, diagonal length, perimeter or area of a geometric square. Enter the measurement that you know (diagonal, width or height) and the other two will be calculated. Area = length x width It is necessary to follow the next steps: Enter the length and width of a rectangle in the box. Related Topics . Right triangle calculator to compute side length, angle, height, area, and perimeter of a right triangle given any 2 values. Diagonal Matrix Calculator is a free online tool that displays the result whether the given matrix is a diagonal or not for the given matrix. % of the device surface area. iForce Systems LLC, Through two sides and the angle between them, Through the radius of the inscribed circle, Through the radius of the circumscribed circle, By the diagonals and the angle between them, Through the diagonals and the angle between them, Through the sides and the angle between them, Total surface area of the regular pyramid across the height, Lateral surface area of the regular pyramid through the height, Lateral surface area of the regular pyramid through the apothem, Isosceles triangle, through side and height, Isosceles triangle, through side and angle. Calculate screen dimensions (height/width/area, in inches or | {
"domain": "motservicecentres.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9632305318133553,
"lm_q1q2_score": 0.8128655246466131,
"lm_q2_score": 0.8438950986284991,
"openwebmath_perplexity": 507.86432464731814,
"openwebmath_score": 0.6339654922485352,
"tags": null,
"url": "http://motservicecentres.com/0nbaez/diagonal-measurement-calculator-38f5a7"
} |
where columns consist of vectors $$\mathbf{N} ,\mathbf{x},\mathbf{y},\mathbf{z}$$ components (the fourth row repeats the first one).
Of course such determinant equals to $$0$$.
Developing the determinant along the fourth row we obtain:
$$-n_1\begin{vmatrix} x_1 & y_1 & z_1 \\ x_2 & y_2 & z_2 \\ x_3 & y_3 & z_3 \\ \end{vmatrix} +x_1\begin{vmatrix} n_1 & y_1 & z_1 \\ n_2 & y_2 & z_2 \\ n_3 & y_3 & z_3 \\ \end{vmatrix} -y_1\begin{vmatrix} n_1 & x_1 & z_1 \\ n_2 & x_2 & z_2 \\ n_3 & x_3 & z_3 \\ \end{vmatrix} +z_1\begin{vmatrix} n_1 & x_1 & y_1 \\ n_2 & x_2 & y_2 \\ n_3 & x_3 & y_3 \\ \end{vmatrix}=0$$
from which the formula for the first component of the vector given in the question follows
(the first summand is equal to $$0$$ as the vectors $$\mathbf{x},\mathbf{y},\mathbf{z}$$ are collinear, the columns can be permuted (required for the third summand) if needed to give appropriate sign in expression)
Similarly the determinants | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9828232935032463,
"lm_q1q2_score": 0.8035312393768282,
"lm_q2_score": 0.8175744761936437,
"openwebmath_perplexity": 322.3503210436836,
"openwebmath_score": 0.9991838335990906,
"tags": null,
"url": "https://math.stackexchange.com/questions/3155292/proving-bf-x-times-y-cdot-n-zy-times-z-cdot-n-xz-times-x-cdot-n-y"
} |
python, cryptography, websocket
I used RSA because I read that RSA was a good way send the derived key from client to server. But I don't understand: The AES key is generated from the derived key. The password entered by the client is send encrypted to the server. But the derived key used for the AES is send unencrypted from the server to the client. Couldn't someone with bad intentions not just intercept this derived key and use that to generate the same AES-key?
Yes, they could and this is not a good protocol.
It is possible derive a master / session key using key agreement (DH). Generally it is best to only use the password for authentication.
It is said that in real life TLS is used, but I'd argue that in that case you might as well send the password unencrypted from client to server. That is what HTTP basic authentication does - as there is already an established secure channel where the server is trusted.
I first thought it would make more sense to let the client generate a derived key and set it encrypted to the server. But each client would have a different salt?
Salts can be send to the other side unencrypted; they don't need to be secret.
If my implementation is wrong, what to change?
I don't know, but if I read this text then I'm pretty sure that you are a novice at this. In that case you'd start by studying what is already out there.
Other things to consider?
Yeah, don't be proud and don't think you can create a secure chat from scratch. To do that it is important to first learn what is out there.
Crypto remarks
AES should be using an authenticated mode such as AES-GCM. Currently the protocol uses ECB which is not secure for a transport mode. Actually, it seems the implementation doesn't even protect the confidentiality of messages as it fails to protect against plaintext and particularly padding oracle attacks.
Salts are usually just 16 to 32 random bytes. There is no need to depend on code of bcrypt if PBKDF2 is used for the actual implementation. | {
"domain": "codereview.stackexchange",
"id": 45227,
"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, cryptography, websocket",
"url": null
} |
multithreading, thread-safety, delphi
Title: Sending a string from anonymous thread to UI with PostMessage I am sending a string from an anonymous thread to the UI with PostMessage in the following code:
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
const
WM_SETCAPTION = WM_USER;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure WMSetCaption(var msg: TMessage); message WM_SETCAPTION;
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.WMSetCaption(var msg: TMessage);
begin
Self.Caption := PChar(msg.LParam);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
System.Classes.TThread.CreateAnonymousThread(
procedure
begin
PostMessage(Handle, WM_SETCAPTION, 0, LParam(PChar('My new caption')));
end).Start;
end;
end.
This works seemingly well, but could this potentially create memory leaks? Or is there a better way to accomplish this? Create an object containing the string as a property and pass the pointer to the object as Integer LParam. Then, in the message handler, use the string and free the object. In this way, you could not only send strings but also other data as well.
unit SendingStringWithPostMessageUsingObjectMainForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
const
WM_STRINGMESSAGE = WM_USER; | {
"domain": "codereview.stackexchange",
"id": 25491,
"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": "multithreading, thread-safety, delphi",
"url": null
} |
is it necessary that it will also be zero about a different. [5.1] Informally, a function from A to B is a rule which assigns to each element a of A a unique element f(a) of B. Officially, we have Definition. I am trying to get the total number of onto functions from set A to set B if the former has m elements and latter has n elements with m>n. Suppose TNOF be the total number of onto functions feasible from A to B, so our aim is to calculate the integer value TNOF. If X has m elements and Y has 2 elements, the number of onto functions will be 2 m-2. Maths MCQs for Class 12 Chapter Wise with Answers PDF Download was Prepared Based on Latest Exam Pattern. according to you what should be the anwer Example 9 Let A = {1, 2} and B = {3, 4}. (d) x2 +1 x2 +2. Copyright © 2021 Pathfinder Publishing Pvt Ltd. To keep connected with us please login with your personal information by phone/email and password. Please use ide.geeksforgeeks.org, In the above figure, f … No element of B is the image of more than one element in A. A function is said to be bijective or bijection, if a function f: A → B satisfies both the injective (one-to-one function) and surjective function (onto function) properties. 1.1. . An exhaustive E-learning program for the complete preparation of JEE Main.. Take chapter-wise, subject-wise and Complete syllabus mock tests and get in depth analysis of your test.. This is same as saying that B is the range of f . Number of Onto function - & Number of onto functions - For onto function n(A) n(B) otherwise ; it will always be an inoto function . In other words, nothing is left out. So, that leaves 30. f(a) = b, then f is an on-to function. For example: X = {a, b, c} and Y = {4, 5}. The total no.of onto function from the set {a,b,c,d,e,f} to the set {1,2,3} is????? For | {
"domain": "etflorex.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9744347845918813,
"lm_q1q2_score": 0.8320822876714197,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 674.6693465095651,
"openwebmath_score": 0.5782132744789124,
"tags": null,
"url": "https://etflorex.com/x5hpvz/total-no-of-onto-functions-from-a-to-b-bb790c"
} |
python, python-3.x, web-scraping, pandas, beautifulsoup
# get form table URLs
parse_only = SoupStrainer('tr', {"class": 'blueRow'})
soup = BeautifulSoup(self.session.get(url).content,'lxml', parse_only=parse_only)
form_url = soup.find_all('tr', {"class": 'blueRow'})[-1].find('a')['href']
if ".txt" in form_url:
pass
else:
form_url = urljoin(self.BASE_URL, form_url)
# print(form_url)
form_urls.append(form_url)
return self.scrape_document(form_urls, cik, filing_date)
def scrape_document(self, urls, cik, filing_date):
"""This function scrapes holdings from particular document URL"""
cols = ['nameOfIssuer', 'titleOfClass', 'cusip', 'value', 'sshPrnamt',
'sshPrnamtType', 'putCall', 'investmentDiscretion',
'otherManager', 'Sole', 'Shared', 'None']
data = []
for url in urls:
soup = BeautifulSoup(self.session.get(url).content, 'lxml')
for info_table in soup.find_all(['ns1:infotable', 'infotable']):
row = []
for col in cols:
d = info_table.find([col.lower(), 'ns1:' + col.lower()])
row.append(d.text.strip() if d else 'NaN')
data.append(row)
df = pd.DataFrame(data, columns=cols)
df['cik'] = cik
df['Filing Date'] = filing_date
return df | {
"domain": "codereview.stackexchange",
"id": 37602,
"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, web-scraping, pandas, beautifulsoup",
"url": null
} |
typescript
get message() {
return this._message;
}
}
Maybe, for more consistency, _message should be protected if OutOfBoundsError is not a sealed class.
And yes, I know that in some case you defined this message property inside the AppError class. I just mention, just in case.
Ternary operation
This is just a preference. When there is only one line to write inside the if and else statements, I just prefer a ternary operation. It seems cleaner to me.
export class OutOfBoundsError extends AppError {
protected _message = ``;
constructor(private name: ValueName, value: number, bounds?: Bounds) {
super();
const lower = bounds?.lowerBoundInclusive;
const upper = bounds?.upperBoundInclusive;
lower != null
? this.handleTruthyLower({value, upper})
: this.handleFalsyLower({value, upper, lower});
}
private handleFalsyLower = (args: ErrorMessageArgs) => {
const { value, upper } = args;
this._message = upper != null
? `${this.name} must be less than or equal to ${upper} but\
${value} was given`
: `${this.name} of ${value} is out of bounds`;
}
private handleTruthyLower = (args: ErrorMessageArgs) => {
const { value, upper, lower } = args;
this._message = upper != null
? `${this.name} must be between ${lower} and ${upper} but\
${value} was given`
: `${this.name} must be greater than or equal to ${lower}\
but ${value} was given`;
}
get message() {
return this._message;
}
}
Even for void function calls.
Hope it helps and any suggestions are welcome. | {
"domain": "codereview.stackexchange",
"id": 38196,
"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": "typescript",
"url": null
} |
ros, p2os, rosaria, ros-hydro
Originally posted by ReedHedges with karma: 821 on 2014-12-03
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by AlexR on 2014-12-03:
Hi, Thanks for your reply. I am presently having no problems using the RosAria package and it works well with the hokuyo laser range finder. I am however unable to monitor the battery and robot status. Are there any tools to monitor them. Also do you have an idea for powering sensors using Aux point
Comment by ReedHedges on 2014-12-04:
You can use the battery_voltage topic to check battery use. Some robots (Seekur, LX) also publish battery_state_of_charge also. There is no "dashboard" for RosAria like there is for p2os. For power, see robot manual and ask support@mobilerobots.com if questions.
Comment by AlexR on 2014-12-06:
Do the guys at mobilerobots give help regarding ROS for pioneer as well? I mean by the support email.
Comment by ReedHedges on 2014-12-08:
Use ROS Answers and the sig-ros-pioneer mailing list to ask ROS-specific questions. For questions about the robot or its behavior (using either ARIA or ROS software), ask aria-users, pioneer-users or AMR support. AMR robot-related questions there are higher priority for us but I also check here.
Comment by AlexR on 2014-12-09:
Thanks @ReedHedges. One more thing, we dont have a gyro installed on our p3dx. Which economical external gyro can be used with p3dx? | {
"domain": "robotics.stackexchange",
"id": 20225,
"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, p2os, rosaria, ros-hydro",
"url": null
} |
rotational-dynamics, tensor-calculus, moment-of-inertia
Title: What are the details that link an "inertia tensor" of a rigid body at a given point with the mathematical definition of a tensor? I know how to operate with the matrix representation of an inertia tensor, understand how it changes with respect to basis transformations, but I'm having a hard time framing the concept of the inertia tensor of a rigid body at a given point in the larger framework of the mathematical definition of a tensor, at least with regard to this definition:
A $k$-tensor is a multilinear function from $V×V×⋯×V$ to the reals, where $V$ is a vector space and $k$ is the number of the $V$'s in the above Cartesian product. (Calculus on Manifolds, Michael Spivak, 1965, page
75). | {
"domain": "physics.stackexchange",
"id": 91217,
"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": "rotational-dynamics, tensor-calculus, moment-of-inertia",
"url": null
} |
ros
Originally posted by rnvandemark with karma: 36 on 2021-12-31
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by xander-m2k on 2022-01-03:
I'm sorry for describing a vague description of it not working. I knew the syntax was not correct, hence I simply said "it does not work", but actually it should be "incorrect syntax".
Anyway, I think this does work indeed.
My goal was to make the function more intuitive for the user, so the functions second parameter would only be used with a request, because async_send_request() uses that as parameter. Apart from that, my first idea was to leave it just as std::shared_ptr<ServiceT> request, because I did not know how to do that.
I'm actually wondering how this works. For the first parameter it seems simple, because ServiceT will just be any type of the class rclcpp::Client. But, for the second argument, since ServiceT is not an actual type, how does the compiler know that the ServiceT type has a Request type, and how would that match against the actual Request class? Is the name of the typename the part that matters most for this? How does that work? | {
"domain": "robotics.stackexchange",
"id": 37302,
"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
} |
javascript, ajax
you use strict, consistently indent your code and apparently lint it too;
you correctly use scoping to provide encapsulation, split code in modules and don't use globals;
methods are small and clean, the code is easy to read.
However, if you ask me to look at it at a more conceptual level, I would argue against using such code in production. There are several reasons for this.
Firstly, in my opinion this code violates the principle of single responsibility. It doesn't separate concerns quite well, mixing AJAX, some kind of a state machine, DOM interaction and a pseudo-OOP framework in one module.
It may just be me being silly, but I don't understand what this code does, after reading it fully for several times. The individual components seem deceptively simple but I don't understand how they work together.
The usage example you provided strikes me as rather cryptic too. It looks like a state machine (machine helps), but what are S, E, J, fm? Is there some asynchronous request being made (pre and post)? Is pipe some kind of shared state? When do machine's states change?
Finally, I find naming to be hard to understand and confusing. The comments don't help because they seem to assume the reader already knows the system. This may not be the case for your team members, any new hires, or maybe even for yourself a few months down the road.
A few example that could benefit from better naming: | {
"domain": "codereview.stackexchange",
"id": 5567,
"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, ajax",
"url": null
} |
derandomization, fourier-analysis
We can also show that for every $\delta$-biased distribution $Z$ we have $\lVert Z\rVert_2^2\leq\delta^2+2^{-n}$ when considering the distribution as a vector of probabilities. Now, I was told that I can use the latter to obtain a lower bound on $|\text{Supp}(D^{(t)})|$ and then choose $t$ accordingly to get the desired bound.
However, the only bound I can get for $|\text{Supp}(D^{(t)})|$ is
$$|\text{Supp}(D^{(t)})|\geq\sqrt{\frac{1}{\epsilon^{2t}+2^{-n}}}$$
And I don't see how that helps...
You shouldn't have a square root. Namely, for every $\delta$-biased distribution $Z$ (using your notation), we have
$$
\delta^2+2^{-n} \geq \lVert Z\rVert^2_2 \geq \frac{1}{\lvert\operatorname{supp} Z\rvert}\tag{1}
$$
since the squared $\ell_2$ norm of a distribution over support of size $N$ is at least that of the uniform distribution on $N$ elements, which is $1/N$.
This gives you, for $t\geq 1$ to choose suitably,
$$\lvert\operatorname{supp} D^{(t)}\rvert \geq \frac{1}{\varepsilon^{2t}+2^{-n}} \tag{2}
$$
since as you have shown $D^{(t)}$ is $\delta$-biased for $\delta=\varepsilon^t$. A natural choice of $t$, in view of (2), is the one balancing the denominator, i.e., such that $\varepsilon^{2t}=2^{-n}$. This leads to taking
$$ | {
"domain": "cstheory.stackexchange",
"id": 4543,
"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": "derandomization, fourier-analysis",
"url": null
} |
-
Do I understand it right that $\mathrm{gcd}:\mathbb{Z}\times\mathbb{Z}\to\mathbb{Z}$ is right adjoint of the diagonal function from $\mathbb{Z}$ to $\mathbb{Z}\times\mathbb{Z}$, if $\mathbb{Z}$ is ordered by the `divisibility' relation? – Egbert May 21 '12 at 20:52
@Egbert That would make a good question. I recommend that you post it, since it wouldn't get much exposure buried here in the comments. Was your question sparked by my recent answer here and/or its link here? – Bill Dubuque May 21 '12 at 20:56
I added the question. Yes, I followed the links in these answers. I find the approach with the universal property illuminating for both my understanding of adjoints and elementary number theory. – Egbert May 21 '12 at 21:19
@BillDubuque Can you suggest an article/reference that discusses this category-theoretic view of number theory in detail? – ItsNotObvious Jun 2 '12 at 2:14
An alternate route: We show that, if $ax+by=1$ and $m$ is divisible by $a$ and $b$ then $m$ is divisible by $ab$. (Then apply this with $b=a+1$, $x=-1$ and $y=1$.)
Proof: Let $m=ak=bl$. Then $ab(xl+ky)=(ax+by)m=m$. QED
The point here is that the hypothesis $\exists_{x,y}: ax+by=1$ is often easier to use than $GCD(a,b)=1$. The equivalence between these two is basically equivalent to unique factorization, and you can often dodge unique factorization by figuring out which of these two you really need. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969689263265,
"lm_q1q2_score": 0.8196555420091772,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 393.931833529309,
"openwebmath_score": 0.9142512083053589,
"tags": null,
"url": "http://math.stackexchange.com/questions/3118/if-a-mid-m-and-a-1-mid-m-prove-aa-1-m/3149"
} |
electric-circuits, electrical-resistance, electrical-engineering, batteries
Title: Voltage of a battery in a circuit with an infinite resistance I have a dilemma that I would like to share with you concerning batteries (without neglecting internal resistance), emf and resistance of a circuit.
To better visualize my question you may need to check these pictures:
-First, I'm trying to grasp the concept of why and how the voltage drop at the terminals of a battery depends on the resistance of the circuit.
-Second, knowing that $$\epsilon= V_b + V_c$$ (battery and circuit, respectively), we know that $$\epsilon=I(R+r)$$
Considering the extreme cases where $R=0$ and $R=∞$,
what I expected was that at $R = ∞$, the voltage would be 0, because there would be infinite resistance and zero current, and since $V=RI$, it would be $V= ∞ \times 0=0$ which makes absolutely no sense to me. Plus, an ideal voltmeter has an infinite resistance but it does not give a voltage reading of zero when its terminals are placed on the battery terminals.
What am I doing wrong, and how do the charges on the poles of the battery act in each of these cases?
I'm sorry I could not be clearer in how to propose the question but I hope that it is enough. I'm still learning so do not rely on any of my assumptions. At R→∞ voltage won't be 0 but little
less than EMF off cell, since a series
circuit with voltmeter and battery is
complete.
Yes, voltage across resistor reaches
0.Voltmeter reading is not EMF
because it draw some current which
pass through internal r and gets some
potential across it.
An Ideal voltmeter cannot tell you
voltage across resistance in practical. | {
"domain": "physics.stackexchange",
"id": 28213,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "electric-circuits, electrical-resistance, electrical-engineering, batteries",
"url": null
} |
homework-and-exercises, fluid-statics, bernoulli-equation
You ignore the area of the hole.
Rate of water going in: $r'= \frac{0,2cm^3}{s}$
Rate of water going out: $r=1mm^2*\sqrt{2gh}$
Set the two rates equal and solve for $h$
$\frac{0,2cm^3}{s} = 1mm^2*\sqrt{2gh}$
$\frac{0,2cm^3}{s*0,01cm^2} = \sqrt{2gh}$
$\frac{20cm}{s} = \sqrt{2gh}$
The units work out correctly
I will leave the rest to you
Hint square both sides
Solving for the $t$ in $h(t)$ would be a more complex | {
"domain": "physics.stackexchange",
"id": 45797,
"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, fluid-statics, bernoulli-equation",
"url": null
} |
The area of the square in both the cases $= 1^{2} = 1$
Now, we can find the areas of unshaded regions.
• $\text{Case M:}$
• The area of unshaded regions $= 1-4\pi\text{R}^{2} = 1 – 4\pi \left(\frac{1}{4}\right)^{2} = 1 – \frac{\pi}{4}$
• $\text{Case N:}$
• The area of unshaded regions $= 1-9\pi\text{r}^{2} = 1-9\pi \left(\frac{1}{6}\right)^{2} = 1 – \frac{\pi}{4}$
$\therefore$ The ratio of the areas of unshaded regions of $\text{case M}$ to that of $\text{case N}$ is $1:1.$
Correct Answer $:\text{B}$
${\color{Magenta}{\textbf{PS:}}}$
• ${\color{Green}{\text{The area of square} = \text{(side)}^{2}}}$
• ${\color{Lime}{\text{The area of circle} = \pi \times (\text{radius})^{2}}}$
18.0k points 4 7 16
4 7 16 | {
"domain": "gateoverflow.in",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9891815523039174,
"lm_q1q2_score": 0.8040733463070767,
"lm_q2_score": 0.8128673087708699,
"openwebmath_perplexity": 406.1522294214908,
"openwebmath_score": 0.8957229852676392,
"tags": null,
"url": "https://me.gateoverflow.in/2212/gate-mechanical-2022-set-2-ga-question-10?show=2236"
} |
gazebo, ros-melodic
so.transport_hints = ros::TransportHints().unreliable();
Originally posted by rezenders with karma: 122 on 2020-07-14
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 35278,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, ros-melodic",
"url": null
} |
# If the complement of the universal set is the null set, then the null set is not in the universal set?
Let $\Omega$ be the universal set (which contains all objects of interest) and let its complement be denoted by $\Omega^c$ . The book I'm reading states that $\Omega^c = \phi$ ; does that mean $\phi \not\subset \Omega$?
-
$\in\ne\subset$ – Andres Caicedo Dec 21 '12 at 22:58
No, the empty set is a subset of every set (every element of the empty set is contained in any other set). – copper.hat Dec 21 '12 at 23:05
@Jacob : No, and it is not precisely because the empty set is empty. Being in both $\Omega$ and $\Omega^c$ implies being in $\phi$. Nothing is wrong with that. – Patrick Da Silva Dec 21 '12 at 23:07
It would be if the empty set had any elements. – Michael Albanese Dec 21 '12 at 23:07
@Jacob : The complement of a set $A \subseteq \Omega$ is defined as the elements of $\Omega$ that are not in $A$. So of course, $A \cap A^c = \varnothing$. This is also true if $A = \Omega$. (Note that being a subset of $A$ and $A^c$ implies being a subset of $A \cap A^c$, so that this answers your last comment.) – Patrick Da Silva Dec 21 '12 at 23:13
## 1 Answer | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759643671934,
"lm_q1q2_score": 0.8064655584297442,
"lm_q2_score": 0.8221891327004133,
"openwebmath_perplexity": 120.65599672245148,
"openwebmath_score": 0.8711368441581726,
"tags": null,
"url": "http://math.stackexchange.com/questions/263447/if-the-complement-of-the-universal-set-is-the-null-set-then-the-null-set-is-not"
} |
3, ..., n} and counting separately (a) the k-element groupings that include a particular set element, say "i", in every group (since "i" is already chosen to fill one spot in every group, we need only choose k − 1 from the remaining n − 1) and (b) all the k-groupings that don't include "i"; this enumerates all the possible k-combinations of n elements. + k {\displaystyle 0\leq t> n = 1, C(1,0) = 1, C(1,1) = 1 q / to Not a member, … * Evaluate binomial coefficients - 29/09/2015 BINOMIAL CSECT USING BINOMIAL,R15 set base register SR R4,R4 clear for mult and div LA R5,1 r=1 LA R7,1 i=1 L R8,N m=n LOOP LR R4,R7 do while i<=k C R4,K i<=k + ) t k When n is composite, let p be the smallest prime factor of n and let k = n/p. {\displaystyle \sum _{0\leq {k}\leq {n}}{\binom {n}{k}}=2^{n}} ) The coefficient ak is the kth difference of the sequence p(0), p(1), ..., p(k). For example, if n ( {\displaystyle \Gamma } . A more efficient method to compute individual binomial coefficients is given by the formula. In the special case n = 2m, k = m, using (1), the expansion (7) becomes (as seen in Pascal's triangle at right). It is the coefficient of the xk term in the polynomial expansion of the binomial power (1 + x)n, and is given by the formula, For example, the fourth power of 1 + x is. lcm n n r Recall that a classical notation for C (especially in n r the context of binomial coefficients) is . + 1 N For natural numbers (taken to include 0) n and k, the binomial coefficient k n equals pc, where c is the number of carries when m and n are | {
"domain": "thompsoncontractfurnishings.ca",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357237856482,
"lm_q1q2_score": 0.8920226389726097,
"lm_q2_score": 0.9086178870347124,
"openwebmath_perplexity": 1782.271509811245,
"openwebmath_score": 0.9126318097114563,
"tags": null,
"url": "https://thompsoncontractfurnishings.ca/femme-fatale-vzyibej/binomial-coefficient-c-e0c584"
} |
quantum-mechanics, quantum-interpretations, measurement-problem
Another proof is the existence of accelerators which create the beams that we can scatter against targets, as in picture, or against each other and study the results statistically. That is how the standard model of particle physics was built up, studying trajectories.
Trajectories are saved by the HUP, the Heisenberg Uncertainty Principle, which given enough momentum can always be fulfilled as the bubble chamber picture shows. Within its bound lie the bound states of atoms , and there we speak of orbitals, not orbits.
Everything is quantum mechanical, and the HUP is the measure of whether classical concepts and mechanics are applicable or not. So in your example the electron can be generated in a small accelerator and approach with a known trajectory a potential well of an ion up to the point of closenes where the indeterminacy of the HUP destroys the concept of a trajectory and the probabilistic form will apply. | {
"domain": "physics.stackexchange",
"id": 88065,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, quantum-interpretations, measurement-problem",
"url": null
} |
gazebo, simulation, kinect, turtlebot
190, 0, 0, 128, 63, 0, 0, 128, 63, 54, 7, 14, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 248, 144, 13, 191, 153, 61, 22
1, 190, 0, 0, 128, 63, 0, 0, 128, 63, 186, 26, 13, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 125, 164, 12, 191, 153, 6
1, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 63, 46, 12, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 1, 184, 11, 191, 153,
61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 195, 65, 11, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 133, 203, 10, 191,
153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 72, 85, 10, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 10, 223, 9, 19
1, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 204, 104, 9, 191, 153, 61, 221, 190, 0, 0, 128, 63, 0, 0, 128, 63, 142, 242, 8
, 191, 153, ...
There are just this two warnings in rxconsole...
gazebo_ros_camera simulation does not support non-zero distortion parameters right now, your simulation maybe wrong.
and
Message from [/gazebo] has a non-fully-qualified frame_id [kinect_depth_optical_frame]. Resolved locally to [/kinect_depth_optical_frame]. This is will likely not work in multi-robot systems. This message will only print once.
Used launch files: | {
"domain": "robotics.stackexchange",
"id": 7569,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "gazebo, simulation, kinect, turtlebot",
"url": null
} |
ibm-q-experience, error-correction, noise, decoherence
Title: IBM Q calibration parameters If I download calibration of a quantum processor on IBM Q website I see these parameters:
T1
T2
frequency (GHz)
readout error
single qubit U2 error rate
CNOT error rate
T1 and T2 are relaxation and dephasing times, respectively.
What are the other parameters?
frequency (GHz): The frequency(energy) associated with the transition between the qubit's ground state ($|0\rangle$) and first excited state ($|1\rangle$).
readout error: The probability of preparing a $|0\rangle$($|1\rangle$) and measuring a $|1\rangle$($|0\rangle$), ie., of having an error in your readout
single qubit U2 error rate: The average error per gate of a single qubit gate, this is $1 - \mathrm{average\_gate\_fidelity}$.
CNOT error rate: The average error per gate of a two-qubit gate. | {
"domain": "quantumcomputing.stackexchange",
"id": 1332,
"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": "ibm-q-experience, error-correction, noise, decoherence",
"url": null
} |
The bound $$2mM$$ is attained if $$a_1=\cdots=a_m=M$$, $$b_1=\cdots=b_m=0$$, $$a_{m+1}=\cdots=a_{2m}=0$$, $$b_{m+1}=\cdots=b_{2m}=M$$, and $$a_{2m+1}=b_{2m+1}=0$$ in the case when $$n$$ is odd.
So, the maximum value of $$S$$ (both with and without the constraint that the $$a_i$$'s and $$b_i$$'s be integers) is $$2mM=2\lfloor n/2\rfloor M$$.
Remark. This solution holds if "positive integers" is understood as "nonnegative integers". If "positive integers" is understood as "strictly positive integers", then we can replace $$a_i$$, $$b_i$$, and $$M$$ by $$a_i-1$$, $$b_i-1$$, and $$M-1$$, respectively, to get nonnegative integers $$a_i-1\in[0,M-1]$$ and $$b_i-1\in[0,M-1]$$. In that case, the maximum will therefore be $$2m(M-1)=2\lfloor n/2\rfloor(M-1)$$; here it is assumed that $$M$$ is a strictly positive integer; otherwise, $$M$$ has to be replaced by $$1\vee\lfloor M\rfloor$$. | {
"domain": "mathoverflow.net",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676430955554,
"lm_q1q2_score": 0.8009512623249776,
"lm_q2_score": 0.8175744784160989,
"openwebmath_perplexity": 215.62491198149348,
"openwebmath_score": 0.9816628098487854,
"tags": null,
"url": "https://mathoverflow.net/questions/313390/is-it-possible-to-find-the-maximum-value-of-a-sum-of-absolute-differences"
} |
javascript, design-patterns, api, modules, fluent-interface
let scatter = function(range) {
currentNumber = Math.floor((currentNumber + (Math.random() * range * 2) - range) + 1);
return this;
}
let randomize = function(number) {
currentNumber = Math.floor(Math.random() * currentNumber);
return this;
}
let atleast = function(number) {
currentNumber = currentNumber < number ? number : currentNumber;
return this;
}
let add = function(number) {
currentNumber += number;
return this;
}
let subtract = function(number) {
currentNumber -= number;
return this;
}
let show = function() {
console.log(currentNumber);
return this;
}
let getNumber = function() {
gotNumber = false;
return currentNumber;
}
let isCurrentNumber = function() {
console.log("Currently the gotNumber variable is: " + gotNumber);
}
return {
// chainable
scatter,
number,
atleast,
randomize,
add,
subtract,
show,
// non-chainable
getNumber,
isCurrentNumber
}
})();
let a = gMath.number(10)
.scatter(50)
.getNumber();
console.log(a) // --> logs a Number between -40 and 60 Not using prototypes is completely fine. It can be advantageous at times to make use of them, but I agree that there is not much / any advantage to using them in this case.
If an error occurs, you should throw the error. Just logging it and moving on can result in some incredibly confusing behavior.
The biggest issue I see with using this code as an API is the inability use more than one number at once. If I want to use it to generate multiple numbers at once I can't. As a consumer of the library I would expect the following to work.
let a = gMath.number(50).scatter(50);
// Scatter twice by the same number
let b = a.scatter(a.getNumber()).scatter(a.getNumber()).getNumber(); | {
"domain": "codereview.stackexchange",
"id": 27233,
"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, design-patterns, api, modules, fluent-interface",
"url": null
} |
c++, file, stream, vectors
while(std::getline(ifs, s, '\0')) {
v.push_back(s);
}
There are a few ways of signalling that an error has occurred - throwing an exception is one possibility. Returning a pair<vector<string>, bool> or pair<vector<string>, int> indicating either success (for bool) or number of characters read (for int) is another possibility - this is basically an "error code" way of dealing with the problem. Error handling is always tricky, unfortunately.
Either way, currently you return a vector whatever happens, so you might as well construct it outside the if test:
ifstream ifs(filename, ifstream::in);
vector<string> v;
if(ifs) { ... }
return v;
What happens that it calls the ifstream's operator void*() which tests all error flags and eof, returning a nullptr if any of them are set, otherwise a non-zero pointer. See also std::getline returns. | {
"domain": "codereview.stackexchange",
"id": 3142,
"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++, file, stream, vectors",
"url": null
} |
atomic-physics, schroedinger-equation, quantum-chemistry
Consider how we might move two orbitals farther away from each other without also moving them farther from the nucleus (which would be counterproductive). One way to do this is to concentrate one of the orbitals on one side of the nucleus and to concentrate the other one on the other side. We can do this without moving either one farther from the nucleus. Therefore, this should decrease $\psi(W)$ without changing $\psi(V)$. On the other hand, it will increase $\psi(K)$, because now each orbital is concentrated in a smaller volume (which forces the momenta to be larger). After making such a change, we might be able to optimize its effect a little more by adjusting the overall scale as explained above. If the net effect of these changes is to reduce the energy overall, then the optimal Slater determinant must already exploit something like this.
Such a configuration seems asymmetric, but that's not necessarily a problem. Even if we expect the true ground state to have some special symmetry, the optimal Slater determinant does not necessarily need to have that same symmetry. It only needs to belong to a family of equally-optimal Slater determinants that collectively have that symmetry. Given one member of that family, we can average over rotations to construct a more symmetric state (which will no longer be a single Slater determinant), which may then be a better approximation to the true ground state, but the intuition described below suggests that this averaging might not change the energy much.
How much better can a superposition of Slater determinants be?
Despite the compact notation, an expectation value $\psi(\cdots)$ is quadratic in the wavefunction. Using bra-ket notation, we can write
$$
\newcommand{\ra}{\rangle}
\newcommand{\la}{\langle}
\psi(\cdots)\equiv\frac{\la\psi|\cdots|\psi\ra}{\la\psi|\psi\ra}.
\tag{11}
$$ | {
"domain": "physics.stackexchange",
"id": 71733,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "atomic-physics, schroedinger-equation, quantum-chemistry",
"url": null
} |
c#, unit-testing, nunit
//Assert
exception.Message.ShouldBe($"negatives not allowed '{negativeNumbers}'");
}
[Test]
[TestCase("1001", ExpectedResult = 0)]
[TestCase("1,1001", ExpectedResult = 1)]
[TestCase("1\n1001", ExpectedResult = 1)]
[TestCase("//$\n1,1001", ExpectedResult = 1)]
[TestCase("//$\n1$1001", ExpectedResult = 1)]
[TestCase("//$\n1$2,1001", ExpectedResult = 3)]
public int Returns_CorrectSum_When_Ignoring_Numbers_Greater_Than_1000(string numbers)
{
return Act_CalculateNumbers(numbers);
}
[Test]
[TestCase("//[$$][££]\n1££1", ExpectedResult = 2)]
[TestCase("//[$$][££]\n1$$1££1", ExpectedResult = 3)]
[TestCase("//[$$][££]\n1$$1,1££1", ExpectedResult = 4)]
[TestCase("//[$$$][£££]\n1$$$1,1\n1£££1", ExpectedResult = 5)]
public int Returns_CorrectSum_With_Custom_Delimiters_Of_Any_Length(string numbers)
{
return Act_CalculateNumbers(numbers);
}
}
Implementation:
public class StringCalculator
{
private readonly List<string> _defaultDelimiters = new List<string> { ",", "\n" };
private const int StartIndexOfNumbersWithCustomDelimiter = 3;
private const int StartIndexOfCustomDelimiter = 2;
private const int MaxNumberLimit = 1000;
private const string CustomDelimiterIdentifier = "//";
public int Add(string numbers)
{
if (string.IsNullOrEmpty(numbers)) return 0; | {
"domain": "codereview.stackexchange",
"id": 19987,
"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#, unit-testing, nunit",
"url": null
} |
ros, arduino, rosserial, rosserial-python
Title: Errors in connecting an Arduino to Ros Groovy
I'm trying to get an Arduino Uno hooked up to Ros Groovy; I've been following the Hello World tutorial for rosserial_arduino. When running
rosserial_python serial_node.py /dev/ttyACM0
I'm able to connect for a second, and I start getting the error:
[ERROR] [Walltime: ...] Lost sync with device, restarting...
I noticed my Arduino code is still running even though it lost connection (I have a flashing LED indicator). Its not publishing anything to "Chatter" however - not even once before it disconnects.
Please let me know how I might be able to fix this!
Thanks!
Originally posted by asriraman93 on ROS Answers with karma: 75 on 2013-07-09
Post score: 0
Hi there, I've come to a similar situation in ROS Indigo. This was mostly due to having the Arduino IDE open with the Serial Port open.
After I uploaded the code to the arduino and closed the IDE and restarted the rosserial server the error was gone.
Originally posted by bpinaya with karma: 700 on 2017-10-27
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 14855,
"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, arduino, rosserial, rosserial-python",
"url": null
} |
infinite-impulse-response, downsampling, finite-impulse-response, linear-phase
Title: Downsampling lowpass filter for audio: FIR or IIR? I'm working on a real-time audio processing project in which I have to downsample a 44.1 kHz to a yet-to-be-determined lower sampling rate essentially for reducing computational complexity. I'm looking for a decent downsampling filter, and I found articles suggesting both IIR (mainly elliptic) and FIR (mainly minimum phase). FIR minumum phase filter wouldn't necessarily work for me, because I need a linear phase filter. So the options are either linear phase FIR that could have a considerable latency in it or a double-filtering IIR (MATLAB filtfilt command) that first filters forward then backward.
What are some pros and cons of FIR and IIR as downsampling filters? Which is more practical in a real-time application? If linear phase is a requirement, that will probably steer you toward an FIR implementation. It is possible to build IIR filters that have approximate linear phase, but it is easy to design a linear-phase FIR.
If you're concerned about latency, forward-backward filtering as in filtfilt isn't really a good option. In general, it's really meant to be used an offline process, since to implement the technique exactly, you have to run the entire signal through forward, then do the same in reverse. That implies that you have access to the entire signal at once, which is not commensurate with low delay.
In general, an FIR filter will require a higher order for a given set of performance requierments. However, FIR filters bring some real advantages, such as guaranteed stability, lower susceptibility to roundoff errors (since the quantization error doesn't get fed back through the filter, although you can compensate for this with some increased complexity), and simply-achieved linear phase response. In addition, efficient FIR filter implementations are available for many processor architectures, mitigating the cost of the extra taps somewhat. | {
"domain": "dsp.stackexchange",
"id": 1519,
"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": "infinite-impulse-response, downsampling, finite-impulse-response, linear-phase",
"url": null
} |
general-relativity, time-travel, wormholes
Title: Are Asimov's short duration spacetime "jumps" feasible? In books of science fiction (Asimov) I saw the fancy idea of a "jump" over a space-time interval, (i.e. at superluminal velocity and for a VERY SHORT time). The result was landing in another region of the galaxy, that during a human life one has no chance to reach.
Can someone imagine that this fictional idea can become, some day, realistic?
Or, putting in negative form, are we DOOMED to remain exclusively in the neighborhood of our solar system? Given that our Sun is a yellow star (not young) and continuously aging, in a couple of millions of years the life on our solar system will become impossible.
I don't deal with general relativity, s.t. my question is surely naïve. Though, an answer like "light-velocity cannot be surpassed", would be trivial. In principle, general relativity allows space-time to have non-trivial topology (wormholes) or dynamics (Alcubierre drive) that could be used to 'cheat'. However, it is very likely that such things do not exist (they violate some 'reasonable' assumptions about the universe, but without a predictive theory of quantum gravity, no one can say for sure); but even if they did, it is doubtful that they could be used for travel.
So no, we're stuck with the universal speed limit $c$. However, thanks to time dilation, that's not as much of a problem as one might think - you just cannot do real-time communications or round trips (more precisely: you'd 'time-travel' to the future - the well-known twin paradox).
Logistics would be a real problem if you ever wanted to establish a galactic civilization, but imo it is a great opportunity for 'hard' sci-fi.
As long as we're speculating, I can think of 3 different approaches for interstellar travel and colonization: | {
"domain": "physics.stackexchange",
"id": 18120,
"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, time-travel, wormholes",
"url": null
} |
newtonian-mechanics, newtonian-gravity, reference-frames
when $h_0<<R$, it may be written as $$\begin{align}\sqrt{2gR^2}t \approx \sqrt{R+h_0}\left((R+h_0)\sqrt{\frac{h_0}{R}}+\sqrt{Rh_0} \right)\implies t&=\sqrt{\frac{2h_0}{g}}\left(1+\frac{h_0}{2R}\right)\sqrt{1+\frac{h_0}{R}}\\&\approx \sqrt{\frac{2h_0}{g}}\left( 1+\frac{h_0}{2R}\right)^2 \\& \approx \sqrt{\frac{2h_0}{g}}\left(1+\frac{h_0}{R}\right) \end{align}$$
But it is not the answer, instead the answer is $t=\sqrt{\frac{2h_0}{g}}\left(1+\frac{5h_0}{6R}\right)$. The author gives the below solution and gets to this answer: | {
"domain": "physics.stackexchange",
"id": 88084,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, newtonian-gravity, reference-frames",
"url": null
} |
cosmology, spacetime, universe, space-expansion
Title: Could this experiment show how big the universe really is? Thought experiment:
Entangle a pair of particles.
Package one half of each pair in a special package, and send it out in a nano-spaceship
keep the other half of the pair of entangled particles here on earth
accelerate nano-spaceship to 99.99999999999999% of the speed of light using a number of tiny cyclotrons
Due to Lorentz contraction,
$$
L = L _\text{0} \sqrt {1 - \frac {v^{2}}{c^{2}}}
$$
In one years time, the spaceship would have traveled 93B ly away from us.
After one year of travel, the spaceship could be preconfigured to detect the CMB in the direction of travel, and then trigger their quantum entangled particle to send a '0' or a '1' depending on whether the CMB was detected.
Repeat this process using any number of spaceships in any number of directions, and soon you would experimentally show how big the universe really is.
Any problems? Except sometimes in science fiction, entanglement doesn't work that way. Entanglement depends on indeterminacy. Entangled particles have a correlated property such as spin orientation, but that entanglement depends on the spin orientation of neither particle being known at the outset. Later, we can measure the spin orientation of one particle and it will tell us the spin orientation of the other (as long as nothing has perturbed either particle in a random way in the meantime). So (absent perturbations) an instrument on the spaceship could measure the spin orientation of the particle it's carrying, and then it would know the orientation of the particle left behind on Earth. But the instrument on the spaceship cannot specify the orientation of its particle; it can only measure the orientation. So, no information can be transferred across time or space via the entanglement and measurement. | {
"domain": "physics.stackexchange",
"id": 48909,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, spacetime, universe, space-expansion",
"url": null
} |
strings, html, json, groovy
<h2>Chinese mythology</h2>
<h4 style ="font-size: 1.0em; color: green;">JADE EMPEROR - 3 / 10</h4>
<ul style="list-style-type: none;">
<li><span style="font-style:italic;">"The Great Grandfather, Emperor of all Deities, Vanquisher of Evil."<span></li>
<li><ul style="list-style-type: none;">
<li>Chinese God</li>
<li>Mana cost: 30</li>
<li>Cannot attack</li>
</li></ul>
<li>Effect(s): <br/>Give creatures of type Chinese owned by you on Battlefield 3 HEALTH<br/>Give creatures on Battlefield -1 ATTACK<br/></li>
</ul>
<!-- etc. -->
Rendered: The first thing that comes to my mind when I read your code is "this would be a good job for a template engine".
File constructors
def inputFile = new File("$filePath$inputFileName")
def outputFile = new File("$filePath$outputFileName")
Java's File class has a constructor that takes two string arguments, one for the path and one for the file name. Using this constructor is much more preferred in this case:
def inputFile = new File(filePath, inputFileName)
def outputFile = new File(filePath, outputFileName)
Getting the file path
Once you have created the file object, you can use getAbsolutePath() to get the full path, or as we're using Groovy - use the absolutePath property:
if (outputFile.exists()) {
println "Overwriting existing file ${outputFile.absolutePath}"
} else {
println "Creating file: ${outputFile.absolutePath}"
} | {
"domain": "codereview.stackexchange",
"id": 14698,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "strings, html, json, groovy",
"url": null
} |
javascript, performance, memory-optimization
return this.grid[sqr];
};
//Return an array of all empty squares in form [squares]
Board.prototype.getEmptySquares = function () {
var empty = [];
for (var i = 0; i < this.dims * this.dims; i++) {
if (this.square(i) === 0) empty.push(i);
}
return empty;
};
/*Place player on the board at position (square).
player should be either the constant PLAYERX or PLAYERO.
Does nothing if board square is not empty.*/
Board.prototype.move = function (square, player) {
if (this.square(square) === 0) {
this.grid[square] = player;
}
};
/*Returns a constant associated with the state of the game
If PLAYERX wins, returns 1.
If PLAYERO wins, returns 2.
If game is drawn, returns 0.
If game is in progress, returns 'None'.*/
Board.prototype.checkWin = function () {
var winning = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]];
var self = this;
var res = 'None';
winning.forEach(function (el) {
if (self.square(el[0]) !== 0 && self.square(el[0]) === self.square(el[1]) && self.square(el[0]) === self.square(el[2])) {
res = self.square(el[0]);
} else if (res == 'None' && self.getEmptySquares().length === 0) {
res = DRAW;
}
});
return res;
};
//return a copy of the board
Board.prototype.clone = function () {
return new Board(dims, this.grid);
};
app.js
$(document).ready(function () {
var board; | {
"domain": "codereview.stackexchange",
"id": 17034,
"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, performance, memory-optimization",
"url": null
} |
organic-chemistry, amines, amides
Title: Gabriel Phthalamide Reaction Can we use acid chloride in place of alkyl chloride in Gabriel Phthalamide Reaction?
Maybe it can be used as process to synthesize amides. NO, this is not a viable way to make amides.
Phthamide anion will react with acyl halides, but the problem arises with the second step, the removal of the phthalimido group. The usual conditions described here of hydrolysis with hydroxide or reaction with hydrazine will result in removal of the acyl group to reform phthalimide plus the carboxylic acid, in the case of OH- hydrolysis, or the acyl hydrazide if using hydrazine. This is because the acyl group is the more electrophilic site for the nucleophile. | {
"domain": "chemistry.stackexchange",
"id": 11407,
"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, amines, amides",
"url": null
} |
# Velocity At Earth's Equator
darshanpatel
## Homework Statement
Earth rotates in on axis that goes through both the North and South Poles. It makes one complete revolution in 24 hours. If the distance from the axis to any location on the equator is 3960 miles, find the linear speed (in miles per hour) of a location on the equator.
-None-
## The Attempt at a Solution
I used the formula V=rw to find the linear velocity, and for 'r' I used 3960, and 'w' is used 2pi/24 for making one revolution per hour, so I simplified that down to pi/12 as angular velocity.
V=3960 x (pi/12 radians/hour)≈ 1036.73 miles/hour
Is this correct? It got checked in school, but I think I was off in the decimals or something. Is there something I did wrong or?
Thanks for any help!
Homework Helper
## Homework Statement
Earth rotates in on axis that goes through both the North and South Poles. It makes one complete revolution in 24 hours. If the distance from the axis to any location on the equator is 3960 miles, find the linear speed (in miles per hour) of a location on the equator.
-None-
## The Attempt at a Solution
I used the formula V=rw to find the linear velocity, and for 'r' I used 3960, and 'w' is used 2pi/24 for making one revolution per hour, so I simplified that down to pi/12 as angular velocity.
V=3960 x (pi/12 radians/hour)≈ 1036.73 miles/hour
Is this correct? It got checked in school, but I think I was off in the decimals or something. Is there something I did wrong or?
Thanks for any help!
Your method is correct, but check the numbers. 3690*3.14/12 is way off from your result.
ehild
darshanpatel
I re-did it, and it came out to the same? Maybe it is something you inputted into your calc, I did pi/12 first then multiplied by 3960, and it came out to this?
I don't know what I am off at? I even did it the way you wrote it out, but it still worked?
Mentor
Looks OK to me. | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9621075701109192,
"lm_q1q2_score": 0.8079144052473186,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 725.9399816714265,
"openwebmath_score": 0.7221277952194214,
"tags": null,
"url": "https://www.physicsforums.com/threads/velocity-at-earths-equator.634991/"
} |
then add these two equations, followed by multiplying both sides by 1 2 log(1. On improper integrals of products of logarithmic, power and Bessel functions. Ok, then you can use the original contour. Exponential functions are those of the form. Introduction. Integral calculus gives us the tools to answer these questions and many more. Log(value + Math. Full curriculum of exercises and videos. We are going to discuss several types of word problems. Calculates the hyperbolic functions sinh(x), cosh(x) and tanh(x). 0) Integrating both sides of this with respect to x repeatedly and arranging the results, we obtain the following higher indefinite integrals. 30 Find the rst two terms of the Taylor series for f(x) = log(1 + 2x) at x = 0. 4 Two Applications to Economics: Relative Rates and Elasticity of Demand CHAPTER 5: INTEGRATION AND ITS APPLICATIONS 5. Integration by Parts is a special method of integration that is often useful when two functions are multiplied together, but is also helpful in other ways. As a consequence, if we reverse the process, the integral of 1 x is lnx+ c. It describes a pattern you should learn to recognise and how to use it effectively. f ( x) = C e x f (x)=Ce^ {x} f(x) = Cex for a constant. Interpolation between two integrals, one is an arctan. Similarly, the app makes short work of annotations. Lognormal Probability Density Function. bian elliptic functions. Logarithmic Differentiation Algebraic manipulation to write the function so it may be differentiated by one of these methods These problems can all be solved using one or more of the rules in combination. 24-27 Feb, San Francisco. Evaluate integrals involving natural logarithmic functions: A tutorial, with examples and detailed solutions. \LIATE" AND TABULAR INTERGRATION BY PARTS 1. , since 1000 = 10 × 10 × 10 = 10 3, the "logarithm base. We tried to extend Ooura and Mori’s DE formula to a one for integrals of the Hankel transform type, that is, integrals of the form (1. Applications of Integration – Area bound by a curve. Integration by Parts. The integrand is the product of the two functions. is the period over which time population | {
"domain": "rafbis.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.992988205448513,
"lm_q1q2_score": 0.8047959925287891,
"lm_q2_score": 0.8104789040926008,
"openwebmath_perplexity": 868.1644793955845,
"openwebmath_score": 0.8654050230979919,
"tags": null,
"url": "http://rafbis.it/mzkl/integration-of-logarithmic-functions-pdf.html"
} |
homework-and-exercises, quantum-field-theory, linear-algebra, propagator
Title: Deriving photon propagator In Peskin & Schroeder's book on page 297 in deriving the photon propagator the authors say that
$$\left(-k^2g_{\mu\nu}+(1-\frac{1}{\xi})k_\mu k_\nu\right)D^{\nu\rho}_F(k)=i\delta^\rho_\mu \tag{9.57b}$$
With the solution given in the next line in equation (9.58) as
$$D^{\mu\nu}_F(k)=\frac{-i}{k^2+i\epsilon}\left(g^{\mu\nu}-(1-\xi) \frac{k^\mu k^\nu}{k^2}\right)\tag{9.58}$$
Which is the propagator. I can verify this equation by inserting $D^{\mu\nu}_F(k)$ into the first equation, but I have no idea how to actually solve $D^{\nu\rho}_F(k)$ from $(9.57b)$. If anyone can help, it would be much appreciated. $D_{\mu\nu} = A g_{\mu\nu}+B k_{\mu} k _{\nu}$ with A and B two unknown functions of the scalar k^2. The two tensor after A and B are the only possible Lorentz invariant tensors . Simply plugin and calculate the unknown functions. | {
"domain": "physics.stackexchange",
"id": 91708,
"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, linear-algebra, propagator",
"url": null
} |
formal-languages, turing-machines, computability
Title: If $A \in \mathrm{RE}$ and $A \leq_m \overline{A}$ then $A\in \mathrm{R}$ I found the following question with an answer here, but I can't understand the steps of the solution.
Show that if a language $A$ is in RE and $A \leq_m \overline{A}$, then $A$ is recursive.
Solution. Since $A \leq_m \overline{A}$, it follows that $\overline{A} \leq_m A$, and since $A$ is in RE, it follows that $\overline{A}$ is also in RE. Since both $A$ and $\overline{A}$ are in RE, it follows that $A$ is in R (this follows from a theorem you learned in class).
Here $\le_m$ demotes mapping reducibility.
Actually I can't understand most of the answer. In particular:
Why does $A \leq_m \overline{A}$ imply $\overline{A} \leq_m A$?
I understand the following step (why $\overline{A}$ is in RE).
Which theorem is used to deduce that $A$ is in R? (I'm not a student in this class)
It follows immediately from the definition of a mapping reduction that a reduction $f$ from $A$ to $B$ is also a reduction from $\overline{A}$ to $\overline{B}$. Indeed, if $f$ is a reduction from $A$ to $B$, then, in particular, $x\in A$ iff $f(x)\in B$, which is equivalent to $x\notin A$ iff $f(x)\notin B$, which is equivalent to $x\in \overline{A}$ iff $f(x) \in \overline{B}$. (I only used the fact that $x \to y$ is equivalent to $\neg y \to \neg x$). | {
"domain": "cs.stackexchange",
"id": 17481,
"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, turing-machines, computability",
"url": null
} |
computer-architecture, efficiency, cpu, cpu-pipelines
Title: About the connection of pipelined execution and latency Let's consider we want to calculate a[i]=a[i]*c for a vector the size of N=12 on some random processor.
We do assume that c is some given constant already present in the register. We do not consider any superscalarity or vectorization.
We also know the latencies for the following instructions:
Load operand to register (4 cycles)
Multiply a(i) with c (2 cycles); (a[i],c in registers)
Write back result from register to mem./cache (2 cycles)
Increase loop counter as long as i less or equal N(0 cycles)
The result my class gives me for the pipelined execution of this is the following, where each line represents one CPU cycle:
Why is this correct? Or is this even correct?
If we consider the first load (load a[1]) shouldn't it block my only load unit on the processor for 4 cycles? How can I even load a[2]in cycle 2then?
Or is latency only the time to that is needed to send information that something is e.g. loaded, and the actual load unit is only busy for one cycle for each load operation? In a processor that would nowadays be considered simple, you need two numbers for an instruction: what is the total execution time (for example 4 for load) and how long you need to wait before another independent operation can be issued - it seems that someone assumed 1 cycle between instructions for load. A different processor might only allow a load every two cycles, and your numbers would be totally different.
The PowerPC 603 was interesting in that a multiplication took 4 cycles, but it couldn’t start four multiplications in a row, so your multiplications would have started at cycles 4, 5, 6, 8, 9, 10, 12 etc.
Things get more interesting when you have multiple independent execution units; like you assume at least three units capable of load, store, and multiplication. And more interesting if you have limits decoding instructions, dispatching to execution units etc. | {
"domain": "cs.stackexchange",
"id": 17804,
"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": "computer-architecture, efficiency, cpu, cpu-pipelines",
"url": null
} |
javascript, game, ai, 2048
function maxIndex(arr){ // return the index of the max, or null if there are 2 equal max
var max=[-1,null];
for (var i=0;i<arr.length; i++){
if (arr[i]>max[0]) max=[arr[i], i];
else if (arr[i]==max[0]) max[1]=null;
}
return max[1]
}
function maxScore(nodes){
var max={score:0};
for (var node of nodes)
if (node.score>max.score)
max = node;
return max;
}
function mv(k, grid){
var tgrid = transform(ig, k, grid);
for (var i=0;i<tgrid.length;i++){
var a=tgrid[i];
for (var j=0, _j=0;j<a.length;j++)
if (a[j]!='') a[_j++] = (j<a.length-1 && a[j]==a[j+1]) ? 2*a[j++] : a[j]
for (;_j<a.length;_j++)
a[_j] = '';
}
return transform(g, k, tgrid);
}
function compact(grid){ // remove empty values [2, 4, '', 2] -> [2, 4, 2]
var ngrid=[];
for (var row of grid)
ngrid.push(row.filter(Number))
return ngrid;
} | {
"domain": "codereview.stackexchange",
"id": 12174,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "javascript, game, ai, 2048",
"url": null
} |
cosmology, spacetime, reference-frames, universe, inertial-frames
EDIT: as requested, I include an addendum to improve the answer.
The core answer to your question is "There is no notion of inertial frame in GR". The rest of my answer provided an example of a free particle (from the GR point of view) that experiences a change of velocity. This was just to show that the definition "an inertial frame is a frame where free particles move on straight lines" really makes no sense: if by straight lines you intend segments, that's not true. If you intend geodesics, that's true in every frame. Simply put, "inertial frames" do not exist in GR. | {
"domain": "physics.stackexchange",
"id": 38749,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "cosmology, spacetime, reference-frames, universe, inertial-frames",
"url": null
} |
computational-chemistry
Usually in computational chemistry the energy can be expanded into a Taylor series
$$E=E_0+\frac{\mathrm{d}E}{\mathrm{d}x}(x-x_0)+\frac{1}{2}\frac{\mathrm{d}^2E}{\mathrm{d}x^2}(x-x_0)^2+\textrm{higher order terms}\;.$$
And you can usually neglect those first order term and higher order terms for most of the practical problems. And then your PES will follow the trajectory of a harmonic oscillator. | {
"domain": "chemistry.stackexchange",
"id": 4923,
"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": "computational-chemistry",
"url": null
} |
$$p(z) = 2^m\prod_{j=1}^m \frac{z-\alpha_j}{4 - \overline{\alpha}_j z}.$$
Then $p$ is holomorphic on $D(0,2)$ and $p(\alpha_j) = 0$ for $j \in \{1, \dotsc, m\}$ and $|p(z)| = 1$ for all $z$ with $|z|=2$. Since $f(z)/p(z)$ is holomorphic on $D(0,2)$ the maximum principle says that
$$2^m\prod_{j=1}^m|\alpha_j|^{-1} = |f(0)/p(0)| \leq \max_{|z|=2} |f(z)/p(z)| = \max_{|z|=2} |f(z)| \leq 16.$$
So $2^m \leq 16 \prod_{j=1}^m |\alpha_m| \leq 16$ and therefore $m \leq 4$.
-
Is $p$ an automorphism of $D(0,2)$? – Digital Gal Oct 28 '12 at 17:33
No, but $4$ times each factor in the product is. Lookup Blaschke product for more information. – WimC Oct 28 '12 at 17:34
WimC, what was your intuition to use a Blaschke product? – Digital Gal Oct 28 '12 at 18:46
@jojo A famous result of Jensen (en.wikipedia.org/wiki/Jensen%27s_formula) that relates the distribution of zeroes to the growth of a function. – WimC Oct 28 '12 at 19:08 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9808759660443166,
"lm_q1q2_score": 0.8317511941732835,
"lm_q2_score": 0.8479677583778258,
"openwebmath_perplexity": 351.20351048164474,
"openwebmath_score": 0.8919418454170227,
"tags": null,
"url": "http://math.stackexchange.com/questions/222824/zeros-of-holomorphic-upper-bound"
} |
electromagnetism, magnetic-fields, magnetic-moment, magnetostatics, ferromagnetism
Title: How to interpret Magnetic Susceptibility as the ratio of two vectors $M$ and $H$, as division of two vectors is not defined in mathematics? Magnetic Susceptibility, denoted as χ is defined as a scalar, represents the ratio between the Magnetization vector ($\vec {M}$) and the Magnetic field strength vector ($\vec{H}$).
However, in mathematics, division of two vectors is not defined. How can we then define Magnetic Susceptibility as the ratio of two vectors? Should we consider the ratio of the x-components of M and H as $\chi_x$ or something else? The magnetic susceptibility is generally a tensor quantity (e.g. a matrix). That is the most general way to linearly transform one vector into another. When things are isotropic, the susceptibility is proportional to the identity matrix as $$\mathbf{\chi}=\chi_0 \mathbf{I}$$ and you can treat it as a scalar quantity. | {
"domain": "physics.stackexchange",
"id": 97157,
"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, magnetic-fields, magnetic-moment, magnetostatics, ferromagnetism",
"url": null
} |
ros, message, rosjava
at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)
at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
at
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)
at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
at
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at
> java.lang.Thread.run(Thread.java:722)
> Caused by:
> java.lang.NegativeArraySizeException
> at
> org.ros.internal.message.DoubleArrayField.deserialize(DoubleArrayField.java:67)
> at
> org.ros.internal.message.DefaultMessageDeserializer.deserialize(DefaultMessageDeserializer.java:47)
> at
> org.ros.internal.message.MessageFieldType.deserialize(MessageFieldType.java:87)
> at | {
"domain": "robotics.stackexchange",
"id": 9860,
"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, message, rosjava",
"url": null
} |
# Difference between revisions of "2019 AMC 10A Problems/Problem 23"
## Problem
Travis has to babysit the terrible Thompson triplets. Knowing that they love big numbers, Travis devises a counting game for them. First Tadd will say the number $1$, then Todd must say the next two numbers ($2$ and $3$), then Tucker must say the next three numbers ($4$, $5$, $6$), then Tadd must say the next four numbers ($7$, $8$, $9$, $10$), and the process continues to rotate through the three children in order, each saying one more number than the previous child did, until the number $10,000$ is reached. What is the $2019$th number said by Tadd?
$\textbf{(A)}\ 5743 \qquad\textbf{(B)}\ 5885 \qquad\textbf{(C)}\ 5979 \qquad\textbf{(D)}\ 6001 \qquad\textbf{(E)}\ 6011$
## Solution 1
Define a round as one complete rotation through each of the three children, and define a turn as the portion when one child says his numbers (similar to how a game is played).
We create a table to keep track of what numbers each child says for each round.
$\begin{tabular}{||c c c c||} \hline Round & Tadd & Todd & Tucker \\ [0.5ex] \hline\hline 1 & 1 & 2-3 & 4-6 \\ \hline 2 & 7-10 & 11-15 & 16-21 \\ \hline 3 & 22-28 & 29-36 & 37-45 \\ \hline 4 & 46-55 & 56-66 & 67-78 \\ [1ex] \hline \end{tabular}$ | {
"domain": "artofproblemsolving.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.986363166322039,
"lm_q1q2_score": 0.8132188762127621,
"lm_q2_score": 0.8244619263765707,
"openwebmath_perplexity": 841.5152253465334,
"openwebmath_score": 0.7268014550209045,
"tags": null,
"url": "https://artofproblemsolving.com/wiki/index.php?title=2019_AMC_10A_Problems/Problem_23&curid=17260&diff=151900&oldid=143467"
} |
newtonian-mechanics, gravity, angular-momentum
As they give very different relationships between distances and velocities, my question is, which of them are actually applicable to the situation. Your first two equations are correct, the third one is wrong.
The third equation you are trying to use the formula for centripetal acceleration $a=\frac{v^2}{r}$. However, this requires not only that the acceleration be purely radial (which it is, we're dealing with a central force) but also that the radial acceleration is zero. In general the acceleration in plane polar co-ordinates $(r,\theta)$ is:
$\vec{a} = (\ddot{r}-r\dot{\theta}^2)\hat{r} + (2\dot{r}\dot{\theta}+r\ddot{\theta})\hat{\theta}$
At the apopapse/periapse we have $\dot{r}=0$ not $\ddot{r}=0$, and $\vec{F}=m\vec{a}=-\frac{GM}{r^2}\hat{r}$ as you've identified. This means the correct version of your third equation should be:
$\frac{v_1^2}{r_1}-\ddot{r}=\frac{GM}{r_1^2}$. | {
"domain": "physics.stackexchange",
"id": 49734,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, gravity, angular-momentum",
"url": null
} |
convolutional-neural-networks, comparison, graphs, geometric-deep-learning
Title: What are the differences between network analysis and geometric deep learning on graphs? Both of them deal with data of graph structure like a network community. Is there a big difference there? Network analysis does not necessarily use deep learning techniques, while geometric deep learning (GDL) on graphs uses only deep learning techniques (that is, you train a neural network using gradient descent or other optimization methods). You can do some network analysis using GDL. | {
"domain": "ai.stackexchange",
"id": 1361,
"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": "convolutional-neural-networks, comparison, graphs, geometric-deep-learning",
"url": null
} |
I took the liberty to change the size of the big delimiters to \bigg, which look better in this context, in my opinion.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{aligned}[b] \int \frac{d^4 \mathnormal{k}}{(2\pi)^4}\text{log}(-k^2+m^2)&= i\int \frac{d^4 \mathnormal{k_E}}{(2\pi)^4}\text{log}(k_E^2+m^2)\\ &=-i \frac{\partial}{\partial \alpha}\int \frac{d^4 \mathnormal{k_E}}{(2\pi)^4}\frac{1} {(k_E^2+m^2)^{\alpha}}\bigg\vert_{\alpha=0}\\ &=-i \frac{\partial}{\partial \alpha} \biggl(\frac{1} {(4\pi)^{d/2}}\frac{\Gamma(\alpha-\frac{d}{2})} {\Gamma(\alpha)}\frac{1}{(m^2)^{\alpha-\frac{d}{2}}} \biggr) \bigg \vert_{\alpha=0}\\ & = -i\frac{\Gamma(\frac{-d}{2})}{(4\pi)^{d/2}}\frac{1}{(m^2)^{- d/2}} \end{aligned} \tag{11.72}.
\end{document}
There is an option tbtags to the amsmath package that does this for you:
\documentclass{article}
\usepackage[tbtags]{amsmath}
\begin{document} | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9759464443071381,
"lm_q1q2_score": 0.8314603077984759,
"lm_q2_score": 0.8519528019683105,
"openwebmath_perplexity": 3305.2877667545945,
"openwebmath_score": 0.8839635848999023,
"tags": null,
"url": "https://tex.stackexchange.com/questions/462305/how-to-put-equation-number-at-the-bottom"
} |
ros, ardrone-autonomy
Not really sure what you're getting at here.
Originally posted by jayess with karma: 6155 on 2016-03-31
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 19130,
"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, ardrone-autonomy",
"url": null
} |
newtonian-mechanics, group-theory, galilean-relativity
What suppose to mean, physically, the $t+s$ (I mean: $t'=t$?) and $\textbf{a}$ (on $\textbf{x+a}$) on translation? And why we are considering rotations (I mean, these kind of motion are non inertial)? The transformations you're thinking of as "Galilean Transformations" are, more properly, termed the Galilean boosts; while the others are translations and rotations. A boost is a change from one inertial frame to another that is moving with respect to it - those are the transforms you're not asking about.
The ones you're asking about are the rotations, spatial and temporal translations. In this context "rotation" does not mean setting anything into spinning motion, but means reorienting it. Together with spatial translations, rotations comprise the classical transformations of Euclidean geometry.
Two figures, in Euclidean geometry, are considered congruent exactly when either can be moved onto the other, so as to coincide with it, by repositioning it (spatial translations) and reorienting it (rotations). Depending on which geometry author you read, taking mirror images may also be considered as a congruency, though it really shouldn't. A left-handed trefoil knot and right-handed trefoil knot cannot be moved, either into the other. In 2D it's sorta okay, since you can move a 2D figure into its mirror image by flipping it over in the third dimension; the same for 1D figures. But you can't flip a left hand to become a right hand, or vice versa ... unless you're in the middle of an episode of The Outer Limits and have a fourth spatial dimension available. (That was in one of the episodes.)
The definition of "congruence" by "transform to coincide" is the original approach to the subject that Euclid, himself, took in his ancient monograph on Euclidean geometry.
If you allow change of scale as a transformation, then the corresponding concept lightens up from outright "congruence" to "similarity". Two figures are similar if they can be rescaled so as to become congruent. | {
"domain": "physics.stackexchange",
"id": 92537,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "newtonian-mechanics, group-theory, galilean-relativity",
"url": null
} |
= f mean + A sin((2π/ N ) ux + θ) look like:. This MATLAB function returns the phase angle in the interval [-π,π] for each element of a complex array z. (This is a MATLAB function. Absolute Value of a Complex Number The absolute value of a complex number , a + b i (also called the modulus ) is defined as the distance between the origin ( 0 , 0 ) and the point ( a , b ) in the complex plane. 4 Complex numbers One of the strengths of MATLAB is that most of its commands work with complex numbers, too. Complex Number Manipulation. Another way to see it is that complex numbers have only two degrees of freedom, while 2×2 matrices have four degrees of freedom. (1) write a MATLAB function that returns a sinusoid of a desired frequency and phase. Images below show what x -directed sinusoidal variations of grey values in a synthetic greyscale image f(x,y) = f mean + A sin((2π/ N ) ux + θ) look like:. Determine the real part and the imaginary part of the complex number. This toolbox should already be installed on the lab computers. number9dream's method is probably better, given your stated problem. In other words, plot the. A combination of a real and an imaginary number in the form a + bi a and b are real numbers, and i is the "unit imaginary number" √(−1) The values a and b can be zero. Complex signal, formed from the magnitude and phase angle you specify. The product of a nonzero complex number with its inverse equals 1, since rejq 1 r ej(q) = 1. Validation of the model has been carried out by using MATLAB/Simulink. I am currently trying to create a band stop filter which attenuates frequencies between 2000Hz and 8000Hz. Complex matrix matlab keyword after analyzing the system lists the list of keywords related and the list of websites with related content, in addition you can see which keywords most interested customers on the this website. Learn MATLAB Courses in Bangalore. • Use the values for 𝐾+ and 𝑇- found in a previous Tasks. Only the sine-wave analysis function needs to be rewritten, and it appears in Fig. I'm filtering a real | {
"domain": "iwen.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9664104962847373,
"lm_q1q2_score": 0.8010951692235778,
"lm_q2_score": 0.8289388125473629,
"openwebmath_perplexity": 737.8790262700554,
"openwebmath_score": 0.6594741940498352,
"tags": null,
"url": "http://yzkr.iwen.pw/phase-of-complex-number-matlab.html"
} |
ros, rosdep, offline
Originally posted by gvdhoorn with karma: 86574 on 2017-11-30
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gaurav on 2017-12-04:
all those solutions don't seem to provide any help. I have tried editing sources.list files and downloading the necessary .yaml files and also provided them with local paths. But still the problem persists. It appears like rosdep has not been updated yet.
Comment by gvdhoorn on 2017-12-04:\
all those solutions don't seem to provide any help.
That's rather vague, and not something I can act on.
Could you please update your original question text (edit it and place an update below the current text) with the steps you took and the output of the commands you're trying to use? | {
"domain": "robotics.stackexchange",
"id": 29482,
"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, rosdep, offline",
"url": null
} |
thermodynamics, enthalpy, free-energy
Is this understanding correct? Or does ΔH change throughout a reaction like ΔG?
The enthalpy H of the system changes throughout the reaction. Because the enthalpy is not concentration-dependent, it changes in a linear way with the amount that reacts. There are two versions of $\Delta H$ with different dimensions and units. One does what you say: compare H between two states. It has dimensions of energy (typical units: kJ). The other asks what the change of enthalpy is per amount reacted. It has dimensions of energy per amount (typical units: kJ/mol) and is called molar change in enthalpy.
An example is the molar enthalpy of formation. If you want to know how big the enthalpy change is to make a certain amount of a compound, you multiply the amount by the molar enthalpy of formation. The dimensions of the result will be energy again (units: kJ / mol * mol = kJ). Introductory textbooks sometimes gloss over the difference between molar (intensive) and extensive enthalpies.
If ΔG gives information about a specific point in the reaction, then why is there a "Δ" at all? | {
"domain": "chemistry.stackexchange",
"id": 11775,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "thermodynamics, enthalpy, free-energy",
"url": null
} |
quantum-mechanics, condensed-matter, symmetry, topological-order, spin-models
Of cause, you may restrict the discussion of spin liquid to the spin rotational symmetric cases, i.e. the spin-SO(3) symmetric spin liquid, which is just a subclass of all spin liquids, and indeed Kitaev spin liquid does not belong to this subclass. However, it is possible to write down a variation of the Kitaev model which is spin-SO(3) symmetric, and the resulting ground state is a spin-SO(3) symmetric spin liquid. | {
"domain": "physics.stackexchange",
"id": 7907,
"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, condensed-matter, symmetry, topological-order, spin-models",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.