text stringlengths 1 1.11k | source dict |
|---|---|
master-theorem
Title: Could I apply the master theorem if my $N/b$ is $\varphi(N)$? Let
$$T(N) = \begin{cases}1 & \text{if } N = 1\\
T(\varphi(N)) + \lg(\varphi(N))^3 & \text{otherwise}
\end{cases}$$
where $\varphi(N)$ is Euler's totient function.
Can I somehow express $\varphi(N)$ as $N/b$, so I can apply the Master Theorem and resolve this recurrence?
You may assume $\varphi(N) = (p-1)(q-1)$, if it's easier that way. You may also assume, if it helps, that $p$, $q$ are safe primes, that is, $p = 2p' + 1$ and $q = 2q' + 1$. (Assume anything that makes the problem easier. For instance, you can replace the function $\lg^3(\varphi(N))$ with any other that makes the problem easier, but do so only as a last resort.) You can not apply the master theorem directly. However, you can play with your expression a bit to get an upper bound on which you can then apply the master theorem.
First, show that $\phi(\phi(n)) < n/2$. This can be done as such: | {
"domain": "cs.stackexchange",
"id": 14513,
"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": "master-theorem",
"url": null
} |
quantum-mechanics, double-slit-experiment, epr-experiment, quantum-eraser
Scenario 4: Alice decides Bob is unreliable and defines an even more complicated apparatus that measures the spin and position of her electrons, by putting another Stern-Gerlach apparatus after the double-slit, so that the different interference patterns would be shifted on an orthogonal axis on the screen. What effect can Bob, who has gone rogue, have on Alice's result? If he measures the electron's spin prior to Alice's measurements, as in Scenario 1, surely Alice would not see an interference pattern. What if he measures them at different sorts of intervals relative to Alice, with-and-without applying a Hadamard gate? | {
"domain": "physics.stackexchange",
"id": 77550,
"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, double-slit-experiment, epr-experiment, quantum-eraser",
"url": null
} |
hydrology, hydrogeology, underground-water
Title: How are aquifers found and traced? Recently a line from a news article about an aquifer in the path of a tunnel boring machine for Metro networks caught my attention:
Ahead of tunnelling, the builders conduct hydrogeology, a study of water flow in aquifers and characterization of
aquifers. During our study, the aquifer wasn’t identified,” said an engineer. | {
"domain": "earthscience.stackexchange",
"id": 1838,
"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": "hydrology, hydrogeology, underground-water",
"url": null
} |
microbiology, bacteriology, food
Title: Why don't bacteria eat food leftovers? I have thrown a dirty spoon after eating some pasta into one of my desk drawers (doesn't do me much honor). It stayed there for around a year. My house is warm and I think there is enough humidity for bacteria to multiply, however I have found it today with seemly same amount of food on it when I left it.
I assume given enough time all food should get converted into bacteria (bacteria would eat and multiply until food is there and stop when it is all consumed). Is this assumption incorrect?
Why didn't bacteria decomposed the food on my spoon?
EDIT: This question has nothing to do with fried McDonald foods and is referring to bacteria consuming 'ordinary' food, plus I am asking if food should disappear completely while the other question is about it being decomposed, answers are completely different. First, your assumption is wrong. Bacteria multiplication is not limited by food availability only, it is one of many constraints. | {
"domain": "biology.stackexchange",
"id": 4634,
"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": "microbiology, bacteriology, food",
"url": null
} |
computability, halting-problem
\begin{equation}
\psi^{(1)}_{\mathcal P}=
\begin{cases}
\text{undefined} \;\;\; \text{if HALT}(x,x) \\
0 \;\;\;\;\;\;\;\;\;\;\;\;\;\;\text{if ~HALT}(x,x)
\end{cases}
\end{equation}
I don't understand how $\psi^{(1)}_{\mathcal P}$ is undefined if $\text{HALT}(x,x)$ is true, shouldn't $Y$ be equal to $0$ by default and moreover how could a non-terminating program be defined can have $0$ as output value. What am I missing here?
Edit: $\psi^{(1)}_{\mathcal P}(x)$ is the value of the output variable $Y$ at the terminal snapshot. Let's walk through the proof given by [Davis94]. I am familiar with this text and have it in front of me. The HALT predicate is defined:
$$
HALT(x,y) \Longleftrightarrow \text{program number $y$ eventually halts on input $x$.}
$$ | {
"domain": "cs.stackexchange",
"id": 921,
"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, halting-problem",
"url": null
} |
quantum-mechanics, hilbert-space, wavefunction, quantum-states
Title: Interpretation of the vector space in notation bra ket I have read all of the question related to "bra-ket" but no one seems to take the same perspective as I am going to try to give. I know it might be a rather simple and short question, but I need to understand this to continue studying quantum mechanics (I'm new to this subject). Here's how I understand it: | {
"domain": "physics.stackexchange",
"id": 99545,
"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, hilbert-space, wavefunction, quantum-states",
"url": null
} |
c++, calculator
that every module, class, or function should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by that module, class or function. | {
"domain": "codereview.stackexchange",
"id": 37688,
"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++, calculator",
"url": null
} |
general-relativity, black-holes, observers, event-horizon
It's a routine process we observe at many places. For example, the black hole at the galactic center devours new matter all the time.
Incidentally, there can't exist any "concentric pairs of black holes" solutions to the 3+1-dimensional general relativity. Once we know that it's the empty Schwarzschild metric up to the event horizon (from outside), then it is the black hole and there's no way for the metric to "unbecome" a black hole again. Everything that is inside the event horizon is, by definition, causally disconnected from infinity – it can't escape to infinity again. So if there is a matter that is even "more inside", at an even lower value of $R$, it's clear that it's still inside the black hole in the sense that it can't get to infinity.
So it's impossible to claim that there is a new "island" near the center of the black hole that would be "outside the black hole" again. Such a thing can't happen, it would be a logical oxymoron, almost by the definition of the event horizon. | {
"domain": "physics.stackexchange",
"id": 5872,
"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, black-holes, observers, event-horizon",
"url": null
} |
ros, slam, navigation, openni, rgbdslam-freiburg
install Ubuntu (12.10 or 12.04)
install ros groovy as following : http://www.ros.org/wiki/groovy/Installation/Ubuntu
install ros-groovy-openni-* by doing in console "sudo apt-get install ros-groovy-openni-*"
download olf version of NITE 1.5.2.21 at http://www.openni.org/openni-sdk/openni-sdk-history-2/
extract zip file in a folder
extract bz2 file in a folder
in terminal, go in NITE folder (with command "cd foldername")
launch UNINSTALL script first, by doing in terminal "sudo ./uninstall.sh"
launch install script by doing in terminal "sudo ./install.sh"
Have a good day !
Bests,
Stéphane
Originally posted by Stephane.M with karma: 1304 on 2013-06-06
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 14460,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "ros, slam, navigation, openni, rgbdslam-freiburg",
"url": null
} |
formal-languages, closure-properties
Title: Does closure against countable union survive union of classes? A class of languages $\mathcal{C}$ is closed under countable union (cucu) if for all series of languages in $\mathcal{C}$ ($(L_i)_{i\in\mathbb{N}} \in \mathcal{C}^\mathbb{N}$) the language $\bigcup_{i\in\mathbb{N}}L_i = \{x\mid \exists i\in\mathbb{N}: x \in L_i\}$ is an element of $\mathcal{C}$.
As we know most (if not all but $\mathsf{ALL} = \wp(\Sigma^*)$) interesting complexity classes are not closed under countable union as every Language $L$ is the countable union of some singleton Laguages $\{w_i\}$.
However there are some classes of decidable languages which are cucu like:
$\{\{w\in\Sigma^*\mid |w| \leq i\}\mid i\in\mathbb{N}\}$
$\{n\text{-}\mathrm{SAT}\mid n\in\mathbb{N}\}$
every $\mathcal{C}$ s.t. every $L \in \mathcal{C}$ is cofinite
My questions: | {
"domain": "cs.stackexchange",
"id": 1175,
"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, closure-properties",
"url": null
} |
fft
sumsquares1 = np.real( np.sum( dft1 * dft1.conjugate() ) )
sumsquares2 = np.real( np.sum( dft2 * dft2.conjugate() ) )
rms_freq1 = np.sqrt( sumsquares1 / N )
rms_freq2 = np.sqrt( sumsquares2 / N )
q_freq = rms_freq1 / rms_freq2
print q_freq, rms_freq1, rms_freq2 | {
"domain": "dsp.stackexchange",
"id": 6175,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "fft",
"url": null
} |
homework-and-exercises, newtonian-mechanics, acceleration, torque, moment-of-inertia
$\tau = 9.5\times0.65 - 2.5\times0.1202 = 5.8745Nm$
clockwise.
The moment of inertia of the rod about its centre is
$I=\frac{1}{12}ML^2=\frac{1}{12}\times1.7\times1.3^2=0.2394kgm^2$.
The angular acceleration is
$\alpha=\frac{\tau}{I}=\frac{5.8745}{0.2394}=24.5rad/s^2$. | {
"domain": "physics.stackexchange",
"id": 31590,
"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, acceleration, torque, moment-of-inertia",
"url": null
} |
algorithms, runtime-analysis, arrays
I cannot re-sort and do a binary search or something along those lines as the ordering is important. If you don't know anything about the contents of the matrix (such as some kind of monotonicity property), linear time is the best you can do for a one-off search with a deterministic algorithm by a simple adversary argument: if you don't look at everything, then you can't distinguish between the cases where the maximum component is/isn't one of the ones you didn't look at. If you want to maintain max-information for a dynamic matrix, then there might be suitable preprocessing and maintenance (for example, a search tree) that can speed things up. | {
"domain": "cs.stackexchange",
"id": 5640,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "algorithms, runtime-analysis, arrays",
"url": null
} |
ros, camera-info-manager
make[1]: *** [CMakeFiles/unit_test.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'camera_info_manager':
Command '/home/ilagi/ros_catkin_ws/install_isolated/env.sh make -j4 -l4' returned non-zero exit status 2 | {
"domain": "robotics.stackexchange",
"id": 17264,
"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, camera-info-manager",
"url": null
} |
c, file-system, socket, tcp, unix
listen(sockfd, 5);
clilen = sizeof(client);
while (1) {
newsockfd = accept(sockfd,
(struct sockadd *) &client, &clilen);
if (newsockfd < 0)
error("accept");
pid = fork();
if (pid < 0 )
error("fork");
if (pid == 0) {
close(sockfd);
doaction(newsockfd);
exit(0);
}
else close(newsockfd);
}
return 0;
}
void
doaction(int sock)
{
ssize_t n;
char buffer[BUFFER_SIZE] = {0};
DIR *dir;
struct dirent *dp;
int telnet = 0;
char * pch;
while ( (n = read(sock, buffer, BUFFER_SIZE)) > 0)
{
pch=strchr(buffer,'\r');
if (pch != NULL)
{
telnet = 1;
buffer[n-2] = 0;
} | {
"domain": "codereview.stackexchange",
"id": 14158,
"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-system, socket, tcp, unix",
"url": null
} |
quantum-mechanics, measurement-problem, wavefunction-collapse, decoherence
The argument here is not that decoherence provides a dynamical explanation of how an indefinite quantity becomes definite in a measurement process—Bell [3] has aptly criticized this argument as a ‘for all practical purposes’ (FAPP) solution to the measurement problem. Rather, the claim is that we can take the decoherence pointer as definite by stipulation , and that decoherence then guarantees the objectivity of the macroworld, which resolves the measurement problem without resorting to Copenhagen or neo-Copenhagen instrumentalism. | {
"domain": "physics.stackexchange",
"id": 46634,
"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, measurement-problem, wavefunction-collapse, decoherence",
"url": null
} |
beginner, mysql, bash, django
#: Create test database
DB_NAME_TEST="${DB_NAME}_dump_test"
create_test_db_result=$(
mysql -u $DB_USER -p$DB_PASSWORD -h $DB_HOST -e"CREATE DATABASE $DB_NAME_TEST" 2>/dev/null
)
if $create_test_db_result; then
echo "[+] db '$DB_NAME_TEST' created"
else
echo "[-] db '$DB_NAME_TEST' created"
exit 1
fi
#: Load dump to test database
dump_loading_result=$(
mysql -u $DB_USER -p$DB_PASSWORD -h $DB_HOST $DB_NAME_TEST < $DUMP_SQL_PATH \
2>/dev/null
)
if $dump_loading_result; then
echo "[+] '$DUMP_SQL_PATH' loaded to '$DB_NAME_TEST'"
else
echo "[-] '$DUMP_SQL_PATH' loaded to '$DB_NAME_TEST'"
exit 1
fi | {
"domain": "codereview.stackexchange",
"id": 22292,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "beginner, mysql, bash, django",
"url": null
} |
c#, .net, finance
Title: Progressive tax program Please review this code, which should calculate the tax percentage a person will pay in a progressive tax system. The goal is to have a perfect program.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class TaxLevel
{
private decimal _Money=-1;
/// <summary>
/// the money count that the tax applies to
/// </summary>
public decimal Money
{
get { return _Money; }
set { if (value > 0) { _Money = value; } else { throw new ArgumentOutOfRangeException("Money must be grater than 0"); } }
} | {
"domain": "codereview.stackexchange",
"id": 2586,
"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, finance",
"url": null
} |
-
As you say, this is a straightforward application of Fold, which is also perhaps the cleanest solution you can get. I'm guessing that you're seeking Table based approaches since you didn't want to deal with having to "fold properly". I'll complete the Fold application here so that you can see how it is applied:
n = {n1, n2, n3, n4, n5};
d = {d1, d2, d3, d4, d5};
f[x_, {m_, d_}] := m/(d + x);
Fold[f, Last@n/Last@d, Reverse@Most@Transpose@{n, d}]
Now coming to generating a continued fraction approximation for $e-2$, observe that if you prepend a $1$ to the $D_i$ list you showed, then we can get a nice sequence function for it (I have replaced the formal symbols in the output with normal ones for clarity):
func = FindSequenceFunction[{1, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8}]
(* DifferenceRoot[Function[{y, n}, {-2 - y[n] - y[1 + n] - y[2 + n] + y[3 + n] +
y[4 + n] + y[5 + n] == 0, y[1] == 1, y[2] == 1, y[3] == 2, y[4] == 1, y[5] == 1}]] *) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9433475730993028,
"lm_q1q2_score": 0.8109617093332518,
"lm_q2_score": 0.8596637469145053,
"openwebmath_perplexity": 1910.9402960851467,
"openwebmath_score": 0.5032068490982056,
"tags": null,
"url": "http://mathematica.stackexchange.com/questions/21998/building-a-continued-fraction"
} |
javascript, game, ecmascript-6, vue.js
Title: Card based computer game This is a 2 player (Will soon have AI in it - I am not asking for help with AI) game with mechanics similar to the card game named Magic the Gathering.
Bear with me, this is a lot of code. If you feel like you need to review one file at a time, do so.
The code is hosted here if you wish to see how it works.
When you first open the game, it should look something like this: | {
"domain": "codereview.stackexchange",
"id": 31089,
"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, ecmascript-6, vue.js",
"url": null
} |
apache-spark, nltk, pyspark
File "/usr/lib/spark/python/pyspark/worker.py", line 98, in main
command = pickleSer._read_with_length(infile)
File "/usr/lib/spark/python/pyspark/serializers.py", line 164, in _read_with_length
return self.loads(obj)
File "/usr/lib/spark/python/pyspark/serializers.py", line 422, in loads
return pickle.loads(obj)
ImportError: No module named nltk.tokenize | {
"domain": "datascience.stackexchange",
"id": 838,
"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": "apache-spark, nltk, pyspark",
"url": null
} |
In particular, we have $$\log_a (a^b) = b \qquad\text{and}\qquad a^{\log_a b} = b.$$ Of special interest is the natural logarithm, denoted by $$\ln$$ or $$\log$$, the logarithm of base $$e$$. (NB that sometimes $$\log$$ can also denote base $$10$$, or base $$2$$, depending on context.)
Logarithmic identities correspond to exponential identities. From example, from the definition we can conclude that $$\log_b (pq) = \log_b p + \log_b q$$ (for $$p, q > 0$$), which corresponds to the identity $$b^{p + q} = b^p b^q$$.
Perhaps counterintuitively, sometimes it is convenient to define the natural logarithm first and then define the exponential function $$x \mapsto e^x$$ to be its inverse, which leads to the slightly antiquated name antilog for an exponential function $$x \mapsto b^x$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9893474891602739,
"lm_q1q2_score": 0.8664576708485782,
"lm_q2_score": 0.875787001374006,
"openwebmath_perplexity": 447.85770646773545,
"openwebmath_score": 0.8837385773658752,
"tags": null,
"url": "https://math.stackexchange.com/questions/956776/whats-the-inverse-operation-of-exponents"
} |
homework-and-exercises, quantum-field-theory, notation, feynman-diagrams, integration
Title: Peskin and Schröeder page 195, IR divergence in the electron vertex function, rewriting integral Peskin and Schröeder make the following statement
$$\int_0^1dxdydz\ \delta(x+y+z-1)\frac{1-4z+z^2}{\Delta(q^2=0)}=\int_0^1dz\int_0^{1-z}dy\frac{-2+(1-z)(3-z)}{m^2(1-z)^2},\tag{p.195}$$
where $$\Delta = - xyq^2+(1-z)^2m^2.\tag{p.192}$$ | {
"domain": "physics.stackexchange",
"id": 99134,
"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, notation, feynman-diagrams, integration",
"url": null
} |
php, object-oriented, mvc
function show() {
$blog = new Blog();
$post['title'] = "TITLE";
$post['id'] = "IDENT";
$blog->newPost(1, $post);
$content['blogs'] = $blog->get_where();
$al = new Post();
$content['posts'] = $al->get_where();
$this->view->load('content', 'blogs/list', $content);
$this->view->render("theme_admin");
}
function edit() {
$id = $this->request->segment(2);
$al = new Post($id);
$content['post'] = $al;
$this->view->load('content', 'blogs/edit', $content);
$this->view->render("theme_admin");
}
function save() {
$al = new Post();
$_POST['title'] = htmlspecialchars($_POST['title'], ENT_QUOTES);
$_POST['content'] = htmlspecialchars($_POST['content'], ENT_QUOTES);
$_POST['likes'] = htmlspecialchars($_POST['likes'], ENT_QUOTES);
$al->save($_POST);
// redirect('admin/blogs');
} | {
"domain": "codereview.stackexchange",
"id": 2208,
"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, object-oriented, mvc",
"url": null
} |
crystal-structure, molecules, symmetry, crystallography
Title: Origin in a crystal I am trying to understand the International Tables for Crystallography.
How can I identify the origin in the image on the left?
Without knowing the origin, I cannot identify the position of the symmetry elements. In the International Tables for Crystallography (Vol. A) it appears that the origin is at the "$(\overline{3}$ m 1) at $\overline{3}$ 2/m c" position. What does the $(\overline{3}$ m 1) element and the $\overline{3}$ 2/m c element mean? Where is the reference center really located? For centro-symmetric space groups such as this one, the origin coincides with the center of inversion. You can see this specifically for this group if you look at symmetry operation (13): $$\overline{1} \mathrm{\ at\ } 0,0,0$$ Of course, there an an infinite number of origins in an infinite lattice because of the translational symmetry. In the tables, the origin is in the plane of the paper on any of the unit cell vertices shown, so upper left corner would be fine. | {
"domain": "chemistry.stackexchange",
"id": 13789,
"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": "crystal-structure, molecules, symmetry, crystallography",
"url": null
} |
python, object-oriented
self.name = 'UNKNOWN'
def setMonsterLevel(self, monster, level):
"Changes the given monster's level to the given value."
if monster not in LoadedMonsters:
print 'Monster not loaded'
raise NotImplementedError # I'll get to it, it's harder then it seems | {
"domain": "codereview.stackexchange",
"id": 2727,
"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, object-oriented",
"url": null
} |
quantum-field-theory, particle-physics, scattering
Title: How does one describe individual particles in QFT in practice? A similar question was posted on this site at least ten times, but not quite in this formulation, and with no satisfactory answers, so I give it another try. | {
"domain": "physics.stackexchange",
"id": 99064,
"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, particle-physics, scattering",
"url": null
} |
deep-learning, backpropagation
loss = tf.square(output - y_true) / 2.
optimizer = tf.train.GradientDescentOptimizer(.01)
train = optimizer.minimize(loss)
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)
for i in range(500000):
rand_index = np.random.randint(0, 500)
_, error = sess.run([train, loss], feed_dict={x: [x_data[rand_index]],
y_true: [y_data[rand_index]]})
if i % 10000 == 0:
print(error)
sess.close() I think your biggest problem is the lack of biases. Between the input layer and the hidden layer, you should not only transform by the weights but should also add a bias. This bias will shift your sigmoid function to the left or right. Take a look at this code (I made some adaptations).
What is important: | {
"domain": "datascience.stackexchange",
"id": 1231,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "deep-learning, backpropagation",
"url": null
} |
c++, backtracking, n-queens
At that point we can just skip the temporary position and use Stack.emplace_back with the list, but the compiler should generate the same code either way:
void insert_into_stack(stack_type &Stack, int row, int col) {
Stack.emplace_back({row, col});
}
Remark: Remove unused parameters
Several functions have an int n parameter you never use. You should remove that. Also, enable compiler warnings. GCC and Clang use -Wall.
Remark: Always use return types on functions
Your main doesn't have a return type. Add int.
The implicit Board
However, even with that in mind (and std::pair), we still carry around a lot of information with us all the time. The Board gets updated in every iteration, whenever we put a new queen on the board. We need that Board for print_board, right?
Actually, no. We can recreate a Board from a Stack whenever we want to:
void fill_board_from_stack(board_type &Board, const stack_type& Stack) {
// simple exercise
} | {
"domain": "codereview.stackexchange",
"id": 32380,
"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++, backtracking, n-queens",
"url": null
} |
tree, rust
Finally, just a fairly minor thing. Don't forget to run cargo fmt and cargo clippy. cargo fmt will make your code more readable to other Rust programmers and keep things in a consistent style. cargo clippy will give you a few helpful tips for making your code more idiomatic and sometimes help avoid logic errors. | {
"domain": "codereview.stackexchange",
"id": 36472,
"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": "tree, rust",
"url": null
} |
climate-change, sea-level, sea-ice, poles
Title: Would freezing the ocean and storing the ice in the poles reduce effects of climate change or sea level? Disclaimer
I've read this question already on sending water to the north pole, south pole and glaciers, and I thought I'd give it my own take and see how technically possible it could be.
Question
As previously established by [a majority of the scientific community], sea levels and global temperatures continue to rise as result of climate change (and humans causing climate change.) Rising sea levels are not good news for islands or low-lying ground, and as such that is the basis for this question.
Let's say an extravagant inventor came up with a device/system that would perform the following actions: | {
"domain": "earthscience.stackexchange",
"id": 2298,
"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": "climate-change, sea-level, sea-ice, poles",
"url": null
} |
python, pygame, battle-simulation, pokemon
# Win or Lose
if Win:
Game.game_over(screen, Game.current_pokemon)
if Lose:
Game.game_over(screen, Game.opponent.pokemon)
# Show the current turn info and pause the Game
if Game.pause:
if Game.playing:
Game.help_text_number = 3
"""for item in Game.current_turn_text:
Functions.text_to_screen(screen, item[0], item[1], item[2], item[3], item[4])"""
if not Game.pause:
Game.log_turn(False)
Game.current_turn_text = set([])
Game.first_move_done = False
Game.second_move_done = False
Game.text_y = 75
Game.help_text_number = 0
Game.turn_logged = False
Game.stop_that = False
# Check if a pokemon on the battlefield has fainted
if math.floor(Game.current_pokemon.current_health) <= 0 or math.floor(Game.opponent.pokemon.current_health) <= 0: | {
"domain": "codereview.stackexchange",
"id": 23211,
"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, pygame, battle-simulation, pokemon",
"url": null
} |
electrostatics
to it, energetically). Being a 2-D conductor, not all the charge will have to be at the edge. So my rough impression is that you will have two 'circles/loops' of charge, one positive and one negative, which are well separated on the right, but converge and merge on the left. | {
"domain": "physics.stackexchange",
"id": 20548,
"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": "electrostatics",
"url": null
} |
ros, dwa, planner, velocity
Originally posted by ahendrix with karma: 47576 on 2015-05-20
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by scopus on 2015-05-20:
Thank you for you attention! My project is implemented in a simulating way. Fake_localization is used for robot localization. I have checked out the source code of fake localization. It doesn't need the twist component in nav_msgs/odometry msg. So twist information is not sent to fake localization
Comment by ahendrix on 2015-05-20:
You should implement the twist component in the odometry message. | {
"domain": "robotics.stackexchange",
"id": 21734,
"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, dwa, planner, velocity",
"url": null
} |
However, upon testing this equation out it seems that it does not work! Is there an obvious error that I have made in my theoretical side or have I just been fluffing up my calculations?
• Looks about right to me. In particular, it gives the right result for reasonable values of $m = 0$, $m = 1$, $m = \infty$. Maybe there is a bug in your implementation. – Rahul Jul 27 '12 at 15:28
• Thanks for the quick reply Rahul, i've been trying to programme this and you are right! it was an error in my implementation. Thank you for taking the time to read my question! – Kel196 Jul 27 '12 at 15:34
• See formula 14 here. – J. M. is a poor mathematician Jul 27 '12 at 15:49
• @enzotib: It is considered impolite in this site to remove or add "thank you" comments. – Asaf Karagila Jul 27 '12 at 18:55
• @AsafKaragila: sorry, I didn't know, in other SE sites it is considered superfluous to have such comments. I will take it into account for the future. – enzotib Jul 27 '12 at 18:57 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9796676442828174,
"lm_q1q2_score": 0.8226601920398183,
"lm_q2_score": 0.8397339616560072,
"openwebmath_perplexity": 374.965227043253,
"openwebmath_score": 0.8800017237663269,
"tags": null,
"url": "https://math.stackexchange.com/questions/175896/finding-a-point-along-a-line-a-certain-distance-away-from-another-point"
} |
simulation, performance, many-body-systems
First we draw the commutativity graph, as below. Each operator in the Hamiltonian~($X_{n}X_{n+1}$, $Y_nY_{n+1}$, $Z_n$) is represented by a vertex, and we link two vertices if and only if the corresponding operators don't commute (or, in the current case, anti-commute). | {
"domain": "quantumcomputing.stackexchange",
"id": 935,
"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": "simulation, performance, many-body-systems",
"url": null
} |
solid-state-physics, fourier-transform
Title: Integration over hexagonal unit cell I want to perform the integral $\sum_G\int d^2x e^{i G\cdot x}$ over a 2D hexagonal unit cell, where $G$ is the reciprocal lattice vector. I find it hard since the integration domain is hexagonal. Can this be done? Use coordinate system with grid parallel to two hexagon sides (let coordinates of two vertices be $(1,0)$ and $(0,1)$):
$$
\int_{\text{hex}}f(x,y)dxdy = \frac{A_{\text{hex}}}3\int_{\text{hex}}\tilde f(u,v)dudv.
$$
then the domain of integration is the square $(0,0)-(2,2)$ minus two triangles $(1,0)-(2,0)-(2,1)$ and $(0,1)-(0,2)-(1,2)$ | {
"domain": "physics.stackexchange",
"id": 77763,
"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": "solid-state-physics, fourier-transform",
"url": null
} |
quantum-mechanics, operators, schroedinger-equation, eigenvalue, observables
\begin{align}
\hat{A}\vert \psi\rangle = a\vert \psi\rangle
\end{align}
where $\vert \psi\rangle$ would be the eigenvector of the said operator with eigenvalue $a$.
As you can see the two forms of equations are different, $\hat{H}$ cannot be considered as an eigenvalue of any operator that is defined on the Hilbert space of states because it is not a complex number. Also, it is much less clear what would be the definition of $i\hbar\frac{d}{dt}$ as an operator on the Hilbert space. If you are insistent on treating it as an operator on the Hilbert space, its matrix elements in some basis would read $\langle i \vert \hat{H} \vert j\rangle=H_{ij}$ -- in other words, you would be forced to define it as the Hamiltonian itself. However, then the Schrodinger equation is still not an eigenvalue equation but just a tautological statement. See, Why can't $ i\hbar\frac{\partial}{\partial t}$ be considered the Hamiltonian operator?. | {
"domain": "physics.stackexchange",
"id": 77665,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "quantum-mechanics, operators, schroedinger-equation, eigenvalue, observables",
"url": null
} |
electromagnetism, atomic-physics, collision, gas, matter
Think about a sidewalk with of people walking in both directions. If there are few people (a gas), people walking in opposite directions can pass by each other without slowing down. If the sidewalk is crowded (a liquid), people can still move by each other but slowly since they have to walk around each other. If people going in each direction link arms (a solid), nobody can pass each other. | {
"domain": "physics.stackexchange",
"id": 92694,
"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, atomic-physics, collision, gas, matter",
"url": null
} |
c++, game, sfml
if (mIsMovingUp)
{
movement.y -= PlayerSpeed;
}
if (mIsMovingDown)
{
movement.y += PlayerSpeed;
}
mPlayerOne.move(movement * elapsedTime.asSeconds());
// Player two
sf::Vector2f movement2(0.f, 0.f);
if (mIsMovingUpTwo)
{
movement2.y -= PlayerSpeed;
}
if (mIsMovingDownTwo)
{
movement2.y += PlayerSpeed;
}
mPlayerTwo.move(movement2 * elapsedTime.asSeconds());
}
void Game::render()
{
mWindow.clear();
mWindow.draw(mMiddleBar);
mWindow.draw(mPlayerOne);
mWindow.draw(mPlayerTwo);
mWindow.setView(mWindow.getDefaultView()); // for resizing
mWindow.display();
}
void Game::handlePlayerOneInput(sf::Keyboard::Key key, bool isPressed)
{
if (key == sf::Keyboard::Up)
{
mIsMovingUp = isPressed;
}
else if (key == sf::Keyboard::Down)
{
mIsMovingDown = isPressed;
}
} | {
"domain": "codereview.stackexchange",
"id": 12218,
"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++, game, sfml",
"url": null
} |
python, performance, python-3.x, numpy, matplotlib
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
NO_GROUPING_NAME = 'NoGrouping'
plt.style.use('ggplot')
def cdf_plot(total_param_values):
"""
Given a 3-deep nested dictionary, cdf_plot saves a cumulative frequency
distribution plot out of the values of each inner-most dictionary. This will
be a scatter plot with colours corresponding to the keys of the dict being plotted.
If a 2-deep nested dictionary has key == NO_GROUPING_NAME then the corresponding
value will be a dictionary of only one key with value of one list of floats, so
the plot will only have one colour. In this case, no legend is drawn. | {
"domain": "codereview.stackexchange",
"id": 17012,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "python, performance, python-3.x, numpy, matplotlib",
"url": null
} |
c++, c++11, multithreading, console
if (!WriteConsoleOutputA(mOut, &chiVec.front(), coordBufSize, coordBufCoord, &srctRect)
|| !SetConsoleCursorPosition(mOut, crdCur))
{
return false;
}
}
}
if (!(std::istringstream(str) >> numtmp).fail())
{
rNum = numtmp;
return true;
}
return false;
}
template <>
inline
bool Console::getinput(float& rNum, const short maxlen) const
{
short len = 0, i = 0, sign = -1, fpoint = -1, exp = -1;
float numtmp = 0;
int ch = 0;
std::string str;
CONSOLE_SCREEN_BUFFER_INFO csbi = { 0 };
COORD coordBufSize = { maxlen, 1 };
COORD coordBufCoord = { 0, 0 };
if (maxlen < 1 || !GetConsoleScreenBufferInfo(mOut, &csbi))
{
return false;
} | {
"domain": "codereview.stackexchange",
"id": 12592,
"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++, c++11, multithreading, console",
"url": null
} |
Let $$q_0$$ be the start state and the only final state. Then $$L$$ is accepted by $$D$$. So $$L$$ is regular.
"Every language that I saw containing $$\text{modulo}$$ was a regular language." This is nice observation. The reason is that there is only finitely many values of $$n\m d$$ for an integer $$n$$ and a fixed integer $$d$$. DFAs are powerful enough to remember and update finitely many information.
However, if there are other conditions involved to define the language, it may not be regular any more.
For example, consider $$N= \{a^nb^n \mid n = 0 \bmod 2\}$$. $$N$$ is non-regular since $$a^0, a^2, a^4, \cdots$$ are pairwise distinguishable. For two different even number $$i$$ and $$j$$, $$a^i$$ and $$a^j$$ are distinguished by $$b^i$$ as $$a^ib^i\in D$$ but $$a^jb^i\not\in D$$.
• Thank you so much for this answer, I really appreciate that, and it helped me a lot! :) Jun 21 at 7:57
The following language is not regular $$L = \{a^n b^m c^n \mid m = n \bmod 2\}$$. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731158685837,
"lm_q1q2_score": 0.8311638913882523,
"lm_q2_score": 0.8633916099737806,
"openwebmath_perplexity": 177.39374663149866,
"openwebmath_score": 0.8974388837814331,
"tags": null,
"url": "https://cs.stackexchange.com/questions/152508/why-is-w-w-mod-3-aw-mod-3-a-regular-language/152519"
} |
electric-circuits, electric-current, electrical-resistance, voltage
Title: Why are Kirchhoff's circuit laws and the nodal analysis equivalent? Two Kirchhoff's circuit laws:
Law I: at each node the algebraic sum of the currents is zero
Law II: the sum of directed voltages across any loop is zero
When performing the nodal analysis, we use only the Law I and Ohm's law, the Law II is not used. Is there a proof that applying the Law I, the Law II is fulfilled automatically?
Does it work only for circuits with passive elements e.g. resistors? Law II in terms of node voltages is:
(V1-V2)+(V2-V3)+...+(Vn-V1)=0
But this is trivially true since the sum may be rearranged as:
(V1-V1)+(V2-V2)+...+(Vn-Vn)
which is, of course, equal to zero. | {
"domain": "physics.stackexchange",
"id": 86944,
"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, electric-current, electrical-resistance, voltage",
"url": null
} |
complexity-theory, time-complexity, asymptotics, big-o-notation
In math thoes notations can be used for n approaching to some real number a [n-->a] (not only to infinity), but in computer science is used only for large n (n--> approcah to infinity). Am i right?
(In computer science) When we have f(n)=O(g(n)) this means that for all n>n0 when we multiply g(n) to some constant c we get f(n) : f(n) = c * g(n).
So my question is, this constant c is constant only for given n and will change for every different value of n (case 1), or c constant is constant for all values of n which therefore means that after n0 point f(n) graphic will be parallel to g(n) graphic (case 2)? | {
"domain": "cs.stackexchange",
"id": 20641,
"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, time-complexity, asymptotics, big-o-notation",
"url": null
} |
javascript, node.js
app.js:
console.log('Starting password manager...');
var storage = require('node-persist');
storage.initSync();
var crypto = require('crypto-js'); | {
"domain": "codereview.stackexchange",
"id": 17030,
"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, node.js",
"url": null
} |
etc. Determine by direct integration the centroid of the area shown. * Provided Active Directory integration and support services. When determining the centroid of the area above, which type of differential area element requires the least computational work? x If a vertical rectangular strip is chosen as the differential element, then all the variables, including the integral limit, should be in terms of _____. 44% of the radius. If F'(x) = f(x), we say F(x) is an anti- derivative of f(x). Calculating the centroid involves only the geometrical shape of the area. determine by direct integration the centroid of the area shown. (1) as demonstrated in the following examples. Locate the centroid (2,7) of this area using BOTH (a) integration and (b) the Composite Method. 8 - Locate the centroid of the volume obtained by Ch. Centroid's Integration Services focus on streamlined application to application integration so data is in real-time. Divide the area into basic shapes 3. Viewed 21k times | {
"domain": "sagemis.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9925393563153742,
"lm_q1q2_score": 0.8183109097123348,
"lm_q2_score": 0.8244619263765706,
"openwebmath_perplexity": 579.7803577963642,
"openwebmath_score": 0.7817797064781189,
"tags": null,
"url": "http://kmen.sagemis.it/centroid-of-area-by-integration.html"
} |
Compare the result to the integration result returned by the `int` function without setting the `'Hold'` option to `true`.
`F2 = int(x^2*exp(x))`
`F2 = ${\mathrm{e}}^{x} \left({x}^{2}-2 x+2\right)$`
Apply integration by parts to the integral $\int {\mathit{e}}^{\mathit{ax}}\text{\hspace{0.17em}}\mathrm{sin}\left(\mathit{bx}\right)\text{\hspace{0.17em}}\mathit{dx}$.
Define the integral using the `int` function. Show the integral without evaluating it by setting the `'Hold'` option to `true`.
```syms x a b F = int(exp(a*x)*sin(b*x),'Hold',true)```
```F = ```
To show the steps of integration, apply integration by parts to `F` and use ${\mathit{u}}^{\prime }\left(\mathit{x}\right)={\mathit{e}}^{\mathit{ax}}$ as the differential to be integrated.
`G = integrateByParts(F,exp(a*x))`
```G = ```
Evaluate the integral in `G` by using the `release` function to ignore the `'Hold'` option. | {
"domain": "mathworks.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9861513901914406,
"lm_q1q2_score": 0.8062522128584326,
"lm_q2_score": 0.8175744828610095,
"openwebmath_perplexity": 1809.7204370805052,
"openwebmath_score": 0.9534416198730469,
"tags": null,
"url": "https://es.mathworks.com/help/symbolic/sym.integratebyparts.html"
} |
quantum-mechanics, perturbation-theory
&= E_n^{(0)} + \lambda E_n^{(1)} + \lambda^2 \left( \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle + \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle \right)
\end{align*}
$$
The second-order energy is defined by $E_n^{(2)} = \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle $. Since the Hamiltonian is hermitian, the eigenvalues are real. So
$$E_n^{(2)} = \left\langle{n^{(0)}}\middle|{\hat{H}_1}\middle|{n^{(1)}}\right\rangle = \left\langle{n^{(1)}}\middle|{\hat{H}_1}\middle|{n^{(0)}}\right\rangle$$
This would yield to
$$
\begin{align*}
\left\langle n \middle| \hat{H}_0 + \lambda \hat{H}_1 \middle| n \right\rangle
&= E_n^{(0)} + \lambda E_n^{(1)} + 2 \lambda^2 E_n^{(2)}
\end{align*}
$$ | {
"domain": "physics.stackexchange",
"id": 19359,
"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, perturbation-theory",
"url": null
} |
ds.algorithms, tsp, exp-time-algorithms
Thus, to compute across all subsets of {1,...,$n$}, we simply count through each binary subset (i.e. count through binary strings) of size=2 (i.e. binary strings of size $n$ that contain two 1's), then size=3, then size=4, ...then size=n. (Note that the size=1 subset must contain only the first city, and thus it's irrelevant to compute its partial distance, since the distance from 1 -> all other cities in the subset -> 1 is exactly 0.) | {
"domain": "cstheory.stackexchange",
"id": 4523,
"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": "ds.algorithms, tsp, exp-time-algorithms",
"url": null
} |
’ s correlation can calculated!, correlation is a nonparametric measure of rank correlation ; Spearman coefficient of correlation based on rank (... Moment correlation coefficient n't matter, correlation is determined by sign of the correlation coefficient helps... Must be 1 as well numerically related to the dependent variables the variables! Convert the ordinal variable to numeric ( 1,2,3 ) and evidence of a continuous feature and categorical. By assigning ranks two variables—it ’ s rank correlation a: Inbreeding coefficients associated! \ ( \alpha\ ) = 0.05 1 as well how to address the numerical values of Pearson moment! Where D i = r 1i – r 2i below is zero a more measure! Between the two quantitative variables of ranking between two variables on a scatterplot and the slope must be 1 well! The following table may serve a as rule of thumb how to address the numerical values of Pearson product correlation! Obtain measure of rank correlation coefficient then point biserial correlation | {
"domain": "stealthmedia.tv",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9790357567351325,
"lm_q1q2_score": 0.8179682569878084,
"lm_q2_score": 0.8354835371034368,
"openwebmath_perplexity": 724.2598402608036,
"openwebmath_score": 0.6706416606903076,
"tags": null,
"url": "https://stealthmedia.tv/v9306irf/fc3897-a-correlation-coefficient-is-a-numerical-measure-of-the"
} |
java, object-oriented, interview-questions, computational-geometry
if(x==0 && y==0) {
overlap++;
}
if(points[j].getX()==points[i].getX()) {// slope is infi,
// slope (1) finite, (2) infinite,
countSameX++;
continue;
}
double slope = y/x;
if(map.contains(slope)) map.put(slope, map.get(slope)+1);
else map.put(slope, 2);
if(map.get(slope)+overlap > maxPoints) { // each line slope and points[i]
// update result and maxPoints
maxPoints = map.get(slope)+overlap;
result = new Line(points[i], points[j]);
}
}
if(countSameX>maxPoints) { // line parallel to Y coordinate
// update result and maxPoints
maxPoints = countSameX;
result = new Line(points[i], points[j]);
}
}
return result;// null
}
} | {
"domain": "codereview.stackexchange",
"id": 29660,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "java, object-oriented, interview-questions, computational-geometry",
"url": null
} |
particle-physics, photons
Title: Do light particles come in different sizes? Do light particles come in different sizes if it makes sense to even think about them that way? No, it doesn't make sense to think of light particles having size. The picture of light as a particle in the everyday sense is a metaphor to give us language to talk about light and its interactions. Like all metaphors and analogies, the idea eventually breaks down. The metaphorical object (particle in this case) has properties that the actual thing does not have. That's what we have here: a push of the metaphor beyond its usefulness. | {
"domain": "physics.stackexchange",
"id": 27068,
"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": "particle-physics, photons",
"url": null
} |
thermodynamics, energy, temperature, phase-transition, kinetic-theory
Title: How can energy be absorbed without changing the temperature? I'm a newbie in physics, so I went reading on wiki to learn about heat of fusion but then it said how $1 \:\rm kg$ of ice at $0^{\circ} \rm C$ under wide range of pressure needs $333.55 \rm kJ$ energy to fully melt it. See:
https://en.m.wikipedia.org/wiki/Enthalpy_of_fusion (first paragraph)
So if the ice absorbed energy to melt, shouldn't the kinetic energy of molecules in the substance increase, and thus increasing the temperature? Why is the temperature constant at $0^{\circ}\rm C$ while energy is absorbed? What does internal energy depend on? | {
"domain": "physics.stackexchange",
"id": 68611,
"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, energy, temperature, phase-transition, kinetic-theory",
"url": null
} |
ruby, pig-latin
ending = "ay" is a local variable only visible directly in the class body, not inside of the defs. For this reason translate_with_vowel will throw a NameError when it is called. You should make it a constant, so it'll be visible everywhere.
The reason that you did not notice the first mistake is that translate_with_vowel is never called because vowel_is_first will always return false. You should use if ... else ... end instead of the inline if. The reason that it doesn't work the way you wrote it is that since true if test_word[0] =~ /aeiou/ is not the last expression in the method, so its return value simply gets discarded and it doesn't have any side-effects. | {
"domain": "codereview.stackexchange",
"id": 324,
"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": "ruby, pig-latin",
"url": null
} |
octomap, rosmake, ubuntu-precise, ubuntu
It seems to me that you are either missing a dependency (octomap_msgs) in your ROS_PACKAGE_PATH, or mixing different ROS versions. OctomapBinary.h only exists for fuerte.
If you need a source compile, then you also need to manually download and compile the dependencies, most notably the packages octomap_ros and octomap_msgs. Fuerte versions are at http://alufr-ros-pkg.googlecode.com/svn/trunk/octomap_stacks/ and
Groovy versions here:
https://github.com/OctoMap/octomap_msgs
https://github.com/OctoMap/octomap_ros | {
"domain": "robotics.stackexchange",
"id": 13501,
"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": "octomap, rosmake, ubuntu-precise, ubuntu",
"url": null
} |
quantum-mechanics, quantum-information, topological-order, anyons
To see that this is important consider a situation where you create the superposition:
$$ \frac{1}{\sqrt{2}}\left(|\psi\rangle + |\psi'\rangle\right) $$
this state is the zero vector if the strings intersect, or a valid non-zero state if they don't. So how can you just look at particle position and ignore the strings? Or did I miss something in the paper where he specifies strings shouldn't intersect? After chatting IRL with some people, we've determined the answer.
The Hamiltonian for the system, $H$, is highly degenerate with a class of ground states:
$$ \mathcal{H} \supseteq \mathcal{H}_{G} = \{|\psi\rangle : A_{s}|\psi\rangle = |\psi\rangle \land B_{p}|\psi\rangle = |\psi\rangle\} $$
where $A_s$ and $B_p$ are the toric code stabilisers. | {
"domain": "physics.stackexchange",
"id": 63308,
"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-information, topological-order, anyons",
"url": null
} |
javascript, react.js
color: red;
}
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<div id="root"></div> | {
"domain": "codereview.stackexchange",
"id": 38114,
"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, react.js",
"url": null
} |
mention anything about the values of the variables when either of them is zero, it leads to a confusing situation. Please Clarify _________________ "Kudos" will help me a lot!!!!!!Please donate some!!! Completed Official Quant Review OG - Quant In Progress Official Verbal Review OG 13th ed MGMAT IR AWA Structure Yet to do 100 700+ SC questions MR Verbal MR Quant Verbal is a ghost. Cant find head and tail of it. Veritas Prep GMAT Instructor Joined: 16 Oct 2010 Posts: 7072 Location: Pune, India Followers: 2086 Kudos [?]: 13291 [0], given: 222 Re: In a certain business, production index p is directly [#permalink] ### Show Tags 17 May 2013, 08:02 SrinathVangala wrote: If P id directly proportional to E then what is the relation between them? Is it only P = E * x Or can it also be P = E*x + y. In both the cases P is directly proportional to E. As in the question the author doesn't mention anything about the values of the variables when either of them is zero, it leads to a confusing | {
"domain": "gmatclub.com",
"id": null,
"lm_label": "1. Yes\n2. Yes\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 1,
"lm_q1q2_score": 0.8267117940706734,
"lm_q2_score": 0.8267117940706734,
"openwebmath_perplexity": 1442.9165118748565,
"openwebmath_score": 0.8476580381393433,
"tags": null,
"url": "http://gmatclub.com/forum/in-a-certain-business-production-index-p-is-directly-63570.html#p464025"
} |
ros, cturtle
[ rosmake ] Checking rosdeps compliance for packages pr2_tabletop_manipulation_gazebo_demo. This may take a few seconds.
Failed to find stack for package [rosgraph_msgs]
Failed to load rosdep.yaml for package [rosgraph_msgs]:Cannot locate installation of package rosgraph_msgs: [rospack] couldn't find package [rosgraph_msgs]. ROS_ROOT[/opt/ros/cturtle/ros] ROS_PACKAGE_PATH[/home/reza2/pr2_tabletop_manipulation_overlay/model_database:/home/reza2/pr2_tabletop_manipulation_overlay/wg_robots_gazebo:/opt/ros/cturtle/stacks:/opt/ros/cturtle/ros]
Failed to find stack for package [gazebo_msgs]
Failed to load rosdep.yaml for package [gazebo_msgs]:Cannot locate installation of package gazebo_msgs: [rospack] couldn't find package [gazebo_msgs]. ROS_ROOT[/opt/ros/cturtle/ros] ROS_PACKAGE_PATH[/home/reza2/pr2_tabletop_manipulation_overlay/model_database:/home/reza2/pr2_tabletop_manipulation_overlay/wg_robots_gazebo:/opt/ros/cturtle/stacks:/opt/ros/cturtle/ros] | {
"domain": "robotics.stackexchange",
"id": 13137,
"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, cturtle",
"url": null
} |
ruby, community-challenge
# Get a grid square by is x, y coordinates. Returns nil if the
# coordinates are out-of-bounds
def [](x, y)
return nil unless (0...size).cover?(x)
return nil unless (0...size).cover?(y)
@squares[y][x]
end
# Get (horizontally or vertically) contiguous spans of free squares,
# i.e. squares that are unoccupied and whose neighbors are unoccupied
def free_squares
free_chunks(@squares) + free_chunks(@squares.transpose)
end
# Randomly place a ship. This'll raise an error if there's no room left
# for the ship.
def place_ship(size)
span = free_squares.select { |span| span.count >= size }.sample
raise "Ocean's gettin' crowded" unless span
offset = rand(0..span.count - size)
@ship_squares << span.slice(offset, size)
@ship_squares.last.each { |cell| cell.ship = size }
end | {
"domain": "codereview.stackexchange",
"id": 13712,
"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": "ruby, community-challenge",
"url": null
} |
javascript, html, sudoku
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
</tr>
<tr>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td>
<input type="text" size="1" name="sud[]"></input>
</td>
<td> | {
"domain": "codereview.stackexchange",
"id": 19342,
"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, html, sudoku",
"url": null
} |
ros, thread, beginner-tutorials, roscore
I'm running Ubuntu 12.04 (Windows Installer version). I've tried fixing any network configurations (as suggested by the tutorial) and fixing manifest.xml to include the matching -Wl,-rpath,/opt/ros/fuerte/lib". I can't find anything else that fits the problem I'm having, and I'd appreciate any help!
Originally posted by lizfltn on ROS Answers with karma: 1 on 2012-07-27
Post score: 0
Original comments
Comment by ipso on 2012-07-27:
Could you reformat your question a bit? Please prefix each line you copied from the console with ' ' (four spaces). See also markdown/syntax.
I don't believe that the actually system hangs, roscore is probably running. Open a new console and type rostopic list to verify.
Originally posted by Lorenz with karma: 22731 on 2012-07-27
This answer was ACCEPTED on the original site
Post score: 5 | {
"domain": "robotics.stackexchange",
"id": 10391,
"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, thread, beginner-tutorials, roscore",
"url": null
} |
error-correction, stabilizer-code, fault-tolerance
The above shows that for these self-orthogonal CSS codes, we can always construct a reasonable basis where a product of physical Hadamards behaves as a product of logical Hadamards up to some logical swaps. This answers my question in the affirmative.
As an aside, note that for some self-orthogonal CSS codes, we cannot always construct a reasonable basis where a product of physical Hadamards behaves as a product of logical Hadamards without any swaps.
For example, this question noted that the CSS code generated from the classical codes
$$C = \langle (111001), (000110) \rangle$$
$$C^\perp = \langle (111001), (000110), (010001), (001001) \rangle $$
suffers from a logical swap after performing $\otimes_{i=1}^n H_i$.
I also noted in a comment that the CSS code generated from
$$C = \langle(11110)\rangle$$
$$C^\perp = \langle(11110), (11000),(01100), (00001)\rangle$$
with any reasonable basis also suffers from a swap on two of the three logical qubits after performing $\otimes_{i=1}^n H_i$. | {
"domain": "quantumcomputing.stackexchange",
"id": 5343,
"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": "error-correction, stabilizer-code, fault-tolerance",
"url": null
} |
you multiply the magnitudes (numbers in front), but add the angle measurements. Dec 11, 2017 · Polar Form of Complex Numbers A complex number z is one of the form z=x+y i, where x and y are real numbers and i is the square root of -1. 3k VIEWS. Sep 07, 2016 · Use z=r(costheta +isintheta) A complex number takes the form z=a+bi. Polar form synonyms, Polar form pronunciation, Polar form translation, English dictionary definition of Polar form. The conversion of our complex number into polar form is surprisingly similar to converting a rectangle (x, y) point to polar form. Complex numbers of the form x 0 0 x are scalar matrices and are called real complex numbers and are denoted by the symbol {x}. • Calculate expressions containing complex numbers in standard form a+bi and polar (phasor) form r∠(θ). Complex Plane: A complex number z can be viewed as a point or a position vector in a two-dimensional Cartesian 20 Dec 2014 6Convert the complex number to polar form: 4 3i z 2 2 2 2 (4) (3) 5r | {
"domain": "toromecanico.es",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357259231532,
"lm_q1q2_score": 0.8159628254882636,
"lm_q2_score": 0.8311430499496096,
"openwebmath_perplexity": 434.16522965605,
"openwebmath_score": 0.8907320499420166,
"tags": null,
"url": "https://toromecanico.es/lottery-winning-vc4t8/ozm---complex-number-to-polar-form---d0egx.html"
} |
electrostatics, experimental-physics, potential, voltage
It is generally argued that Aharonov–Bohm effect illustrates the physicality of electromagnetic potentials, Φ and A.
The Aharonov–Bohm effect shows that the local E and B fields do not contain full information about the electromagnetic field, and the electromagnetic four-potential, (Φ, A), must be used instead. By Stokes' theorem, the magnitude of the Aharonov–Bohm effect can be
calculated using the electromagnetic fields alone, or using the
four-potential alone. But when using just the electromagnetic fields,
the effect depends on the field values in a region from which the test
particle is excluded. In contrast, when using just the electromagnetic
four-potential, the effect only depends on the potential in the region
where the test particle is allowed.
In classical electromagnetism the two descriptions were equivalent. With the addition of quantum theory, though, the electromagnetic potentials Φ and A are seen as being more fundamental. | {
"domain": "physics.stackexchange",
"id": 72808,
"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": "electrostatics, experimental-physics, potential, voltage",
"url": null
} |
java, file, locking, ssh
Title: Locking a remote file I am using Java to modify remote files in different machines by ssh. At the same time, only one thread is allowed to modify the file in one machine.
I implement the logic like this:
public boolean executeCmd(String ip, String command, String file) throws Exception
{
final String file = ip + " " + file;
final String fileLock = file.intern();
synchronized (fileLock)
{
logger.debug(Thread.currentThread().getName() + " " + fileLock + " get the lock");
SSHClient sshClient = new SSHClient();
// code to ssh to modify the file.
logger.debug(Thread.currentThread().getName() + " " + fileLock + " release the lock");
}
} | {
"domain": "codereview.stackexchange",
"id": 10510,
"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, file, locking, ssh",
"url": null
} |
At this point, the matrix on the right side is the inverse of $A$! Namely: $$A^{-1}=\left[ \begin{array}{ccc}1&2/3&-2/3\\0&-1/3&1/3\\2&1/3&-4/3\end{array}\right]$$
• This doesn't exactly answer my question. As Brian says, one way to do reduce it is making the element $a_{ii}$ 1, then making all elements of column $i$ 0. Then move onto $a_{i+1, i+1}$. I was asking for a procedure which could be followed. What procedure have you followed in your answer? – mikhailcazi Sep 14 '13 at 11:39
• well, I managed to get all $a_{ii} = 1$ on the left hand side. I achieved this by using elementary operation reported on the rightmost side of the whole matrix. This is a method to obtain on the right hand side the inverse of a matrix. – the_candyman Sep 14 '13 at 17:11 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969694071562,
"lm_q1q2_score": 0.8320664176295582,
"lm_q2_score": 0.8459424373085146,
"openwebmath_perplexity": 161.59081013551452,
"openwebmath_score": 0.7999989986419678,
"tags": null,
"url": "https://math.stackexchange.com/questions/493264/finding-the-inverse-of-a-matrix-by-elementary-transformations"
} |
image-processing, signal-synthesis
Title: Convert image of an irregular surface to it's signal equivalent I want to take the image of an irregular object , say
and then I want to convert the elevation of the points into a spatial signal. To make my point clear: the signal would be 'height of the object's surface from an assumed datum' vs 'distance'.
For example
this is the kind of signal that I want to construct from my image.
What software/tool can I use to convert my image to it's signal equivalent? As I can see from comments, you are taking multiple images from the same camera at diferent angle. So what you might be looking for is Structure from motion .This is similar to Stereo vision. You can find open source solutions and software tools available here. Good luck. | {
"domain": "dsp.stackexchange",
"id": 4415,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "image-processing, signal-synthesis",
"url": null
} |
$(**)$ is true since \begin{align*} (9+(x_n)^2)^2\geq36(x_n)^2&\Leftrightarrow 9+(x_n)^2\geq6x_n\\&\Leftrightarrow (x_n)^2-6x_n+9\geq 0 \\&\Leftrightarrow (x_n -3)^2\geq 0. \end{align*}
2.
If we assume our limit $L$ exists, it must satisfy the equation $L=\frac{9+L^2}{6}\Leftrightarrow L^2+9-6L=0$. This is the case for $L=3$ as $9+9-18=0$ and as such $x_n$ is bounded by $0\leq x_n\leq 3$ with $\lim_{n\rightarrow\infty}x_n=3$.
I especially struggled with the inductive step. Would anybody know an easier and quicker way to show this? Also, do I have to argue the second step differently, by deducing $L=3$ through the quadratic formula first, or is it okay the way I did it? Thank you very much.
Your conclusion that $(x_n)$ is bounded above by $3$ is unwarranted. Instead, I would do this by induction. Supposing that $x_n \le 3$, we have:
$$x_{n+1} \le \frac{9 + 3^2}{6} = 3$$
Now we conclude that $(x_n)$ is convergent and compute its limit as you have done. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9822876997410349,
"lm_q1q2_score": 0.8206851937852442,
"lm_q2_score": 0.8354835289107307,
"openwebmath_perplexity": 210.27726463705957,
"openwebmath_score": 0.967540442943573,
"tags": null,
"url": "https://math.stackexchange.com/questions/2789445/test-x-1-0-x-n1-frac9x-n26-for-convergence-and-find-its-limit"
} |
homework-and-exercises, newtonian-mechanics, friction, speed, distance
So given the example that the car is travelling with a speed of 144 km/h, assuming g of 9.81 and a friction of 0.3 this will yield:
$$
d = ( 40 * 1) + \dfrac{1600}{2*0.3*9.81} => 311.83146449201496
$$
The second question however is where I made up a mistake in my math. This question is, given a known stopping distance d and a friction $\mu$ and still assuming a thinking time of 1 second, what is the initial speed in km/h?
By putting this initial speed and $\mu$ into the first equation of the first question, the same total stopping distance should be proven.
What would be the formula for that last question?
I am assuming that using:
$$
v = \sqrt{2 * \mu\ * g\ * d }
$$ | {
"domain": "physics.stackexchange",
"id": 37420,
"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, friction, speed, distance",
"url": null
} |
acid-base, redox
Now, what are some examples of
oxidation of fluoride?
fluoride acting as a base? As far as I think Fluorine ($\ce{F2}$) is the strongest oxidising agent, as the standard reduction potential for the conversion $\ce{F2 + 2e- -> 2F- }$ is very highly positive i.e. $E^0_{F_2/F^-} = + 2.87 V$. If you have any other species which have even more positive reduction potential than this, then only oxidation of $\ce{F-}$ is observed i.e. the reverse reaction occurs. But such species are very rare and thus generally oxidation of fluorides are not observed. You can surely have examples of Fluorides acting as Lewis base. For example, if you react $\ce{KF}$( basically $\ce{K+F-} $ ) with Antimony pentafluoride ($\ce{SbF5}$), $\ce{F- } $ will donate i ts lone pair to $\ce{Sb}$ and then they will form the compound $\ce{K+ SbF6-}$. This is a classic example of fluoride acting as lewis base. | {
"domain": "chemistry.stackexchange",
"id": 10171,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "acid-base, redox",
"url": null
} |
asymptote: y = 1/2, no holes. Question: Find the domain and any zeros, vertical asymptotes, horizontal asymptotes and holes for . x ... Newest Rational Functions Questions | Wyzant Ask An Expert A rational function is a fraction of polynomials. That is, if p(x)andq(x) are polynomials, then p(x) q(x) is a rational function. The numerator is p(x)andthedenominator is q(x). Examples. • 3(x5) (x1) • 1 x • 2x 3 1 =2x 3 The last example is both a polynomial and a rational function. In a similar way, any polynomial is a rational function. In this class, from this point on, most of the rational functions that we’ll see Answered: Evaluating Rational Functions Determine… | bartleby † how to graph rational functions and simplify rational expressions. † how to solve rational equations. You can use the skills in this chapter † to build upon your knowledge of graphing and transforming various types of functions. † to solve problems involving inverse variation in classes such as Physics and Chemistry. | {
"domain": "charchub.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9852713857177955,
"lm_q1q2_score": 0.8231780203282987,
"lm_q2_score": 0.8354835350552603,
"openwebmath_perplexity": 1459.6203624430225,
"openwebmath_score": 0.5696845054626465,
"tags": null,
"url": "http://charchub.com/5268ffaf558364334da04a371851424d"
} |
optics, reflection, refraction, geometric-optics
Same for the image distance. The concept of "image" of a point means: the reflected/refracted light rays from it seem to come from the image point. So if you follow them backwards where they came from and prolongate them beyond the spot where they were reflected/refracted, they meet at the image point. Note: tt is not obviuos, that such a point must exist, the rays don't have to meet, and often they do only in some approximation.
The case of a mirror is a case, in which the image does definitely exist.
The rays are reflected following the rule, that the incident and outgoing angles are equal, always, independent of what media are involved!
The rays all seem to come from the reflected point. | {
"domain": "physics.stackexchange",
"id": 30352,
"lm_label": null,
"lm_name": null,
"lm_q1_score": null,
"lm_q1q2_score": null,
"lm_q2_score": null,
"openwebmath_perplexity": null,
"openwebmath_score": null,
"tags": "optics, reflection, refraction, geometric-optics",
"url": null
} |
wavefunction, schroedinger-equation, computational-physics, hamiltonian
So it is just the expectation value of the Hamiltonian subtracted by the value $E$. The closer this value is to $0$, the more confident we are in using $E$ to approximate the "actual energy" $\langle\hat H\rangle$. | {
"domain": "physics.stackexchange",
"id": 53257,
"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": "wavefunction, schroedinger-equation, computational-physics, hamiltonian",
"url": null
} |
quantum-mechanics, quantum-entanglement
$e^+ + e^- \longrightarrow \gamma + \gamma$
The same mechanism would apply in nature.
You could read also:
More entangled photons
In order to have particles (or photons) entagled, they need to have a common wavefunction, that is usually destroyed with measure, or almost any interaction. From here to your future wife its more complicated.
For more in entaglement read Chris J. Isham's Lectures on Quantum Mechanics, Mathematical and Structural Foundations.
Keep learning the maths, as it is foundamental in physics, and for it's understanding. | {
"domain": "physics.stackexchange",
"id": 7200,
"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-entanglement",
"url": null
} |
Theorem 1
If the space $X$ is pseudocompact and has a regular $G_\delta$-diagonal, then $X$ is metrizable.
All spaces are assumed to be Hausdorff and completely regular. The assumption of completely regular is crucial. The proof of Theorem 1 relies on two lemmas concerning pseudocompact spaces (one proved in a previous post and one proved here). These two lemmas work only for completely regular spaces.
The proof of Theorem 1 uses a metrization theorem. The best metrization to use in this case is Moore metrization theorem (stated below). The result in Theorem 1 is found in [2].
First some basics. Let $X$ be a space. The diagonal of the space $X$ is the set $\Delta=\{ (x,x): x \in X \}$. When the diagonal $\Delta$, as a subset of $X \times X$, is a $G_\delta$-set, i.e. $\Delta$ is the intersection of countably many open subsets of $X \times X$, the space $X$ is said to have a $G_\delta$-diagonal. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9780517482043892,
"lm_q1q2_score": 0.8273754739918143,
"lm_q2_score": 0.8459424314825853,
"openwebmath_perplexity": 59.22539724657257,
"openwebmath_score": 0.9785116910934448,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/pseudocomapct-space/"
} |
demodulation, bpsk, spread-spectrum
Now, let's apply the code. You'll take one symbol $s$, in case of BPSK, one bit, represent it as $\{-1,+1\}=S$, and multiply it to get the transmit sequence $t$. You get the set of possible transmit sequences $t_{i,s}$ for user $i$:
$$T_i = \left\{sc_i \,\forall s\in S \right\}= \left\{ -c_i, +c_i\right\}$$
Notice that $T_i$ spans a vector space that has one dimension less than $C$!
Let's now define a receive signal $r$. We don't know what symbols were sent yet, so we say that user $i$ sent symbol $s_i$, and user $j$ sent symbol $s_j$:
$$r = s_ic_i+ s_jc_j$$
Now, we simply consider $r$ to be a sequence of complex numbers.
What happens now if we multiply $r$ with the individual spreading sequences $c$? Let's do it with user $i$'s code:
$$\begin{align}
<c_i,r> &= <c_i, s_ic_i+ s_jc_j>&\text{linearity of inner product}\\
&= <c_i, s_ic_i>+ <c_i, s_jc_j>&\text{$s_i$, $s_j$ are scalars}\\
&= s_i <c_i, c_i> + s_j <c_i, c_j>&\text{orthonormality}\\
&= s_i \cdot 1 + s_j \cdot 0\\
&= s_i | {
"domain": "dsp.stackexchange",
"id": 5060,
"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": "demodulation, bpsk, spread-spectrum",
"url": null
} |
physical-chemistry, reaction-mechanism, free-energy
A comment on this: the fallacy here is to assume that $a_i=1$ at equilibrium. Only for the pure reagents and products in their standard states it is strictly required by definition that $a_i=1$.
Note also that since $\Delta G^\circ = G_{mAB}^\circ-G_{mA}^\circ-G_{mB}^\circ$ and $G_{mi} = G_{mi}^\circ+RT\ln{\left(\frac{a_\ce{i}}{a_\ce{i}^\circ}\right)}$ we can write
$$\Delta G = G_{mAB}-G_{mA}-G_{mB}$$
In words (and repeating myself), $\Delta G$ in this case is for the process of converting 1 total mole of $A$ and 1 mole of $B$ into 1 mole of $AB$, all at constant T, P and composition (or, equivalently, in a sufficiently large mixture, such that a 1 mole change in the amount of the substances does not change the properties).
Schematically, this is how I interpret the two processes, with equation 2 for mixing in the top, and the reaction of A and B to form AB in the bottom: | {
"domain": "chemistry.stackexchange",
"id": 11648,
"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, reaction-mechanism, free-energy",
"url": null
} |
python, beginner, object-oriented, homework, hash-map
@property
def area(self):
"""
Incorrectly computes the area of the rectangle.
"""
return (self.width + self.height) * 2 # Note: still the incorrect formula
s1 = Rectangle.from_dict({'p1': (1,1), 'p2': (2,2)})
print('point one: ', s1.p1)
print('point two: ', s1.p2)
print('width: ', s1.width)
print('height: ', s1.height)
print('area: ', s1.area)
Output:
point one: Point(x=1, y=1)
point two: Point(x=2, y=2)
width: 1
height: 1
area: 4 | {
"domain": "codereview.stackexchange",
"id": 37655,
"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, object-oriented, homework, hash-map",
"url": null
} |
c++, c++11, multithreading
Title: C++11 ThreadPool implementation A new version of this code based on the provided advice can be found here.
Latest improvement is found here.
I made a simple ThreadPool implementation in C++ using only atomics ( neither std::mutex nor std::condition_variable were used).
The idea is to have a threads_ready increasing to threads.size() until all threads are finished, and then back to 0 when all threads are ready to execute again. This was the simplest I could think of, that actually works in the given scenario.
#include <iostream>
#include <functional>
#include <vector>
#include <thread>
#include <mutex>
#include <atomic>
#include <iomanip>
#include <cassert>
#include <numeric>
using std::vector;
using std::function;
using std::thread;
using std::mutex;
using std::unique_lock;
using std::atomic; | {
"domain": "codereview.stackexchange",
"id": 41540,
"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++, c++11, multithreading",
"url": null
} |
electricity, electrical-engineering
Title: traditional transformer design improvement The traditional tranformers suffer a lot of losses in various forms, some of them are as follows :
1. Flux leakage
2. Eddy currents
3. Hysteresis
Figure :
But as we are taught induction we come across the attached figure of two inductors placed coaxially various times. My point is that if we would actually place inductors in this way, we would have the following benefits :
Note : taking inner coil as primary
NO NEED OF CORE : As the flux of inner coil passes from outer on its own, no core is needed for transferring flux from primary to secondary
NO FLUX LEAKAGE : As entire flux of inner inductor passes from outer, no flux is leaked.
NO EDDY CURRENTS: As no core is used no eddy currents are generated.
NO HYSTERESIS : Similarly due to absense of core, no loss due to hysteresis is encountered. | {
"domain": "physics.stackexchange",
"id": 9947,
"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": "electricity, electrical-engineering",
"url": null
} |
• Alas I am not a lawyer, so I do not know what is allowed when defending a client. But as a logician, I know that argument by contradiction is "logical", at least if we are discussing classical logic. I am also aware of paraconsistant logics where argument by contradiction doesn't hold, but in my everyday reality I don't worry too much about the possibility that statements like "I have 20€" are both true and false simultaneously. – gmatht Feb 25 '16 at 9:50
• I Edit my post to explain it. My point is exactly that reality is full of thing that are simultaneously true and false – Dac0 Feb 25 '16 at 10:23 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9845754452025767,
"lm_q1q2_score": 0.8204709364653608,
"lm_q2_score": 0.8333245973817158,
"openwebmath_perplexity": 479.48238343653946,
"openwebmath_score": 0.6731948256492615,
"tags": null,
"url": "https://math.stackexchange.com/questions/1667884/are-proofs-by-contradiction-really-logical/1670369"
} |
coronavirus
Long answer: There is now an experimental paper, which infected rhesus macaques with SARS-CoV2, tested if the infection was similar to humans happening in the upper airways (which it was), and re-infected the animals after 28 days with a really high dose of virus (which is much higher than what comes around in our environment), with none of the macaques getting re-infected or showing pathological signs of the infection. See reference 1 for details.
This article has its limitations with small sample size and the general questions if the chosen animal model is really comparable with human. | {
"domain": "biology.stackexchange",
"id": 10387,
"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": "coronavirus",
"url": null
} |
quantum-field-theory, electromagnetism, thermodynamics, statistical-mechanics
Title: Why is $B(T)\approx b(T-T_C)$ near critical point $T_C$ in Landau theory? In Peskin&Schroeder page $270$ equation $(8.4)$ you see that they approximate the function $B(T)$ near the Curie temperature as
$$B(T)\approx b(T-T_C)$$
i.e. they omit $B(T_C)$ in the Taylor expansion of $B(T)$. Similarly for $C(T)$ they just keep $C(T) \approx c.$
How come this is OK?
For those without the book in hand:
$\partial G/\partial M=H$ where $G=$ Gibbs free energy, $M=$ magnetization, $H= $ external magnetic field. For $T$ near $T_C$, $M\approx 0$ so we expand gibbs:
$$G(M) = A(T)+B(T)M^2+C(T)M^4+\cdots$$ with only even powers of $M$ due to symmetry of the system under $M\rightarrow -M$. In Landau's theory, the order parameter $M$ should make $G(M)$ minimal.
$$\frac{\partial G}{\partial M} = 2 B(T) M + 4 C(T) M^3=0$$
$$\frac{\partial^2 G}{\partial M^2} = 2 B(T) + 12 C(T) M^2 > 0$$
Hence, $M=0$ or $M = \pm M_0 = \pm \sqrt{ - \frac{B(T)}{2 C(T)}}$ | {
"domain": "physics.stackexchange",
"id": 12129,
"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, electromagnetism, thermodynamics, statistical-mechanics",
"url": null
} |
means that even though you're summing up an infinite. We've already looked at these. A divergent sequence doesn't have a limit. From charlesreid1. is convergent. A convergent series runs to the X axis and gets as close as you like; close enough, fast enough to take an area under the curve. Directed by Drew Hall. The number R is called the radius of convergence of the power series. 2 says (among other things) that if both P 1 n=1 a n and P 1 n=1 b n converge, then so do P 1 n=1 (a n + b n) and P 1 n=1 (a n b n). More examples of evaluating series can be found on the following page: Series Convergence and Divergence Practice Examples 1; Series Convergence and Divergence Practice Examples 2; Series Convergence and Divergence Practice Examples 3; Series Convergence and Divergence Practice Examples 4; Series Convergence and Divergence Practice Examples 5. In a helpful review article Franciska Snoek Henkemans reminds us that in. The general theme is convergence, in Section 2 this is studied | {
"domain": "iaex.pw",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9919380087100574,
"lm_q1q2_score": 0.8329640337712675,
"lm_q2_score": 0.8397339616560072,
"openwebmath_perplexity": 456.0050046906253,
"openwebmath_score": 0.8870593905448914,
"tags": null,
"url": "http://azgr.iaex.pw/convergent-series.html"
} |
The formula for $$f$$ follows from differentiating the CDF above. Properties (a) and (b) follow from standard calculus.
Open the special distribution simulator and select the folded normal distribution. Keep $$\mu = 0$$ and vary $$\sigma$$, and note the shape of the probability density function. For selected values of $$\sigma$$, run the simulation 1000 times and compare the empricial density function to the true probability density function.
### Moments
The moments of the half-normal distribution can be computed explicitly. Once again we assume that $$X$$ has the half-normal distribution with parameter $$\sigma \in (0, \infty)$$.
For $$n \in \N$$ \begin{align} \E(X^{2n}) & = \sigma^{2n} \frac{(2n)!}{n! 2^n}\\ \E(X^{2n+1}) & = \sigma^{2n+1} 2^n \sqrt{\frac{2}{\pi}} n! \end{align}
Proof | {
"domain": "libretexts.org",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9877587272306607,
"lm_q1q2_score": 0.8029167783189268,
"lm_q2_score": 0.8128673087708698,
"openwebmath_perplexity": 192.34280191953195,
"openwebmath_score": 0.9952647686004639,
"tags": null,
"url": "https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.13%3A_The_Folded_Normal_Distribution"
} |
performance, vba, excel
Title: How to copy and paste a filtered range more efficiently I have this bit of code that works for copy and pasting an autofiltered range. I just wanted to see if anyone knew a more efficient way to do so as it does take quite a while to complete it the way I have it now. I looked into trying to do so with a copying into an array but did not seem to work so I'm happy to hear some of your suggestions! Also I have to be sure that the range I am copying and pasting is not the full data range and only the range after the filter was applied.
Sub FullWork()
Dim shWorkBook As Worksheet
Dim shPivotTable As Worksheet
Dim shCarrierRates As Worksheet
Dim shWholesaleLocation As Worksheet
Dim shPWLocation As Worksheet
Dim wkb As Workbook
Dim shSegmentation As Worksheet
Dim MilageMatrix As Worksheet
Dim FullYearData As Worksheet
Dim StartForm As Worksheet
Set wkb = ThisWorkbook
With wkb | {
"domain": "codereview.stackexchange",
"id": 38990,
"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": "performance, vba, excel",
"url": null
} |
quantum-mechanics
The most concrete way I can think of to quantify isolation is that the diamond can neither emit or receive particles of matter or energy.
Keeping out particles of matter is the easier part of that, since it means you "just" need the most absolute vacuum every created, including removal of all high-energy particles such as cosmic rays. Preventing energy exchanges is much, much harder. The vacuum keeps you from exchanging phonons (sound quanta), so you get two (matter and phonons) for the price of one with that one. Your suspension system would need to be phonon-free, however, at least if you do the experiment here on earth.
That leaves mostly electromagnetic radiation. Radio frequencies whose wavelengths are a lot larger than the distance you want the diamond to jump are not a big problem, although if you get enough of them you may start locating the diamond too well and thus "lose coherence" as they say these days (it's the same idea). | {
"domain": "physics.stackexchange",
"id": 3753,
"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
} |
javascript
if(localStorageEmail === null)formEmail.value = '';
else formEmail.value = localStorageEmail;
// create listeners
document.querySelector('input[type="submit"]').addEventListener('click',submit);
document.querySelector('input[type="email"]').addEventListener("focus", focus);
document.querySelector('input[type="password"]').addEventListener("focus", focus);
//window.addEventListener("pageshow", clearBack);
//localStorage has valid email - fill form with email and dummy password
if(localStorageEmail !== null){
formEmail.value = localStorageEmail;
formPassword.value = localStoragePassword;
//check remember me box
document.querySelector('input[type="checkbox"]').checked=true;
}
function submit(){
event.preventDefault();
const emailPass = {};
let responseData = {};
formEmail.value = formEmail.value.toLowerCase();
const eflag = emailCheck(formEmail.value);
const pflag = passwordCheck(formPassword.value); | {
"domain": "codereview.stackexchange",
"id": 43705,
"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",
"url": null
} |
homework-and-exercises, optics, laser, structural-beam
Title: How to calculate the beam size of a laser from the end of a fibre? I need to calculate the beam size of the laser beam after a distance $z = 2$ mm from the fibre tip.
I know the numerical aperture NA = 0.59, half angle $\theta = 36$ degrees, and core diameter $d_\mathrm{core} = 5$ mm of the fibre.
Not sure why I haven't been able to find an answer for this, so please can someone help?
Thanks! That seems like a high NA for a fiber. Usually they are NA = 0.22 or so. But assuming that you have an NA = 0.59, you can calculate the angle NA = Sin(theta), so theta = 36.15 degrees (half angle of cone). At a distance of 2 mm away, you can calculate the half diameter of the illuminated spot with Y = z Tan(theta) = 1.461 mm. So the spot diameter will be twice that value at a distance of 2mm. D = 2.923 mm. | {
"domain": "physics.stackexchange",
"id": 33154,
"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, optics, laser, structural-beam",
"url": null
} |
slam, navigation, rosmake, ros-electric
[rosmake-2] Starting >>> rosgraph_msgs [ make ]
[rosmake-1] Starting >>> rosmaster [ make ]
[rosmake-3] Finished >> rosunit [ make ]
[rosmake-1] Finished >> angles [ make ]
[rosmake-2] Starting >>> roscpp [ make ]
[rosmake-1] Starting >>> rospy [ make ]
[rosmake-0] Finished >> rosnode [ make ]
[rosmake-3] Finished >> eigen [ make ]
[rosmake-1] Starting >>> rosout [ make ]
[rosmake-0] Finished >> cminpack [ make ]
[rosmake-2] Finished >> flann [ make ]
[rosmake-0] Starting >>> roslaunch [ make ] | {
"domain": "robotics.stackexchange",
"id": 11487,
"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": "slam, navigation, rosmake, ros-electric",
"url": null
} |
A greedy algorithm would hive an answer of $$24$$, as given by the "Erdos-Szekeres" sequence here: http://oeis.org/A003278 .
But, as demonstrated by RobPratt, and as often happens in analysis, the greedy algorithm is ultimately not the optimal one. It's as if you overuse an initially fertile soil, exhaust its nutrients and then you find you can't grow crops until you give time for rains to fall and the soil to replenish itself. Let's explore why greed turned out not good in this case.
Welcome to the desert
Suppose you have a list of whole numbers, with a minimum of $$1$$ and a maximum of $$n$$, such that there is not a group of three in arithmetic sequence. Then the arithmetic third of any pair of numbers from this list cannot be larger than $$2n-1$$, and so you can always insert the number $$2n$$ and be sure there is still no three-term arithmetic sequence. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429116504951,
"lm_q1q2_score": 0.8522828358385808,
"lm_q2_score": 0.8652240686758841,
"openwebmath_perplexity": 391.6720657693414,
"openwebmath_score": 0.6938482522964478,
"tags": null,
"url": "https://math.stackexchange.com/questions/4458703/whats-the-size-of-the-biggest-set-of-numbers-from-1-to-100-so-that-no-number-is"
} |
java, strings
int endPosistion = from.indexOf(endDelimiter, startPosistion);
return (startPosistion != NOTFOUND && endPosistion != NOTFOUND);
}
this allows me to rewrite my while method to this. while (stringHasStringBetweenTwoCharacters(from, startDelimiter, endDelimiter)) but this makes the tests fail because my method is not looking at where we left off in our string. I removed it on purpose because I wanted this method to only find the first occurrence of a string in between 2 characters. So this means I have to change the logic slightly. Instead of keeping track of where we are in the string, lets just remove up to the endPosistion and leave the rest.
public static String[] split(String from, char startDelimiter, char endDelimiter)
{
ArrayList<String> list = new ArrayList<>(); | {
"domain": "codereview.stackexchange",
"id": 4788,
"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, strings",
"url": null
} |
quantum-field-theory, string-theory
Z. Bern, Perturbative Quantum Gravity and its Relation to Gauge Theory, Living Rev. Relativity 5 (2002) 5; Section 3.1. | {
"domain": "physics.stackexchange",
"id": 16104,
"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, string-theory",
"url": null
} |
property-testing
So, the question is : are you aware of a result on this problem ? And if not, have you got some better ideas that we have ? Your problem is well-understood in the case $S = \{0,1\}$. Here, the function $\phi$ can be viewed as the adjacency matrix of a graph $G_\phi$ on the vertex set $V$. And $\phi$ satisfying a triangular property $P$ just means that $G_\phi$ is free of some collection $C_P$ of induced subgraphs, each on $3$ vertices. Now, it is known [Alon-Fischer-Krivelevich-Szegedy '99] that any such property is testable (in the property testing sense) with query complexity, independent of $n$, bounded from above by a tower of exponentials of height polynomial in $1/\epsilon$. In particular, when $P$ is 1 only when its input is $(1,1,1)$, the property corresponds to triangle-freeness in graphs for which the best upper-bound is the tower of exp's I mentioned and the best lower bound is slightly superpolynomial in $1/\epsilon$ [Alon '01]. If you want better dependence on $1/\epsilon$ | {
"domain": "cstheory.stackexchange",
"id": 133,
"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": "property-testing",
"url": null
} |
reinforcement-learning, keras, ddpg, control-problem
First, is it even possible to use DDPG for multi-dimensional continuous action spaces? My research leads me to believe it is, but I have not found any code examples to learn from and many of the papers I have read are near the limit of my understanding in this area.
Second, why might my actor network be outputting values clustered near its max/min values, and why would the values in either cluster all be the same?
Again, I am fairly new to reinforcement learning, so any advice or recommendations would be greatly appreciated, thanks.
First, is it even possible to use DDPG for multi-dimensional
continuous action spaces?
Yes, DDPG was primarily developed to deal with continuous action space you can find out more here, here and here.
I have not found any code examples to learn from and many of the
papers I have read are near the limit of my understanding in this
area. | {
"domain": "ai.stackexchange",
"id": 2524,
"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": "reinforcement-learning, keras, ddpg, control-problem",
"url": null
} |
quantum-field-theory, symmetry, group-theory, conformal-field-theory, wick-rotation
Title: Poincaré Symmetry becoming Mobius Symmetry for Euclidean Theory on Riemann Sphere I've just started reading some introductory notes by Goddard and Gaberdiel on CFTs. The authors start by considering a Euclidean signature meromorphic field theory on the Riemann sphere. They state that
'...in the present context, the role of the Poincaré group is played by the group of Möbius transformations' (pg 11).
Can someone please expand on this? How does the group of Möbius transformations enter the story? | {
"domain": "physics.stackexchange",
"id": 87083,
"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, symmetry, group-theory, conformal-field-theory, wick-rotation",
"url": null
} |
filters, filter-design, infinite-impulse-response, finite-impulse-response
If the phase response is of importance to you, then one problem you will be facing when designing IIR filters in the frequency domain is the exact choice of the desired phase response. If the overall shape of the desired phase is given you still have one degree of freedom, which is the delay. E.g., if the desired phase is $\phi_D(\omega)$, and the desired magnitude is $M_D(\omega)$ then your desired frequency response can be chosen as
$$H_D(\omega)=M_D(\omega)e^{j(\phi(\omega)-\omega\tau)}\tag{1}$$ | {
"domain": "dsp.stackexchange",
"id": 5275,
"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, filter-design, infinite-impulse-response, finite-impulse-response",
"url": null
} |
java, awt
synchronized (simulatedWindows){
for (SimulatorWindow window: simulatedWindows){
drawWindowMenu(graphics, window);
Graphics windowGraphics =
graphics.create(window.getX(), window.getY(),
window.getWidth(), window.getHeight());
// This should never happen
assert !(windowGraphics instanceof Graphics2D): "WindowSimulator.paint2D(Graphics2D): Could not cast to Graphics2D";
window.paint2D((Graphics2D) windowGraphics);
windowGraphics.dispose();
}
}
} | {
"domain": "codereview.stackexchange",
"id": 11445,
"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, awt",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.