instruction stringlengths 35 29.1k |
|---|
On https://regexr.com/, using the default JavaScript (Browser) engine, the languages $L(a^*|b^*)$ and $L(b^*|a^*)$ are not the same.
The first one matches only $a$'s and the second one $b$'s.
Is this a bug?
Or does the site something different than evaluating regular expressions, as I learned them in class?
|
Given an arbitrary algebraic equation, say for example the likelihood of the bernoulli distribution:
$$\prod_{i}^{n}\theta^{x_i}(1-\theta)^{1-x_i}$$
And some arbitrary factorization constraints, say:
$$f(x)g(\theta)e^{\phi(\theta)^{T}u(x)}$$
Can I factor the equation into the form above where f, g, and phi are functio... |
Can you to find for me a context free grammar for the following language?
$$\{w\in\{a,b\}^*: \#_a(w)=2\#_b(w)\} $$
Here $\#_a(w)$ counts the number of $a$'s in $w$.
|
I'm reading Multithreading (computer architecture) - Wiki, aka hardware threading, and I'm trying to understand the second paragraph:
(p2): Where multiprocessing systems include multiple complete processing units in one or more cores, multithreading aims to increase utilization of a single core by using thread-level p... |
I am looking for an algorithm to find the shortest distance from multiple nodes to one end node. For example let $v_1,v_2,\dots,v_r$ be the nodes on a graph with distance $d_1,d_2,\dots,d_r$ to the end node $v$. I want the shortest $d$ to $v$.
|
I'm new to AI, and have a hard time to understanding how to count the total states are examined in the most wins heuristic for tic-tac-toe two plys deeper(9-grid)? Need help
|
I'm trying to prove the following.
There exists a strongly connected orientation of a connected, undirected graph $G$ if, and only if, $G$ has no bridge.
(An orientation of an undirected graph is a directed graph made by replacing each edge $uv$ with exactly one of the directed edges $(u,v)$ and $(v,u)$; a directed g... |
There are plenty of resources online discussing 3-SAT reductions to Independent Set or Vertex Cover problem. I am unable to find a resource which states that a satisfiable assignment to 3-SAT results in a vertex cover or an independent set which is optimum for the graph induced by 3-SAT in its reduction.
Say, I have a... |
I was trying to implement data structure over set of rectangles that can perform two types of operations.
Update operation, add new rectangle with sides parallel to x and y axis and positive coordinates to the set.
Query operation, for some rectangle check if there is some rectangle intersecting with this rectangle.
... |
Given a graph G, with all positive weights, find the shortest cycle length in O(V^3)
My idea is, negate al the edges, apply floyd-warshall algorithm and then for all $i$, find the largest $M[i][i]$ where $M$ is the final distance matrix, and then negate $M[i][i]$ and return.
Could this work? I know floyd can be used... |
I need to prove that
In a simple graph $G$, if all the $n$ vertices have a degree of at least $4$, then the number of edges is at least twice the number of vertices.
I already know that $\deg(n) = 2E$.
Then for the question
$$\deg(n) \ge 4 = 2E$$
but then I couldn't solve further.
|
I need some guidance in an assignment I'm doing.
I'm at complete loss, he says the the MAXIMUM INDEPENDENT SET problem is NP-hard and then asks me to prove that there is no polynomial time for the same algorithm and it also guarantees that some inequality holds, which I also don't understand, since $A(G)$ returns the s... |
Problem of determining whether a context sensitive language is context free is undecidable.
How to prove it
|
I'm looking for an algorithm to count and enumerate (separately, if differing complexity) all the reconvergent pathsets in a simple, directed, non-weighted graph, which may contain cycles. That is, for every vertex $v_i$ of in-degree >1, determine if any pair of its direct ancestors have a lowest common ancestor $u_i$ ... |
Based on the question below, can someone please explain to me the reasoning behind why the maximum number of edge is 5/2|V|? I don't find the particular reasoning in the solution to be that helpful for why the maximum number is 5/2|V|.
|
Let's start with the formalism:
Let $W$ be the total weight of our bag, $1,...,n$ be our elements, $w_1,...,w_n$ their corresponding weights, and $v_1,...,v_n$ their corresponding values.
As is known, the knapsack problem for integer weights can be solved by dynamic programming (or equivalently, using recursion + mem... |
I'm studying constrained Turing Machines.
There's a theorem that proves that both infinite and semi-infinite tape TM have the same computational power. The theorem that proves this by emulating a TM1 with infinite tape with a multi-track tape TM2, where one track emulates the right part of the TM1 tape and the other tr... |
For the question below, it is asking to prove the lower bound on the worst case is log(n). I have no problem proving this and the solution makes 100% sense to me. However, there is a comment at the bottom of the solution which asks why we had to assume that if the loop does not return early, then it runs for omega log(... |
I believe in order to make a Turing machine have the same power as a DFA (by power I mean all languages which a DFA can decided so can the Turing machine) we just don't allow any use of backtracking or rewriting, that is you can only move right and read the string in the order it is presented.
To simulate a PDA however... |
I was reading the following and found the following paragraph that I didn't understand:
Let us also consider a set Σ of typed λ -constants, that is, pairs σ : t,
where t is some type. Like for type assignments, we assume that Σ
does not contain constants with multiple types and let Σ(σ) denote
the type t such th... |
The goal is to store sorted unsigned integer intervals that can overlap only in the boundaries, e.g., |0–10|10–50|100–110|110–200|. This structure will be created by some insert operations (the order matters) in the start and than queried by a lot of queries. The query is specified by interval and the result is all int... |
I have been informed parser parses unambiguous context free grammars of $DCFL$.
I was wondering if there could be a parser which could make a parsing table for unambiguous grammars of $NCFL$?
Note: This has been discussed here briefly in comments.
|
Like in the title the following equation:
$F(n)=F(n-1)+F(n-2)+f(n)$, with $F(0)=0, F(1)=1$
$f(n)=f(n-1)+f(n-2)$, with $f(0)=0, f(1)=1$
I don't know how to solve this. The $f(n)$ is basically just $F(n)$, but
then I have
$$F(n)=F(n-1)+F(n-2)+F(n) \Rightarrow F(n-1)+F(n-2)=0$$
and I cannot go anywhere from this.
|
I need to build a sorting (comparator) network using comparators for a specific permutation on a set $x_1, \dots, x_n$. The solution should not be a general sorting network that sorts every permutation. I should build the smallest possible sorting network for the given permutation (the depth of the network should be $O... |
So I'm lost on this one. We're given a turing machine and an initial tape. Tape is infinitely long in both ways, but all the blanks are taken out. The head is the leftmost nonblank. So the question is: If the Turing machine
halts on this input, then give the output sequence; if it does not halt, then answer “does not ... |
I was wondering if there is an algorithm to derive $p$ and $q$ or is it simply trial and error?
Consider the following RSA crypto-system with public key $(437,13)$. Since the numbers are so small, it is possible to break the crypto-system and determine the private key. What is the value of the two primes $p,\,q$ with ... |
I was reading this and I was trying to understand the definition of $(S,\Sigma)$-CCC. The first requirement says:
a mapping [[_]] : S → |C|, associating some object [[s]] ∈ |C| to
any s ∈ S;
which I find very confusing and having a hard time understanding what it means. What is $S$ and what is $\Sigma$?
why do all ... |
Does a mathematical modelling on Christofides algorithm exist, is it even possible to create one?
|
For the 8 puzzle problem, it has been proved that if h(n) = number of tiles on wrong place. h(n) is an admissible heuristic as every tile which is in wrong place must be moved out at least once.
But if h(n) = number of tiles on correct place. h(n) is not an admissible heuristic. Can anybody please explain.
|
Hey I am new to graph theory and this question has me stuck for hours.
What is an example of undirected graph with n nodes where the number of simple cycles is exponential in n.
I was looking at complete graphs, but here's the catch: the total number of edges should be in theta of n.
Please help! I need to prove the co... |
Does a priority queue Queue<K,V> always sort its elements based on the value of each element or its key?
I know than the priority in the queue is based on the key, and that the element with the highest priority has the minimal key (Correct me if I am wrong) But I am not sure about wether the pq sorts based on value.
|
There are two problems that need to be solved. Both problems use a compatibility matrix $C$, where $C[a, b]$ is how compatible students $a$ and $b$ are.
(1) Given an $n \times n$ compatibility matrix $C$ for $n$ students, and $r$ rooms with sizes $s_1, s_2, \dots, s_r$, where $n$ is the sum of room sizes, and a target ... |
So I learned that there are some problems that cannot be solved in computer science but I want to know why is it important to understand the unsolvable algorithm and how should I deal with it.
|
The invariance theorem of kolmogorov complexity states that for two different languages with complexity functions $K_1$ and $K_2$, we have
$$\exists c.\forall s. K_1(s) \le K_2(s) + c$$
Here is an apparent paradox I found. Let the two languages be Binary Lambda Calculus and (an idealized version of) Perl, with complexi... |
Why are random numbers important to the study and application of computer science? I am new to computer science. So I am studying random numbers right now.
|
Although hardware based “true” random number generators are available, software-based pseudo-random number generators still remain the predominant method for generating random numbers in use today. Why do developers continue to rely on pseudo-random number generators?
|
I use the A* search algorithm to to search for the shortest path from S to G.
The evaluation function is $f(n) = g(n) + h(n)$.
Since node A and B have the same estimated total cost, I choose to go node A.Then, the $f(n)$ of B is 8, C is 7, G is 10. After expanding C, $f(n)$ of G is 7. Therefore, the path is S-A-C-G w... |
I have just read a Luby’s paper on the very basic idea of the LT codes, which may be of interest for me.
For my application, encoding k information symbols is done in a process that generates a big table T of size k’.
Then, for every information symbol s, choose d indices in the table $x_1,\ldots,x_d$ and add s to $T[x... |
There are n cities [1, 2, 3, .... n] and k available pumps. These pumps can be installed in k cities. The cities are all in a straight line.
How do I need to install these so that the average distance between the cities and the nearest pumps is minimized?
What I am thinking is that dividing is this:
Suppose there are 6... |
Source: http://examples.gurobi.com/traveling-salesman-problem
I don't get this part: (look at the source)
$$\sum_{i,j\in\{1,2,3\},i\neq j} x_{ij}=3>2=|\{1,2,3\}|-1$$
I get that $x_{ij}$ is equal to 3, but why the "> 2" ?
And what is the deal with subtracting 1 from a set? How do you even do that?
How come $|\{1,2,3\}... |
Undirected graph is given which has M edges and N vertices we have to convert every edge from $u-v$ to $u\to v$ or $v\to u$ such that the total indegree of every vertex is even.
For example, consider a graph which has the edges 1-2, 1-3, 2-4, 3-4. We can direct it as 1→2, 1→3, 2←4, 3←4, so indegrees of 1,2,3,4 are resp... |
Suppose that I have two photos, I1 and I2 and I want to find a set of corresponding points between the two photos to define a homography between them. There are many algorithms for this purpose, namely SIFT which is scale invariant. The problem is that when there's a pattern in both photos (like repeated windows), SIFT... |
How can I prove that $\Box(P\rightarrow Q)\rightarrow (\Diamond P\rightarrow\Diamond Q)$ is valid in linear temporal logic (LTL)?
|
The language was $L =\{a^n b^{n+1} : n\geq0 \}$.
This is my attempt:
I believed $L$ can also be expressed as:
$L =\{a^n b^{n}b : n\geq0 \}$
This implies that the number of $b$'s is always greater than the number of $a$'s. Thus, the complement is
$L' =\{w: w\in\{a,b\}^*: n_a(w)>n_b(w)\}$ or $L' =\{w: w\in\{a,b\}^*: ... |
Let $L = \{M: M\text{ halts on only one of 1100 or 0011 or 0011 or 1000}\}$. I'm trying to determine whether $L$ is decidable.
I don't think it's even recognizable, but I'm not sure. Regardless, I think I can show it's undecidable. Suppose $L$ is decidable by machine $D$. Then we can construct machine $S$ that decide... |
I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB used. I don't understand why there is an arrow point to itself inside the hash table? Could anyone explain the mechanism?... |
Given an n variable boolean DNF formula and a number k, does this formula has satisfying input combination greater than k?. (0<=k<=2^n).
Where input is infinite number of n tuples where repeating tuple is possible.
For exampl. F(a,b) =ab + a'b. Input set is (11,00,11,01) and k=2.
Answer is 3 here so decision says yes... |
My question is what makes the Byzantine Generals Problem possible to solve in some cases where traitors exist, for example in the case where there are 4 generals with 1 traitor?
If the generals must either all attack or all retreat at the same time, then surely the traitorous general can simply say "yeah sure we'll att... |
How do one solve the following integer program?
$$
\begin{align*}
\text{minimize} \quad &\sum_{(i,j) \in E} d_{ij} x_{ij} \\
\text{subject to} \quad & \sum_{j \in V} x_{ij} = 2 \;\; \forall i \in V \\
&\sum_{i,j \in S, i \neq j} x_{ij} \leq |S|-1 \;\; \forall S \subset V, S \neq \emptyset \\
&x_{ij} \in \{0,1\}
\end{a... |
I think I have worked out a DFA that doesn't accept the substring "111," but I don't know how to account for accepting even length strings. Here is what I have so far. Any help would be greatly appreciated!
|
Is this language context-free? $\Sigma$ = {a,b,#}, L = {x1#x2#...#xk : k$\geq$2, every $x_i \in$ {a,b}* and xi $\neq$ xj for every pair i $\neq$ j} I think it is not, because the PDA can't memorize every word to be unequal to every other word.
|
I would like to learn about different approaches to formal verification of software programs that goes beyond what Wikipedia has to offer. Ideally one would not only get an overview but also recommendations which books and articles to read next.
My goal is to be able to judge what parts of formal verification I could a... |
I'm working my way through software foundations. In the Chapter titled "Tactics", I'm able to prove this theorem in Coq:
Theorem silly_ex :
(∀ n, evenb n = true → oddb (S n) = true) →
oddb 3 = true →
evenb 4 = true.
Proof.
intros H1 H2. apply H2.
Qed.
Even though I was able to get through the exampl... |
I'm reading chapter 3(growth functions) of CLRS and in giving an example of proving theta for a standard quadratic function the book gives the following value for $n_0 = 2 \cdot max(|b|/a, \sqrt{|c|/a})$ .
I'm confused regarding what "max" means in this context. The quadratic function is $an^2 + bn + c$ and the constan... |
The problem was from an exam, I spent much time wrapping my head up around this kind of problems, so I decided to ask for help ;(
Problem:
We implement a merge sort algorithm to sort $n$ items. The algorithm will divide the set into 2 roughly equal-size halves, and merge the 2 halves after each half set is recursively ... |
I drew these pictures to check whether I comprehended the ideas of P, NP, NP Complete and NP Hard correctly.
And then, I realized that it is not certain where undecidable problems should be placed.
Did I draw the pictures correctly? (Are all the undecidable problems including the halting problem are NP-Hard when P=NP... |
I totally understand what big $O$ notation means. My issue is when we say $T(n)=O(f(n))$ , where $T(n)$ is running time of an algorithm on input of size $n$.
I understand semantics of it. But $T(n)$ and $O(f(n))$ are two different things.
$T(n)$ is an exact number, But $O(f(n))$ is not a function that spits out a numbe... |
Let $f(n)=\Omega(n), g(n)=O(n)$ and $h(n)=\theta(n)$ then $f(n).g(n)+h(n)$ is?
My attempt:
Lets $f(n)=g(n)=n$, then $f(n).g(n)+h(n)=\Omega(n^2)+\theta(n)=\Omega(n^2)$
But given answer is $O(n)$. Now sure where I have have committed mistake or if I am missing something. How it can be $O(n)$?
|
If I have a Delaunay Graph, what is the mean geodesic distance between two randomly chosen nodes.
I know that in a small world network, it is in O(log(N)), with N being the number of nodes.
Thank you!
|
Suppose we have a list of $N$ keys where the distribution of keys follows $f(x)$.
We construct a skip list over the keys.
Now if I pick a key (e.g. 31 in the following picture), what are the Expected value of keys that it points to?
For example, key 31 points to: [38,44,55]. Considering that I know 31 has k pointers (... |
Why do most implementations of arrays have constant access time and linear insertion time?
|
Title is self explanatory.
I have searched here on this site and haven't found any discussion about this.
Is it somehow related to Turing's Halting problem (which is undecidable)?
|
I'm trying to prove that some problem, A, is in NL. I have found a logspace reduction from A to 2-SAT - am right in thinking that this is not sufficient to prove that A is in NL?
If so, how does one formally go about proving that a language is in NL - is the only way we can do this by providing some deciding non-determ... |
I am preparing for an exam and I came across this question in one of the tests.
Halting problem of Turing machines which recognize recursive languages
is undecidable. (True / False)
The solution given says the statement its False.
But I think the statement is True. Halting problem in itself is undecidable. We can't... |
I would like to construct a Minimum Distance Spanning Tree (Dijkstra) for the graph below:
MDST: {(a,c), (c,h), (c,f), (a,d), (h,g), (a,b), (d,e), (h,j), (h,i), (j,k), (e,m), (i,l)}
Is my understanding correct? The total cost would be 49 (sum of the distance from the root for each node).
|
Consider the decision problem: given formulas of propositional logic $\phi_1, \ldots, \phi_n, \psi$, determine whether $\phi_1, \ldots, \phi_n \vdash \psi$ intuitionistically. This problem is well-known to be decidable, for example using an algorithm derived from the LJT* sequent calculus. I was wondering if the comp... |
Consider the following problem :
Given a set of sets of integers, $\Sigma = \{S_i, i \in I\}$, and a set G, determine wether $\Sigma$ contains a partition of G, i.e. a set $J \subseteq I$ such that $G = \bigsqcup_{j\in J} S_j$.
This problem is (if i'm not mistaken) in NP.
I'm trying to determine wether this problem i... |
I was given the following algorithm as a solution to one of my problems.
However, I am baffled at understanding how c' is ever initialized. The first if statement can never be reached, as c' is never set the first time. Can someone explain this to me? Am I just missing where c' gets set?
This is for Kleinberg and Tardo... |
My question relates to a video I watched on YouTube.
The pipeline is a 5-stage pipeline which include fetch, decode, ALU, Mem (data), and Write.
It mentions that nothing is fetched until we're sure what to fetch. How can that be though? Won't you need to fetch and decode an instruction first to know what to fetch?
He ... |
I'm starting to dabble in the world of approximation algorithms and had a question about the convention many papers will use when talking about the approximation factor. I know that an approximation factor will give the factor within which the algorithm will perform with respect to the optimal solution. This is pretty ... |
In the book Reinforcement Learning An Introduction,Chapter 8.5,there is an example that compares the efficiency of expected and sample updates:
According to the author, "In this case, sample updates reduce the error
according to $\sqrt{\frac{b-1}{bt}}$ where $t$ is the number of sample updates that have been performed ... |
Traditionally, the usual definition you find for model of computation is "an abstract description of how an output is computed given an input" (Wikipedia and my TCS course are my sources, but the other websites I've seen seem to agree). To me, this seems really close to the informal notion of algorithm, which is "a ste... |
I have started reading about COP, but can't really get a grip of it. What I understand is that you use layers to let the software dynmically adapt depending on the context, and this would result in less code duplication.
But other than that, what are the advantages of COP (what can I do with COP that would be hard to d... |
Given the following predicate formula $F$:
$$\forall x \forall y [(\text{italian}(x) \Rightarrow (\text{winWC}(y) \Rightarrow \text{happy}(x))]$$
I am having trouble understanding whether $x$ and $y$ must be different elements.
Also, I have been given the following statement:
"Italians are happy if the Italian Nationa... |
I am searching for a data structure that can capture a database, which is consisted of one column of intervals (like [0, 2], [4, 6]) and one/two columns of keys (like {'a', 'c'}).
I want to be able to do efficient indexing in both ways such as queries like the following are computationally balanced:
"give me the keys ... |
Matrix chain multiplication problem:- Given a sequence of matrices, the goal is to find the most efficient way to multiply these matrices.
This problem is solved using dynamic programming.
Similarly
GCD chain operation is defined as:- Given a set of $n$ integers, what is the most efficient way to find the gcd of all t... |
According to the textbook by Silberschatz,
A relation schema R is in third normal form with respect to a set $F$ of functional dependencies if, for all functional dependencies in $F^+$ of the form $\alpha$ → $\beta$, where $\alpha$ ⊆ R and $\beta$ ⊆ R, at least one of the following holds:
$\bullet$ $\alpha$ → $\beta$ ... |
Is it correct to say that:
"A complete graph is a graph in which each vertex is connected to all other vertices in the graph"
That's how I always thought about it, the official definition is different (I know that).
|
I have a source undirected colored graph $G$ and a base query graph $g$. I know $g$ is subisomorphic to $G$ and now I want to identify which edges I can add to $g$ to preserve subisomorphism. That is, for any pair of vertices $(v_i, v_j)$ in $g$ if $g' = g \cup e_{i,j}$ is $g'$ still subisomorphic to $G$? what I'm tryi... |
Given two strings $S_1, S_2$, we write $S_1S_2$ for their concatenation. Given a string $S$ and integer $k\geq 1$, we write $(S)^k = SS\cdots S$ for the concatenation of $k$ copies of $S$. Now given a string, we can use this notation to 'compress' it, i.e. $AABAAB$ may be written as $((A)^2 B)^2$. Let's call the weight... |
I'm interested in balanced base $B$ representation for fixed point arithmetic. The paper Fixed-point arithmetic in SHE schemes (Costache, Smart, Vivek and Waller, in Proceedings of 23rd International Conference on Selected Areas in Cryptography (SAC 2016), Springer Lecture Notes in Computer Science, vol. 10532, pp. 401... |
Recall that a Monte Carlo algorithm is $p$-correct if it outputs a correct answer with probability at least $p$. In the case of decision problems, where the answer is binary, repeating the MC algorithm can increase the confidence that a correct answer is obtained.
However, in the case where more than 1 possible answer... |
I want to construct a LOOP-computable program for the integer division (quotient):
x = a DIV b
The LOOP specification can be seen here: https://en.wikipedia.org/wiki/LOOP_(programming_language)
I don't know how to do this without a while.
|
from what wikipedia says shearlet is a successor to wavelets(whatever that is) and that they are extremely good at representing complicated data efficiently. But neither wikipedia nor other articles that i found have any layman definition of shearlets in it. A layman definition would be great and algorithm to implement... |
I am stuck at the complexity of the following problem:
Given a multiset $S = \{x_1,..., x_n\}$ of $n$ integers and a natural number $k$. Can $S$ be partitioned into multisets $S_1,... S_j$ such that for all $S_i \subseteq S$ there is $\sum_{ s \in S_i} s = k?$
I have found out that this may be somehow related to the Eq... |
Can someone please help me understand why(the derivation) "and m = 2n+1 for each n."?
I am trying to follow the logic of the solution provide while myself have a different approach. Here is my thinking (questions state below):
The inner for loop runs m times from 1 and the outer for loop runs n times from 1. Moreover,... |
I need to prove that the following language is in $\mathsf{P}$:
$$ L = \{\langle x,y,z,d \rangle : xˆy \equiv z \pmod{d}\}.$$
I'm assuming I just have to prove with an algorithm or negate that it's part of NP. But I don't know how to do it with this mathematical formula.
|
I know that it isn't necessary that cross product automaton for two minimal DFAs be minimal, but according to my analysis, if two DFAs do not have any common string then their cross product of minimal DFAs would be minimal. What should I do to prove this?
|
I have a set of investors (say n), and a set of startups (say m). At the start, I have all the investors say either yes or no to the startup (which corresponds to whether they want to interact with them or not).
Now, I have to conduct a networking event of r rounds considering this scenario. In each round, I match inv... |
Knuth's original attribute grammar paper (title: Semantics of Context-Free Languages) apparently had a flaw where circularity is always detected but
some noncircular AGs may be reported to be circular. Knuth later constructed
an exact algorithm which is exponential in time. I am wondering what was the fix? which part o... |
int ChromaticNumber(Graph G)
{
for (int i = 0; i < G.Vertices.size(); ++i)
{
//initialize vertex color to 1
++G.Vertices[i].Color;
bool Match = true;
//loop while there is an adjacent vertex with the same color
while (Match)
{
Match = false;
... |
Preface
I've asked a very similar question already on stack overflow in a different wording and gotten a working answer under the assumption that there is no way to go through all possibilities (np-hard).
After doing further research (because this is my bottleneck atm), I stumbled upon this similar question, but again... |
You are given a function $F$, which can take one or more positive integer operands.
Let $L=\{a_1,a_2\ldots a_n\}$.
We need to compute the function $F(L)$ using the least number of transformations/steps.
Computing $F(L)$ is not the main goal. Computing it in the fastest possible way is the goal.
Following rules are allo... |
I have a problem to resolve:
A Bayesian Network structure is given to me, with a dataset of values for each variable. I also have a set of queries, like P(A=1 | B=0) or P(L=0, B=1 | C=1). The goal is to find the parameters of the model.
The first task was to use the frequentist approach. So, for the first query P(A=... |
I am studying lambda calculus for the first time and I was trying to do the reduction beta of the lambda term $(\lambda x.xy)y$. Can I assume that these two free variables $y$ are the same? Or do I need to rename the rightmost $y$?
|
Forgive me for my ignorance as I am self-teaching myself some of this theory... I am having some trouble understanding how to systematically/algorithmically compute FOLLOW sets, given that I have computed the FIRST sets.
For the following grammar:
E -> TE'
E' -> +TE' | ε
T -> FT'
T' -> *FT' | ε
F -> (E) | id
I found... |
I'm studying Quick-Sort and I am confused as to how it works when the first element is chosen as the pivot point.
I am trying to trace the first step in the Quick-Sort algorithm, to move the pivot (15) into its appropriate position.
Example: [15, -7, 22, 7, 21, 34, -13, 19]
My understanding:
15, -7, 22, 7, 34, -13, 19
... |
We have a set of problems involving date ranges - a pair of dates representing a start date and an end date. In some places, we have say 1000 of these and need to find the ones that overlap a separate set of 1000 of these. But a linear search is exponentially expensive.
So is there an algorithm that is more efficient? ... |
I have an array of sorted numbers:
arr = [-0.1, 0.0, 0.5, 0.8, 1.2]
I want the difference (dist below) between consecutive numbers for that array to be above or equal a given threshold. For example, if threshold is 0.25:
dist = [0.1, 0.5, 0.3, 0.4] # must be >=0.25 for all elements
arr[0] and arr[1] are too close to ... |
I'm trying to solve an integer linear program (ILP) in which a constraint of the following kind must be met:
$x_1 \oplus x_2 \oplus \cdots \oplus x_n = 1$
where $\oplus$ is the binary xor operator.
The answer to this question shows how to represent $y = x_1 \oplus x_2$ with linear inequalities. In an answer to this qu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.