input stringlengths 38 38.8k | target stringlengths 30 27.8k |
|---|---|
I am struggling with the following problem:
Given a set of finite binary strings $S=\{s\_1,\ldots,s\_k\}$, we say that a string $u$ is a concatenation over $S$ if it is equal to $s\_{i\_{1}} s\_{i\_{2}} \cdots s\_{i\_{t}}$ for some indices $i\_1,\ldots, i\_t \in \{1,\ldots, k\}.$
Your friend is considering the follow... | You can also prove this using automata theory. For a set $S = \{s\_1,\ldots,s\_k\}$ of strings over $\Sigma$, consider the following language over $\Sigma \cup \{1,\ldots,k\}$:
$$ L\_S = (1s\_1+2s\_2+\cdots+ks\_k)^+. $$
This language is accepted by a DFA of size roughly $\|S\| := |s\_1|+\cdots+|s\_k|$. The exact size d... |
Let's say I am calculating heights (in cm) and the numbers must be higher than zero.
Here is the sample list:
```
0.77132064
0.02075195
0.63364823
0.74880388
0.49850701
0.22479665
0.19806286
0.76053071
0.16911084
0.08833981
Mean: 0.41138725956196015
Std: 0.2860541519582141
```
In this example, according to the nor... | In one of the comments you say you used "random data" but you don't say from what distribution. If you are talking about heights of humans, they are roughly normally distributed, but your data are not remotely appropriate for human heights - yours are fractions of a cm!
And your data are not remotely normal. I'm guess... |
As a mathematician/economist, I am not trained to think in classification and regression tasks. This is why I wonder: is there a clear, widely accepted definition of regression and classification problems?
E.g., [this paper](https://arxiv.org/pdf/1302.1545.pdf) says that *When $Y$ has a finite number of states we
refe... | To muddy the waters further, classification can mean
1. trying to find distinct classes in a dataset from scratch, which has attracted many different names, including **mathematical** or **numerical taxonomy**, but **cluster analysis** seems the most durable and popular
2. assigning observations to classes already def... |
I am trying to train a deep network for twitter sentiment classification. It consists of an embedding layer (word2vec), an RNN (GRU) layer, followed by 2 conv layers, followed by 2 dense layers. Using ReLU for all activation functions.
I have just started using tensorboard & noticed that I seemingly have extremely sma... | Edit: Definitely try Xavier initialization first, as the other answerer said.
In other cases, where you have to increase the gradient manually...
Gradient means rate of change of your loss function. If your loss function is not changing much with respect to certain weights, then changing those weights doesn't change ... |
Given a list of (small) primes $ (p\_0, p\_1, \dots, p\_{n-1})$, is there an (efficient) algorithm to enumerate, in order, all numbers that can be expressed as $ \prod\_{k=0}^{n-1} p\_k^{e\_k} $, where $e\_k \in \mathbb{Z}, e\_k \ge 0 $? What about in a certain interval, potentially at an exponential starting point?
F... | You can generalize the standard algorithm for enumerating Hamming numbers in increasing order by merging with a min-heap. The Hamming numbers are the numbers expressible with primes 2, 3 and 5.
If you can enumerate the expressible numbers in order, the non-expressible numbers are easily found in the successive gaps. T... |
Parity and $AC^0$ are like inseparable twins. Or so it has seemed for the last 30 years. In the light of Ryan's result, there will be renewed interest in the small classes.
Furst Saxe Sipser to Yao to Hastad are all parity and random restrictions. Razborov/Smolensky is approximate polynomial with parity (ok, mod gates... | [Benjamin Rossman](http://www.mit.edu/~brossman/)'s result on $AC^0$ lowerbound for k-clique from STOC 2008.
---
References:
* Paul Beame, "[A Switching Lemma Primer](http://www.cs.washington.edu/homes/beame/papers/primer.ps)", Technical Report 1994.
* Benjamin Rossman, "[On the Constant-Depth Complexity of k-Clique... |
I don't really understand when it come to mixed model,
how do you know when to use linear or nonlinear model?
For example, when using R function `lmer` to build linear mixed model,
my model may look like this:
```
lmer( Y ~ X1 + X2 + X1*X2 + (1|Z) )
```
where $Y$ is the response (from a repeated measured data), ... | It's not exactly about whether the relationships between Y and the various X are linear or not; a linear model is one that is linear in the *parameters* (just like the case with nonmixed models). So
$Y = a + b\_1X\_1 + b\_2X\_2^2 + b\_3X\_3$
is linear, but if there are parameters (b) in the exponents, it is not.
Us... |
I wanted to make a tool which minimizes the interference between antennas.
Currently, the tool is very limited for prototyping reasons. It can only place an antenna every 1 meters. The available space that the antennas can be placed is 1 dimensional and is 15 meters wide.
The user can only decide how many antennas wi... | I'll start with the second question because it's easier. How could increasing the mutation rate improve the results?
Genetic algorithms can beat random searches when they converge on the right answer. Similar to other machine learning algorithms, genetic algorithms have an "explore" phase and a "converge" phase. If th... |
This is **not** a class assignment.
It so happened that 4 team members in my group of 18 happened to share same birth month. Lets say June. . What are the chances that this could happen. I'm trying to present this as a probability problem in our team meeting.
Here is my attempt:
* All possible outcome $12^{18}$
* 4 ... | You can see your argument is not correct by applying it to the standard birthday problem, where we know the probability is 50% at 23 people. Your argument would give $\frac{{23\choose 2}{365\choose 1}}{365^{23}}$, which is very small. The usual argument is to say that if we are going to avoid a coincidence we have $365... |
I would like to give a mathematics talk on the [git](https://no.wikipedia.org/wiki/Git) revision control system. It is now widely used in mathematics as well as in the computer science industry. For example, the HoTT (Homotopy Type Theory) community uses it, and it is the go to system for collaborative editing of text ... | A git repository can be thought of as a partially ordered set of revisions (where one revision is earlier than another in the order if it is a direct or indirect successor of the earlier one). The partial orders that you get from git repositories tend to have low width (the size of the largest set of mutually independe... |
Wouldn't data be lost when mapping 6-bit values to 4-bit values in DES's S-Boxes? If so, how can we reverse it so the correct output appears? | See Chapter 5 of the textbook "Introduction to Modern Cryptography" by Katz and Lindell. |
I have been given a project to implement an [SIRS model](http://en.wikipedia.org/wiki/Epidemic_model#The_SIRS_Model). While searching how to do it, I found this site and a [question related to epidemic model](https://stats.stackexchange.com/q/16437/930). It is very much related to my project and is quite helpful. Howev... | Let's go for the one-line solution:
```
replicate(1000, mean(rnorm(100, 69.5, 2.9)) - mean(rnorm(100, 63.9, 2.7)))
``` |
This is a basic question on Box-Jenkins MA models. As I understand, an MA model is basically a linear regression of time-series values $Y$ against previous error terms $e\_t,..., e\_{t-n}$. That is, the observation $Y$ is first regressed against its previous values $Y\_{t-1}, ..., Y\_{t-n}$ and then one or more $Y - \h... | You say "the observation $Y$ is first regressed against its previous values $Y\_{t−1},...,Y\_{t−n}$ and then one or more $Y−\hat{Y}$ values are used as the error terms for the MA model." What I say is that $Y$ is regressed against two predictor series $e\_{t-1}$ and $e\_{t−2}$ yielding an error process $e\_t$ which wil... |
```
int foo(N){
if(N <= 1){
return 0
}else{
return 1 + foo(N-1)
}
}
```
I can tell that the time complexity of this program is O(N) but I am unsure on how to prove it mathematically? If I can get some hints I'd grealy appreciate it. | You can use induction on input.
For example, in your foo,
to show that foo(N) uses exactly N comparisons,
**Base case:** foo(1) uses 1 comparison
**Induction hypothesis:** foo(N) uses N comparisons
**Step case:** foo(N+1) does one comparison and then call foo(N), thus in total, does N+1 comparisons.
You can prove ... |
I was reading a tutorial on marginal densities when I came across this example (rephrased).
A person is crossing the street and we want to compute the probability when he gets hit by a passing car depending on the color of the traffic light.
Let H be whether the person gets hit or not, and L be the color of the tra... | I have tried to explain this example with assumed values of Joint Probability: [](https://i.stack.imgur.com/313KR.png) |
Given an $n$ vertex undirected graph, what is the best known runtime bound for *finding* a subgraph which is a $k\times k$-biclique? Are there faster parametrized algorithms than the
$\binom{n}{k}\mbox{poly}(n)$ time algorithm of "guessing" one side of the biclique and see if there are at least $k$ other vertices incid... | Parameterized by degeneracy or arboricity, it's FPT. More specifically, $O(d^3 2^d n)$ where $d$ is the degeneracy (or $a^3 2^{2a}$ for arboricity). See:
* Arboricity and bipartite subgraph listing algorithms.
D. Eppstein.
[Inf. Proc. Lett. 51:207-211, 1994](http://dx.doi.org/10.1016/0020-0190%2894%2990121-X).
Anoth... |
I have R-scripts for reading large amounts of csv data from different files and then perform machine learning tasks such as svm for classification.
Are there any libraries for making use of multiple cores on the server for R.
or
What is most suitable way to achieve that? | If it's on Linux, then the most straight-forward is [**multicore**](http://cran.r-project.org/web/packages/multicore/index.html). Beyond that, I suggest having a look at [MPI](http://www.stats.uwo.ca/faculty/yu/Rmpi/) (especially with the [**snow**](http://cran.r-project.org/web/packages/snow/index.html) package).
Mor... |
>
> Which algorithms are used most often?
>
>
>
Please write a single algorithm per answer, try to keep your answer short (one or two lines). | [Quicksort](http://en.wikipedia.org/wiki/Quicksort) |
Let's say that I know the following:
* $P(A|B)$ is the probability that a storm is coming given it's cloudy.
* $P(A|C)$ is the probability that a storm is coming given that the dogs bark.
* $P(B)$ and $P(C)$ are independent.
How do I compute the following?:
* $P(A|B,C)$, the probability of a storm coming given that ... | The answer is the conflation of probabilities, explained [here](https://stats.stackexchange.com/q/194884).
In the syntax that answers my question, the equation becomes:
$P(A|B,C)=\eta{P(A|B) P(A|C)}$
where $\eta$ is the normalization factor:
$\eta=\left({P(A|B)P(A|C) + P(\overline A|B)P(\overline A|C)}\right)^{-1}$... |
One of my friends asks me the following scheduling problem on tree. I find it is very clean and interesting. **Is there any reference for it?**
**Problem:**
There is a tree $T(V,E)$, **each edge has symmetric traveling cost of 1**. For each vertex $v\_i$, there is a task which needs to be done before its deadline $d\_... | *Not sure this is your answer (see below) but a bit too long for the comments.*
I though your problem was something like: [$(P|tree;p\_i=1|\Sigma T\_i)$](http://www-desir.lip6.fr/~durrc/query/search.php?a1=P||&a2=|||a2&a4=|||a4&a3=|||a3&b1=|||b1&b3=|%3Bp_i%3D1|&b7=|||b7&b4=|%3Btree|&b5=|||b5&b6=||&b8=|||b8&c=||sum+T_i... |
What is the reason why we use natural logarithm (ln) rather than log to base 10 in specifying functions in econometrics? | I think that the natural logarithm is used because the exponential is often used when doing interest/growth calculation.
If you are in continuous time and that you are compounding interests, you will end up having a future value of a certain sum equal to $F(t)=N.e^{rt}$ (where r is the interest rate and N the nominal ... |
(There’s no need to write the algorithm, I just need help with the greedy choice).
Problem: you are given bottles numbered 1 to n. Each bottle i has a capacity of Ci and currently contains Li. We want to poor water between the bottles so that as many bottles as possible will be filled (Li = Ci) but doing so while movi... | Assume you have 100 empty one litre bottles and 50 filled two litre bottles. So what is your optimal solution, having 50 filled bottles by doing nothing or having 100 filled bottles by pouring 100 litres into the empty bottles? I assume the latter.
You have a fixed amount of water. To have as many filled bottles as p... |
This is more of a 'meta' question as I cannot give a precise formulation of my question. Consider for example the category of total quasi-orders: we can then distinguish between a 'strict' order (where no two elements are equivalent) and a 'weak order' (where some elements may belong to the same equivalence class). It ... | Complexity theory implicitly makes use of "mild" orders all the time between complexity classes — where there is a relation which is known in one direction, and *unknown* in another.
We might define a "hazy order" $\mathscr R$ to be a class of quasi-orders $\{R\_j\}\_{j \in J}$ together with a class of forbidden relat... |
If I do the PCA on the whole dataset I get 7 components that can explain 90% of the variance, if I split the dataset into 2 (sorted by time), the number of significant components in the first half goes to 5 (with 15 variables present in one or more components) and in the second half goes to 8 (with 21 variables present... | What I've seen is an interpolation of the data in order to match the length (and even the sampling) of the data. This was particulary used (successfully, I must say) in the classification of variable stars using PCA, where the data where the actual light curves of the stars. For more details, see [the paper of Deb & Si... |
I've got a few categorical predictors (like gender,...) and now I want to
build regression models. So I've made the categorical predictors numeric
by for example: "female" --> 1 and "male" --> 0.
But when I do methods like nearest neighbors regression I have to standardize
all the predictors (for example the weights).... | An excellent introductory paper is
[Chib, Siddhartha, and Edward Greenberg. “Understanding the Metropolis-Hastings Algorithm.” *The American Statistician*, vol. 49, no. 4, 1995, pp. 327–335.](https://www.jstor.org/stable/2684568)
[Free download](https://biostat.jhsph.edu/%7Emmccall/articles/chib_1995.pdf)
A masterfu... |
I'd like to know if there have been conjectures that have long been unproven in TCS, that were later proven by an implication from another theorem, that may have been easier to prove. | [Erdös and Pósa](https://www.renyi.hu/~p_erdos/1965-05.pdf) proved that for any integer $k$ and any graph $G$ either $G$ has $k$ disjoint cycles or there is a set of size at most $f(k)$ vertices $S\in G$ such that $G\setminus S$ is a forest. (in their proof $f(k) \in O(k \cdot \log k)$).
The Erdös and Pósa property o... |
I have a series of physicians' claims submissions. I would like to perform cluster analysis as an exploratory tool to find patterns in how physicians bill based on things like Revenue Codes, Procedure Codes, etc. The data are all polytomous, and from my basic understanding, a latent class algorithm is appropriate for t... | It depends on what sense of a correlation you want. When you run the prototypical Pearson's product moment correlation, you get a measure of the strength of association and you get a test of the significance of that association. More typically however, the [significance test](http://en.wikipedia.org/wiki/Significance_t... |
It's well-known that there are tons of amateurs--myself included--who are interested in the P vs. NP problem. There are also many amatuers--myself still included--who have made attempts to resolve the problem.
One problem that I think the TCS community suffers from is a relatively high interested-amateur-to-expert rat... | For a few months at the end of my senior year of college and the beginning of my first year of graduate school I made $60/hour correcting an amateur's incorrect proofs of Fermat's Last Theorem. In this case the person was an academic in another field, so he had a reasonable understanding of the value of expert time. It... |
[This guy](http://www.johndcook.com/blog/2012/07/31/why-computers-were-invented/) asserts:
>
> I’ll say it — the computer was invented in order to help to clarify … a philosophical question about the foundations of mathematics.
> (This problem being Entscheidungsproblem - The Decision Problem)
>
>
>
[The referen... | I can see his point, but I think he's really (deliberately?) confusing computation (and the mathematics thereof) and computers.
A computer is certainly a device for performing computation, but what Church and Turing created was a (well, two, but they're "the same") theoretical (read mathematical) model of the process ... |
How to prove that there exist two different programs A and B such that A printing code of B and B printing code of A without giving actual examples of such programs? | This can be formulated as an instance of [minimum-cost flow problem](https://en.wikipedia.org/wiki/Minimum-cost_flow_problem). Have a graph with one vertex per agent, one vertex per task, and one vertex per category. Now add edges:
* Add an edge from the source to each agent, with capacity 1 and cost 0.
* Add an edge ... |
consider the language:$$CLIQUE = \left\{\langle G,k\rangle \ |\ \text{ $G$ is a graph containing a clique of size at least $k$ } \right\}$$
>
> Suppose there's a polynomial time algorithm for $CLIQUE$. I need to show a polynomial time algorithm for finding a clique of size $k$.
>
>
>
Now, the idea is pretty easy ... | Keep removing vertices until the graph no longer contains a clique of size $k$, and let $v$ be the last vertex that you removed. It follows that there is some $k$-clique which contains $k$. Remove all vertices from the graph other than neighbors of $v$ (so $v$ itself is also removed), and recursively find a $(k-1)$-cli... |
The algorithm take in an integer $n$ and outputs the $n$th number in the Fibonacci sequence ($F\_n$). The sequence starts with $F\_0$. I am trying to prove the correctness assuming valid input:
```
int Fib(int n) {
int i = 0;
int j = 1;
int k = 1;
int m = n;
while(m >= 3){
m = m-3;
... | This is essentially a [Segment tree](https://en.wikipedia.org/wiki/Segment_tree) which is a data structure that augments an array with a binary tree as you describe such that:
* You have fast set and get at any index
* You have fast "aggregate" queries on ranges
* You can support fast update queries on ranges, for som... |
**The Question:** Are there any good examples of [reproducible research](http://reproducibleresearch.net/index.php/Main_Page) using R that are freely available online?
**Ideal Example:**
Specifically, ideal examples would provide:
* The raw data (and ideally meta data explaining the data),
* All R code including dat... | The journal Biostatistics has an Associate Editor for Reproducibility, and all its articles are marked:
>
> **Reproducible Research**
>
>
> Our reproducible research policy is for papers in the journal to be
> kite-marked D if the data on which they are based are freely
> available, C if the authors’ code is free... |
Is there any programming language in which any equivalent program has a unique normal representation, and that normal representation is decidable?
Is other words, suppose A and B are programs written on that hypothetic language. Suppose, too, that for any input x, A(x) = B(x) - that is, those programs are equivalent.... | What you are asking for does not exist for a general-purpose programming language (by which we mean that the language can simulate Turing machines, and that Turing machines can simulate the language). Let me first recall the proof, and then turn the question around to discover something interesting.
We have to make yo... |
I need to choose a model for unsupervised machine learning problem.
There are 4 clusters in 3D space.
These are my requirements:
* I will run the same model multiple times with different training data (it is for real-time application).
* Size of training data is expected to be around 400 points.
* I can assume that po... | Here are a couple suggestions, given that Gaussian mixture models work well for you in the absence of outliers.
To increase robustness to outliers, you could use a trimmed estimator for Gaussian mixture models instead of fitting with the standard EM algorithm. Some relevant papers:
* [Neykov et al. (2007)](https://pd... |
Im looking for an algorithm that can deduct a set of rules based on a dataset of "training documents" that can be applied to classify a new unseen document. The problem is that I need these rules to be viewable by the user in the form of some string representation. For example, the algorithm found that documents have a... | A good rule of thumb is to look at the [level of measurement](https://en.wikipedia.org/wiki/Level_of_measurement) of the target/response variable. If the response is measured on a nominal scale, the problem is a classification problem. Values on a nominal scale are for example labels of a categories where the categorie... |
A Vector Addition System (VAS) is a finite set of *actions* $A \subset \mathbb{Z}^d$. $\mathbb{N}^d$ is the set of *markings*. A run is a non-empty word of markings $m\_0 m\_1\dots m\_n$ s.t. $\forall i \in \{0, \dots, n-1\}, m\_{i+1}-m\_i \in A$. If such a word exists we say that $m\_n$ is *reachable* from $m\_0$.
Th... | The idea is based on a discussion I got with Grégoire Sutre this afternoon.
The problem is decidable as follows.
A Petri net $T$ is a finite set of pairs in $\mathbb{N}^d\times\mathbb{N}^d$ called transitions. Given a transition $t=(\vec{u},\vec{v})$, we denote by $\xrightarrow{t}$ the binary relation defined on the... |
I saw a joke on twitter today that got me thinking on how to perform a time complexity analysis of this algorithm such as you can express that the worst case is dependent on the input **value** in addition to the input size.
The joke algorithm was this *sleep sort* algorithm in javascript
```javascript
const arr = [2... | A simple example of undecidable mathematical statements are whether multivariate integer polynomials have natural roots.
This means that we an expression $E(n\_0,\ldots,n\_k)$ built from natural number constants, natural number variables $n\_0,\ldots,n\_k$, addition, substraction and multiplication. We then want to kn... |
I am designing an automaton which determines whether a binary number is divisible by 3:
$$ \{x \in \{0, 1\}^\* \mid \text{$x$ represents a multiple of three in binary} \} $$
| | 0 | 1 |
| --- | --- | --- |
| 0F | 0 | 1 |
| 1 | 2 | 0 |
| 2 | 1 | 2 |
[](https://i.stack.imgur.co... | When you read a number $b\_0 \ldots b\_{n-1}$ from the LSB to the MSB, its remainder modulo 3 is
\begin{align}
&b\_0 + 2b\_1 + 4b\_2 + 8b\_3 + 16b\_4 + 32b\_5 + \cdots \bmod 3 \\ = \,
&b\_0 - b\_1 + b\_2 - b\_3 + b\_4 - b\_5 + \cdots
\end{align}
In other words, when reading bits with even indices, the remainder modulo ... |
Written in English, does "the set S contains *only* members of set T" imply that S does contain some member of set T?
How would this relationship be written formally? | My view is that vernacular would consider that S is not empty,
i.e. $\emptyset \neq S\subseteq T$, while mathematical language would
consider that S can be empty, i.e. $\emptyset\subseteq S\subseteq T$.
Lay people do not speak of empty sets, while mathematicians are
aware of their role in their work.
That means that ... |
For example, one way to view maximum weight matching is that each vertex $v$ gets a utility $f\_v= w(e\_v)$ that equals the weight of the edge it's matched on, and zero otherwise.
accordingly, a maximum weight matching could then be viewed as maximizing the objective $\sum\_v f\_v$.
Have any generalizations of maxim... | Maximum weight matching on $G$ is equivalent to maximum weight independent set on [line-graph](http://en.wikipedia.org/wiki/Line_graph) of $G$, and can be written as follows
$$\max\_{\mathbf{x}} \prod\_{ij \in E} f\_{ij}(x\_i,x\_j)$$
Here $\mathbf{x}\in\{0,1\}^n$ is a vector of vertex occupations, $f\_{ij}(x,y)$ retu... |
I need a hint on the problem below. This is related to predictive analysis and chemical engineering. I don't background in chemical engineering, and that's why I am looking for some hints. I want to know if there's a technical term for the variable/problem I am working on. This would help better fine my search.
Imagin... | Is the term you're looking for simply the **rate law** of the reaction?
Every chemical reaction has an associated kinetic rate law, consisting of its **rate constant**, and its **reaction orders**. Consider the reaction:
$A + B -> C$
Due to the conservation of mass, we can effectively model the **rate of formation**... |
I've understood the main concepts behind overfitting and underfitting, even though some reasons as to why they occur might not be as clear to me.
But what I am wondering is: *isn't overfitting "better" than underfitting?*
If we compare how well the model does on each dataset, we would get something like:
Overfitting... | I liked the question and the key concept to answer it is [Bias–variance tradeoff](https://towardsdatascience.com/understanding-the-bias-variance-tradeoff-165e6942b229). Both underfitted model and overfitted model have some valid use case.
For example my answer here
[Is an overfitted model necessarily useless?](https:... |
I have been working on an independant project focusing on cellular automata and was wondering if this might be something that I could continue on in graduate school somewhere. I've seen some mathematics departments with symbolic dynamics as well as a few CS departments with researchers interested in CA. The list is sma... | The AUTOMATA workshop series focuses on cellular automata:
<http://www.eng.u-hyogo.ac.jp/eecs/eecs12/automata2014/> |
I want to calculate the parameter $\lambda$ of the exponential distribution $e^{-\lambda x}$ from a sample population taken out of this distribution under biased conditions. As far as I know, for a sample of n values, the usual estimator is $\hat{\lambda} = \frac{n}{\sum x\_i}$. However my sample is biased as follows:
... | The maximum likelihood estimator for the parameter of the exponential distribution under type II censoring can be derived as follows. I assume the sample size is $m$, of which the $n < m$ smallest are observed and the $m - n$ largest are unobserved (but known to exist.)
Let us assume (for notational simplicity) that t... |
I have a graph. I need visualise it with nodes arranged in a circle. How can I know whether it is possible arrange the nodes on a circle so that there no edges intersect in the visualised graph? | If the edges are permitted to be laid both inside and outside the circle, then it is called the 2-page graphs; if edges can only be laid inside the circle, it is the 1-page graphs, which is also know as the [outerplanar graphs](http://en.wikipedia.org/wiki/Outerplanar_graph). See the [book embedding](http://en.wikipedi... |
I have to proof that in a word $w$ the number of the letter d is always even.
Let $L \subsetneq \Sigma^\*$ be a language over the alphabet $\Sigma = \{a,b,c,d\}$
such that a word $w$ is in $L$ if and only if it is $a$ or $b$ or of the form $w = ducvd$ where $u$ and $v$ are word of $L$.
Examples:
$dacad$, $ddacbdcad$... | The proof is by induction on the length of $w$. If $|w| \leq 2$ then necessarily $w = a$ or $w = b$, and in both cases $w$ doesn't contain any $d$'s. If $|w| \geq 3$ then necessarily $w$ is of the form $ducvd$, where $u,v \in L$ are shorter words. By induction, each of $u,v$ contains an even number of $d$'s. It follows... |
I've read that the chi square test is useful to see if a sample is significantly different from a set of expected values.
For example, here is a table of results of a survey regarding people's favourite colours (n=15+13+10+17=55 total respondents):
```
red, blue, green, yellow
15, 13, 10, 17
```
A chi square test ... | Using the extra information you gave (being that quite some of the values are 0), it's pretty obvious why your solution returns nothing. For one, you have a probability that is 0, so :
* $e\_i$ in the solution of Henry is 0 for at least one i
* $np\_i$ in the solution of @probabilityislogic is 0 for at least one i
Wh... |
Let $L\_1 \in REG$ and $L\_2 \notin REG$ prove or disprove:
$\forall L\_1 ,L\_2 \text{ } $ $\text{ }L\_1^C \cup L\_2\in REG \lor L\_2\setminus L\_1\in REG$
I think that it may be disproved,
but I found it very hard to disprove,
because:
if $L\_2 \subseteq L\_1$ then $L\_2\setminus L\_1 = \emptyset$
and if $L\_1 \su... | I found the full answer in a video by [David Silver](https://www.youtube.com/watch?v=lfHX2hHRMVQ&list=PLqYmG7hTraZBiG_XpjnPrSNw-1XQaM_gB&index=2). The idea is easy enough.
The underlying matrix equation is
$$
v = R^\pi + \gamma P^\pi\_{s, s'} v
$$
Where $v$ is the value function, $R^\pi$ is the immediate reward unde... |
Is support vector machine with linear kernel the same as a soft margin classifier? | I think that the main takeaway here is this: the mere fact that there are these different philosophies of statistics and disagreement over them implies that translating the "hard numbers" that one gets from applying statistical formulae into "real world" decisions is a non-trivial problem and is fraught with interpreti... |
The [3SUM problem](https://en.wikipedia.org/wiki/3SUM) has two variants. In one variant, there is a single array $S$ of integers, and we have to find three different elements $a,b,c \in S$ such that $a+b+c=0$. In another variant, there are are three arrays $X,Y,Z$, and we have to find a number per array $a\in X, b\in Y... | Randomized algorithms
---------------------
If you'll accept a randomized algorithm, yes, it can be done in linear time. There's a randomized algorithm whose expected running time is $O(n)$, and where the probability that it takes longer than $c \cdot n$ time is exponentially small in $c$.
Here's the idea. Randomly p... |
I would like to find (all) cliques in a given graph with 8,568 vertices and 12,726,708 edges. The vertex with the lowes degree has 2000, the vertext with the highest degree has 4007.
The cliques should have exactly 17 vertices.
The algorithm should be fast, because of the size of the graph.
I had the following idea:
... | Eppstein and Strash (2011) show that for a graph $G$ with degeneracy $d$ all maximal cliques can be listed in time $O(dn3^{d/3})$, where the degeneracy is the smallest number such that every subgraph of $G$ contains at least one vertex of degree $d$. The degeneracy is usually small, and in their paper they provide expe... |
[Principal component analysis (PCA)](http://en.wikipedia.org/wiki/Principal_component_analysis) works like this: the first greatest variance on the first principal component, the second greatest variance on the second principal component, and so on.
For me there is a problem with this iterative process.
What if I kno... | The first two are the two best first two. The second one takes the first one into account. |
In a standard algorithms course we are taught that **quicksort** is $O(n \log n)$ on average and $O(n^2)$ in the worst case. At the same time, other sorting algorithms are studied which are $O(n \log n)$ in the worst case (like **mergesort** and **heapsort**), and even linear time in the best case (like **bubblesort**)... | My experience working with real world data is that **quicksort is a poor choice**. Quicksort works well with random data, but real world data is most often not random.
Back in 2008 I tracked a hanging software bug down to the use of quicksort. A while later I wrote simple implentations of insertion sort, quicksort, he... |
I'm looking for a good definition of sparse graphs. Is a sparse graph effectively a big one, with millions/billions of nodes? An example from real world is the Facebook graph. Or can sparse graphs be in small networks as well? | The common definition is that a *family* of graphs $G = (V, E)$ is sparse if $m \in o(n^2)$, with $n = |V|$ and $m = |E|$. Formally, that requires the family to be infinite, and we only know something *in the limit*.
The definition does not apply to graphs of a fixed size per se. One would certainly want $m \ll n^2$ i... |
I need an idea for a new rating system.. the problem in the ordinary one (just average votes) is that it does not count how many votes...
For example consider these 2 cases:
3 people voted 5/5
500 people voted 4/5
The ordinary voting systems just take the average, leading to the first one to be better..
However, I... | You could use a system like [reddit's "best" algorithm](https://web.archive.org/web/20210525100237/https://redditblog.com/2009/10/15/reddits-new-comment-sorting-system/) for sorting comments:
>
> This algorithm treats the vote count
> as a statistical sampling of a
> hypothetical full vote by everyone,
> much as in a... |
In [statistical inference](http://rads.stackoverflow.com/amzn/click/8131503941), problem 9.6b, a "Highest Density Region (HDR)" is mentioned. However, I didn't find the definition of this term in the book.
One similar term is the Highest Posterior Density (HPD). But it doesn't fit in this context, since 9.6b doesn't m... | I recommend Rob Hyndman's 1996 article ["Computing and Graphing Highest Density Regions"](http://www.tandfonline.com/doi/abs/10.1080/00031305.1996.10474359?journalCode=utas20#) in *The American Statistician*. Here is the definition of the HDR, taken from that article:
>
> Let $f(x)$ be the density function of a rando... |
I am wondering if we have a **`A= n*p`** matrix of samples and we run a PC decomposition on it.
Say the eigenvector matrix is **E**, so the samples in the eigenvector space should be
>
> B= A\*(E)^-1
>
>
>
So, I am wondering if there is any rule that the columns of B to be correlated? That is, the first PC loa... | PCs are calculated based on eigenvectors (e1 nad e2 in your case) of correlation or covariance matrix. Eigenvectors are orthogonal, so PCs are uncorrelated. If you would like to check the proof, you can find it on page 432 in *Applied Multivariate Statistical Analysis 6th edition* written by Richard A. Johnson and Dean... |
Suppose I have a two phase experiment. The goal of the experiment will be to test if there are differences in proportions between two treatments. In phase one, I have no idea how many samples I will need as I have no prior information, so say I take 30 samples for each treatment and get proportions of 0.5 and 0.6.
Now... | In various statistical software programs (and, allegedly, in some online 'calculators')
you can specify typical proportions that you'd like to be able to distinguish at the 5% level of significance and with power 80%.
Specifically, if reasonable proportions for Treatments 1 and 2 are $p\_1 = 0.5$ and $p\_2 = 0.6,$ the... |
I have submitted a survey to a sample of artists. One of the question was to indicate the percentage of income derived by: artistic activity, government support, private pension, activities not related with arts. About 65% of the individuals have replied such that the sum of the percentage is 100. The others don’t: for... | I cannot give you an answer for the general case of illogical responses. But for this specific type of question - been there, done that. Not only in a survey, but also in semistructured interviews, where I had a chance to observe how people come up with this kind of answer. Based on this, as well as some general experi... |
>
> The following articles are reprinte of [#3375492](https://math.stackexchange.com/questions/3375492/what-is-the-post-hoc-power-in-my-experiment) of math.stackexchange.com. It was recommended to ask this community at math.stackexchange.com.
>
>
>
**My motivations**
I often see the claims that post-hoc power i... | Let's examine the well accepted statistical definitions of "power," "power analysis," and "post-hoc," using this site's tag information as a guide.
[Power](https://stats.stackexchange.com/tags/power/info)
>
> is a property of a hypothesis testing method: the probability of rejecting the null hypothesis given that it... |
I am supposed to create CFG for this languague:
$L= \{w : w \in \{a, b\}^\*, |w\_b| = 3k, k \geq 0 \}$
where $|w\_b|$ is count of terminals $b$ in $w$.
**For example:**
aa - OK, no 'b'
abb - wrong, only 2 'b'
aaabbb - OK, 3 times 'b'
aababbb - wrong, 4 times 'b'
abbbbbaaa - wrong, 5 times 'b'
abababbbaaab - OK... | **Hint**: A string with exactly one $a$ would look like this:
$$
(\text{any number of } b's)\,a\,(\text{any number of } b's)
$$
and a grammar to generate the language of these strings is $S\rightarrow AaA,\ \ A\rightarrow bA\mid \epsilon$.
Generalize. |
I have a question regarding hyperparameter optimization in scikit learn. I am most familiar with tensorflow where you first split your data into three sets: Train, validation and test. Hyperparameters are optimized using the train and validation sets, and then the model is finally evaluated using the test set. All data... | I think it will suit you [sklearn.model\_selection.PredefinedSplit](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.PredefinedSplit.html#sklearn.model_selection.PredefinedSplit).
From the user manual [User guide](https://scikit-learn.org/stable/modules/cross_validation.html#predefined-split) :... |
Every paper says that Green's construction is the best 16-input sorting
network as for now.
But why does Wikipedia says: "Size, lower bound: 53"?
I thought "lower bound" meant:"If there exists at least an algorithm that can...". Am I wrong? | No, a lower bound means that somebody has proved that anything smaller than 53 is impossible. That doesn't mean that a 53-gate network is known or even necessarily possible; just that there cannot be a smaller one than that. |
Can someone explain what is the confidence interval? Why it should be 95%? When it is used and what is it measuring? I understand it's some kind of evaluation metric, but I can't seem to find a decent explanation by connecting it to real-world examples.
Any help would be greatly appreciated.
thanks | **You might find it instructive to start with a basic idea: *the variance of any random variable cannot be negative.*** (This is clear, since the variance is the expectation of the square of something and squares cannot be negative.)
Any $2\times 2$ covariance matrix $\mathbb A$ explicitly presents the variances and c... |
I have a CSV file with 4 million edges of a directed network representing people communicating with each other (e.g. John sends a message to Mary, Mary sends a message to Ann, John sends *another* message to Mary, etc.). I would like to do two things:
1. Find degree, betweeness and (maybe) eigenvector centrality measu... | From past experience with a network of 7 million nodes, I think visualizing your complete network will give you an uninterpretable image. I might suggest different visualizations using subsets of your data such as just using the top 10 nodes with the most inbound or outbound links. I second celenius's suggestion on usi... |
I'm having trouble understanding some language notation, primarily what rules I can take away from it. The language is as follows:
$\qquad L = \{a^n b^m b^p c^p b^{n-m} \mid n > 0, m < n, p > 2\}$
My goal is to create a context free grammar from this, but I can't get my ahead around the rules in place here. In plain ... | First of all, note that your quest for "rules in place" is probably doomed. This looks pretty much like an exercise problem you would pose in class; there is not necessarily an intuitive rule or semantics. It's just a playground for developing your skills. Therefore, it may be more helpful to strap on theory glasses an... |
>
> Given array $A$ of length $n$, we call it *almost sorted* if there are at most $\log n$ indices satisfying $A[i] > A[i+1]$.
>
>
> Find an algorithm that sorts the array in $O(n\log\log n)$.
>
>
>
My attempt:
* Create an array $B$ of size $\log n + 1$.
* Go through the array $A$, recognize the $\log n$ pairs... | Suppose that $A$ is an array with $m$ indices satisfying $A[i] > A[i+1]$. You can find these indices in $O(n)$. These $m$ indices split $A$ into $m+1$ nondecreasing arrays $B\_1,\ldots,B\_{m+1}$ of total length $n$. We now merge them according to the following strategy: at each step, take the two shortest arrays, and m... |
When encoding a logic into a proof assistant such as Coq or Isabelle, a choice needs to be made between using a *shallow* and a *deep* embedding. In a shallow embedding logical formulas are written directly in the logic of the theorem prover, whereas in a deep embedding logical formulas are represented as a datatype.
... | Roughly speaking, with a deep embedding of a logic, you (1) define a datatype representing the syntax for your logic, and (2) give a *model of the syntax*, and (3) prove that axioms about your syntax are sound with respect to the model. With a shallow embedding, you skip steps (1) and (2), and just start with a model, ... |
```
int sumHelper(int n, int a) {
if (n==0) return a;
else return sumHelper(n-1, a + n*n);
}
int sumSqr(int n) {
return sumHelper(n, 0);
}
```
I am supposed to prove this piece of code which uses tail recursion to sum up the squares of numbers. That is, I need to prove that for $n ≥ 1$, $sumsqr(n)=1^2+2^... | Assuming $n ≥ 0$,
let $$ P(n) \;≡\; ∀ a.\, sumHelper(n, a) = a + ∑\_{i = 0}^n i² $$
Then we prove this is always true by induction on $n$.
The base case, `n = 0`:
```
sumHelper(n, a)
={ Case n = 0 }
sumHelper(0, a
={ Definition }
a
={ Arithmetic }
a + 0²
={ Arithmetic }
a + ∑_{i = 0}^0 i²
={ Case n = 0 }
... |
In the picture below, I'm trying to figure out what exactly this NFA is accepting.
[](https://i.stack.imgur.com/XHuWu.png)
What's confusing me is the $\epsilon$ jump at $q\_0$.
* If a $0$ is entered, does the system move to both $q\_0$ **and** $q\... | Every time you are in a state which has a $\epsilon$ transition, it means you automatically are in BOTH states, to simplify this to you:
If the string is $\epsilon$ then your automata ends both in $q\_0$ and $q\_1$
If your string is '0' it'll be again in $q\_0$ and $q\_1$
If your string is '1', it'll be only in $q\_... |
Combinatorics plays an important role in computer science. We frequently utilize combinatorial methods in both analysis as well as design in algorithms. For example one method for finding a $k$-vertex cover set in a graph might just inspect all $\binom{n}{k}$ possible subsets. While the binomial functions grows exponen... | Generating functions are useful when you're designing counting algorithms. That is, not only when you're looking for the number of objects having a certain property, but also when you're looking for a way to enumerate these objects (and, perhaps, generate an algorithm to count the objects). There is a very good present... |
Which test would I use to analyze the relationship between two dichotomous outcomes (Yes/No) where I have a reported event (Yes/No) and a Response to the event (Yes/No)? | Since you have two dichotomous outcomes your data can be represented in a $2 \times 2$ contingency table where the rows represent the status of "event" and the columns the status of "response," and the value within the cell being the total count within your sample falling into this category. The most straightforward wa... |
If I have a regression model:
$$
Y = X\beta + \varepsilon
$$
where $\mathbb{V}[\varepsilon] = Id \in \mathcal{R} ^{n \times n}$ and $\mathbb{E}[\varepsilon]=(0, \ldots , 0)$,
when would using $\beta\_{\text{OLS}}$, the ordinary least squares estimator of $\beta$, be a poor choice for an estimator?
I am trying to fig... | Brian Borchers answer is quite good---data which contain weird outliers are often not well-analyzed by OLS. I am just going to expand on this by adding a picture, a Monte Carlo, and some `R` code.
Consider a very simple regression model:
\begin{align}
Y\_i &= \beta\_1 x\_i + \epsilon\_i\\~\\
\epsilon\_i &= \left\{\beg... |
I have a series of data to which I want to fit my model. The model predicts the probability of success at a given value of x. I have a single data point at a number of points in this space. As I have a single point which is either pass or fail with a certain probability I believe I should fit using a Bernoulli maximum ... | I think what you want is [logistic regression](http://en.wikipedia.org/wiki/Logistic_regression) (or at least the likelihood that is maximized in logistic regression). If the wiki isn't enough, search for MLE fitting of logistic regression on Google. |
To optimize parameters of a model we minimize a loss function.
To optimize metaparameters we look at a loss/metric on a validation set ( or, if we are worried to overfit on the validation set, we do cross validation ).
(Than we check performance on the test set.)
Why this difference ? Couldn't we consider metaparame... | There are few different reasons for the distinction between parameters and hyperparameters (the more common term for what you refer to as meta parameters).
1. Some hyperparameters can not be considered "just another parameter" because doing so would lead us to overfit. As an obvious example, discussed [here](https://e... |
In 2005 ID software open source the game Quake 3 Arena. When they did it was discovered was an algorithm that was so ingenious and all it did was calculate the inverse of a square root.
The easy way to calculate the inverse of a square root being
```
float y = 1 / sqrt(x);
```
But then again this functionality has ... | Inverse square root is used a lot for vector normalisation :
$$xn = \frac{x }{ \sqrt{x^2 + y^2 + z^2}}$$
Which has many uses in computer graphics, such as calculating illumination.
With a traditional FPU, even a good one, this is a very time consuming operation : the multiplications and additions are fast (and some ... |
I found that often in literature that likelihood values are often used to compare different estimation method for the same model. And I got the impression that is the only way likelihood values are used.
However, I wonder what else we can say about the likelihood function. For example, can we compare two totally diff... | 1. Can we compare two totally different models' likelihood functions?
Not exactly, but you can compare those models using their likelihood functions indirectly by using the Akaike information criterion (AIC), the Bayesian information criterion (BIC), or the Deviance information criterion (DIC).
2. What's the minimum ... |
I'm new to the CS field and I have noticed that in many of the papers that I read, there are no empirical results (no code, just lemmas and proofs). Why is that? Considering that Computer Science is a science, shouldn't it follow the scientific method? | In programming languages research many ideas for new programming language constructs or new type checking mechanisms stem from theory (perhaps informed by experience in practice, perhaps not). Often a paper is written about such mechanisms from a formal/theoretical/conceptual perspective. That's relatively easy to do. ... |
In " Gödel, Escher, Bach" Hofstadter introduces the programming languages [Bloop and Floop](https://en.wikipedia.org/wiki/BlooP_and_FlooP). Relevant here is mostly that Floop is Turing complete, while Bloop differs from Floop in one aspect: all loops must be bounded. So only for-loops, no while-loops.
Hofstadter shows... | Program 2 can be a FlooP interpreter.
When started in a state in which the source code of a FlooP program is in internal memory, it will execute it.
It can do this by keeping its internal memory subdivided into three parts:
1. The FlooP program's source code (represented as a sequence of numbers according to some re... |
I have been working on a set of data which contains information on the width, age, weight of statues and relate them to the price (I am not actually working on that, but I cannot disclose the topic of my work).
I came up with the following regression:
$Price = -9 -width + 4 log10(age) + 8 height$
the minimum-maximum... | We rarely report or interpret the intercept in a linear regression model. In your case it is an extrapolation of the data. The intercept would be interpreted as a expected price for a product with width 0, an age of 1, and a height of 0. That is nonsense. A value of -9 is an artifact of the projection.
If you want a m... |
For example, if n=14, the output should be 10; n=22, the output should be 30=10+20; n=102, output=(10+...+100)+101+102=5703
In this problem, n is smaller than $10^{18}$ , and the algorithm should finish within 1 second. | Let $S(m)$ be the sum of all numbers with at most $m$ digit, i.e $S(m)=10^{m+1}\cdot (10^{m+1} - 1) / 2$.
Let $C(m)$ be the number of at most m digit numbers which contains $0$.
Let $F(m)$ be the sum of numbers with zero in them such that they have at most $m$ digits.
Then is easy to find a recursive relation for $C... |
Consider the following local search approximation algorithm for the unweighted max cut problem:
start with an arbitrary partition of the vertices of the given graph $G = (V,E) $, and as long as you can move 1 or 2 vertices from one side of the partition to the other, or switch between 2 vertices on opposite sides of th... | Let's denote by $u\_1,\ldots,u\_{2n}$ and $v\_1,\ldots,v\_{2n}$ the nodes in the two sides of $K\_{2n,2n}$ respectively. We remove the $2n$ edges $(u\_1,v\_1),(u\_2,v\_2),\ldots,(u\_{2n},v\_{2n})$ from $K\_{2n,2n}$. You can verify the resulting graph is an example showing the approximation ratio of your algorithm is at... |
I have a problem with this following question:
>
> Prove that the language $\{uw : |u|=2|w|\}$ is regular.
>
>
>
I tried to give this regular expression $(uw²)^\*$ to resolve it. | Any string of the form $uw$ where $|u| = 2|w|$ is a string whose length is a multiple of $3$. We are therefore considering the language of strings over some alphabet $\Sigma = \{ a\_1, \ldots, a\_k \}$ (not specified in the question). whose length is a multiple of $3$. Let $\Sigma$ be the regular expression $a\_1 + \cd... |
Consider the equivalence relation $\sim$ on boolean matrices $A,B\in\{0,1\}^{m\times n}$ which is defined as follows:
$A\sim B$ :iff there are permutation matrices $P\in\{0,1\}^{n\times n}, Q\in\{0,1\}^{m\times m}$, so that $B=QAP$
In other words two matrices are equivalent, if they are equal up to permutation of ro... | This kind of problem has been studied, e.g. in the exploitation of symmetries in model-checking and in satisfaction constraint problems.
The short answer is that it is $NP$-hard.
I suggest this draft by Junttila as a starting point: [A note on the computational complexity of a string orbit problem](https://users.ics.... |
To be specific, the problem is formalized as follows.
Given a set of integers $\{a\_1,\ldots,a\_n\}$, determine whether there exist non-negative integers $x\_1,\ldots,x\_n$ such that $a\_1x\_1+\cdots+a\_nx\_n=0$ and at least one of $x\_1,\ldots,x\_n$ is positive.
Note this is not a duplicate of [this problem](https:... | The problem can be solved in polynomial time.
If any of the $a\_i$ are zero, then the answer is "yes" (you can set the corresponding $x\_i$ to 1, and all other $x\_j$ to 0). So let's assume all of the $a\_i$ are non-zero.
If all of the $a\_i$ are strictly positive, then the answer is "no" (if $x\_i$ is the one that's... |
What is the limit to the number of independent variables one may enter in a multiple regression equation? I have 10 predictors that I would like to examine in terms of their relative contribution to the outcome variable. Should I use a bonferroni correction to adjust for multiple analyses? | You need to think about what you mean by a "limit".
There are limits, such as when you have more predictors than cases, you run into issues in parameter estimation (see the little R simulation at the bottom of this answer).
However, I imagine you are talking more about soft limits related to statistical power and good... |
Can someone explain how FDR procedures are able to estimate an FDR without a model / assumption of the base rate of true positives? | I think that's a really good question; too many people use the Benjamini-Hochberg procedure (abbreviated BH; possibly the most popular procedure to control the FDR) as a black box. Indeed there is an underlying assumption it makes on the statistics and it is nicely hidden in the definition of the p-values!
For a well-... |
Suppose in a given plain there are fixed number of lines. A point P lies on one of the line. How to find which line intersects the point P ? I am giving an example
In the above graph point P is on the line CE. We can determine it visually.But my prob... | Any finite line is described by two points. assuming we are talking 2D here, then your graph can be described as a set of points, having X and Y coordinations, and a set of edges $E$, which describe which pair of points are connected with a line. Elementary geometry tell us the function expressing the points on these l... |
I solved this problem from codechef:
[problem link](https://discuss.codechef.com/questions/60008/taqtree-editorial "problem link")
and now I want to change it a bit. Instead of find out the distance between node $u$ and $v$ I want to answer $k$ queries of the form: find node $u$ to which distance from node $v$ is maxi... | Start from any node and find (say, with a BFS) a farthest node from it; call it $u$. Then start from $u$ and find a farthest node from it; call it $v$. Nodes $u$ and $v$ achieve the absolute maximum distance in the tree.
Now with 2 more BFS, find the distances of all nodes from $u$, and the distances of all nodes fro... |
does a good known algorithm exists for this problem?
On input I have two series of timestamps "when the event was observed". Theoretically the recorded timestamps should be very well aligned.
Visualized ideal situation on two time lines "s" and "r" as recorded from the two devices:
$ (where $s$ is from the first device and $r$ from the second device) to be a match if their timestamps are very close, i.e., $|s-r| \le \epsilon$ for some small fixed value of $\epsilon$ that you choose in advance. $\epsilon$ is a toleran... |
I am performing a meta-analysis. I have a subgroup made only of 2 studies and they show opposite results. The 1st has excellent outcomes the 2nd very bad ones.
Is it true that I am not allowed to compute the data from these two (different) studies under a random-effect model? I have been told that it is methodological... | try to find the confounding variable.. see if you get any interactions or mabe run another test with different methodology (and more variables that may give you a clearer picture. |
How would we solve the knapsack problem if we now have to fix the number of items in the knapsack by a constant $L$? This is the same problem (max weight of $W$, every item have a value $v$ and weight $w$), but you must add *exactly* $L$ item(s) to the knapsack (and obviously need to optimize the total value of the kna... | You can transform this problem into an instance of Knapsack. Let $n$ be the number of items, $V$ be the maximum value of an item and suppose that each item weighs at most $W$ (otherwise it can be discarded).
To ensure that you select at least $L$ items:
* Add $n(V+1)$ to the value of every item.
* Now the problem is ... |
I was taught to control for multiple comparisons, i.e. when I do more than one test at some significance level, alpha, to lower alpha as given by some choice of a multiple comparisons procedure. Anyone that can answer my question knows what I am talking about. My question is do I account for multiple comparisons:
per ... | Stirling's approximation gives $$\Gamma(z) = \sqrt{\frac{2\pi}{z}}\,{\left(\frac{z}{e}\right)}^z \left(1 + O\left(\tfrac{1}{z}\right)\right)$$ so
$$\frac{\Gamma(\frac{n+1}{2})}{\Gamma(\frac{n}{2})} = \dfrac{\sqrt{\frac{2\pi}{\frac{n+1}{2}}}\,{\left(\frac{\frac{n+1}{2}}{e}\right)}^{\frac{n+1}{2}}}{\sqrt{\frac{2\pi}{\f... |
With the advent of internet (and common sense) there is more and more demand for open-access research. Several researchers (including me) find it frustrating that published peer-reviewed research articles are behind paywalls. I am looking for journals and conferences (related to theoretical computer science, graph theo... | Conferences with proceedings published in the [LIPIcs](http://www.dagstuhl.de/en/publications/lipics/) series:
* STACS
* FSTTCS
* CCC (since 2015)
* TQC (Theory of Quantum Computation, Communication and Cryptography)
* ICALP
* APPROX/RANDOM
* SoCG
* SWAT
* ESA
* MFCS |
While trying to fix a bug in a library, I searched for papers on finding subranges on red and black trees without success. I'm considering a solution using zippers and something similar to the usual *append* operation used on deletion algorithms for immutable data structures, but I'm still wondering if there's a better... | This answer combines some of my comments to the question and expand them.
The subrange operation on red-black trees can be performed in worst-case O(log n) time, where n is the number of elements in the original tree. Since the resulting tree will share some nodes with the original tree, this approach is suitable only... |
This is my first post, so I do apologize if I’ve missed something important.
I’m preparing to pursue a PhD in statistics, and I’ve recently realized that my linear algebra knowledge is not “up to par.”
The class that I took only stopped at orthogonal sub spaces, and I know that’s just not sufficient.
Does anyone hav... | These spring to mind :
*Matrix algebra useful for statistics.*
Searle, S. R., & Khuri, A. I. (2017). John Wiley & Sons.
*Linear Algebra and Matrix Analysis for Statistics*
Banerjee, S., & Roy, A. (2014). Crc Press.
*Numerical linear algebra for applications in statistics.*
Gentle, J. E. (2012). Springer Science & Bu... |
Suppose I'm interested in $\Pr(g(x)=1)$, where $g:\mathbb{R}\rightarrow\{0,1\}$.
In this context, $x$ is the realization of a random variable, $X$. I would like to emphasize this by rewriting the probability as:
$$
\Pr(g(x)=1) = \Pr(g(X)=1 \mid X=x)
$$
Is it kosher to write this? Or am I violating some rule of condi... | The role of random variation in population statistics is a matter of some judgement.
Many people believe that possible variation in complete counts, including the census, has no bearing on analysis.
I believe that if you just want to count and describe what happened and aren't really interested in a model, reasons f... |
**Now I see it can't hold. Thank you for the counter examples... You guys rule!**
**Thank you very much for your comments!**
I added, however, some observations that were missing. Most importantly is the fact that we can assume that there exist a positive covariance between X and Y.
At first, it seemed to me that it... | Clearly not.
An easy counterexample (here done in R), that I think satisfies all your constraints:
```
set.seed(239843)
x=rnorm(100,100,1)
y=rep(c(0.01,0.99),times=50)
z=x*y
var(x)
[1] 0.8413043
var(y)
[1] 0.2425253
var(z)
[1] 2425.296
```
What's going on:
1. x is a series with mean 100 and sd 1.
2. y altern... |
1- Is there any specific properties for adjacency matrix when a graph is planar?
2- Is there any thing special for computing the permanent of adjacency matrix when a graph is planar? | Computing determinant and permanent of planar graphs are as hard as computing them in general graphs. They are complete for **GapL** and **#P** respectively. See this paper by [Datta, Kulkarni, Limaye, Mahajan](http://portal.acm.org/citation.cfm?id=1714450.1714453) for more details. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.