instruction stringlengths 35 29.1k |
|---|
I noticed in another answer on this forum
Note that the languages ∅, {ϵ} and Σ* are regular.
How do you prove Sigma Star is regular.
|
If I am correct,
The closure of a function is the non-local environment of the function.
the non-local environment of a function is different depending on static or dynamic scoping.
So is the closure of a function also different depending on static or dynamic scoping?
Thanks.
|
Kriegspiel chess is a variant of chess in which each player is not aware of where the opponent's pieces are. In a human match, a trusted intermediary relays piece losses, legality of moves etc. This is, of course possible on a computer as well. What would a peer to peer implementation of Kriegspiel look like, in terms ... |
Let's say I have a combinational device that has an input of 7 bits and outputs a 3-bit binary number that reflects the number of 1s among the 7 bits.
How much information would be conveyed by the following outputs: 000 and 001?
I know information, in bits, is calculated by log2(1/p), and p is M/N, where N is the numbe... |
A heuristic function $h (n)$ is...
Consistent if the estimated cost from node $n$ to the goal is no greater than the step cost to its successor $n'$ plus the estimated cost from the successor to the goal.
Admissible if $h(n)$ never overestimates the true cost to the goal state.
The textbook for my Artificial Intell... |
I am not a specialist on computational complexity theory. I do work on optimization and I am currently researching about the implications of the class of problems with parallel solutions (NC) being not P-complete, i.e., NC$\neq$P for optimization. In particular, I am interested about the consequences for equations base... |
I'm new to regular languages and I've been struggling to solve one for a while.
The question is:
If there exists a regular language L1 which has an alphabet {0,1},
prove that L2 is also a regular language if L2 comprises of strings x
where x = ABC where B is an element in L1 and A and C are strings
comprised of ... |
I'm trying to understand some aspects of the $P=^?NP$ and $NP=^?coNP$ problems.
I am engineer and not mathematician nor computer scientist so I do not completely understand what a turing machine is.
I'm currently thinking about a variant of the "subset sum problem" known to be in $NP$ and suspected to be not in $coNP$.... |
I have a directed graph where all the nodes represent some task that needs to be computed. I need to compute the order of these tasks and also detect any cycles. Running Tarjan's algorithm on the graph gives me both.
To the problem:
I was wondering if there exists a good way to make use of parallelization. For instanc... |
Example, if i have certain geographic points in an array A=[a,b,c,d...n] and have 10 points distributed in the solution space B= [1,2,3...10], how can I allocate each member of A to the nearest point in B in the quickest way.
|
I was going across some problems which translated the fact that $\log (n!) = \Theta(n\log n)$ to give
$$\log(\lceil\log n\rceil!) = \Theta(\lceil\log n\rceil \log \lceil\log n\rceil)$$
and therefore $\log(\lceil \log n\rceil!) = \omega(\lg n)$.
Now I just have this intuition that this sort of conversions shouldn't a... |
I'm studying Hough Transform.
I have fully understood the HT for detecting lines and successfully implemented it. I have more problems with the circle detection HT.
Given a circle, if the radius is known i have to work in a 2d parameter space (each point in the image space becomes a circle in the parameter space; the... |
The wikipedia says that the number of nodes n in a full binary tree, is at least $n=2^h-1$ and at most $n=2^{h+1}-1$, where h is the height of the tree.
The following binary tree is full according to the wikipedia definition (every node has 0 or 2 children), n = 11, h = 4 but n is not greater than $2^4 - 1 = 15$.
Am I... |
There are n variables $x_1$, $x_2$,..., $x_n$ and each one of them takes values from 1 to k (k>= n) and all are distinct. How can I represent this in the CNF form? (I tried the trivial way of trying all assignments and then checking if they are distinct, but I think it could be done better)
|
I have been studying asymptotic notation and I understand that in big O notation $f(n) <=c1*g(n)$ and in omega notation we have $f(n)>= c2*g(n)$ where $c1$ and $c2$ are some constant.
Now I was wondering if the function $g(n)$ here are the same and the big O and omega of $f(n)$ is determined by constants $c1$ and $c2$... |
I am attending algorithms and data structures course in my University and my professor gave me an interesting question the other day. He told me to think about it.
What is a problem, a task, and a solution?
It seems to me like it's more of a philosophical question. All of those 3 things correlate to one another.
To me,... |
My text book gives the following definition of a primary key in a relational database, which I don't entirely understand. Help would be greatly appreciated.
Let $R$ be a relation. Then the primary key for $R$ is a subset of the
set of attributes of $R$, say $K$, satisfying the following two properties:
Uniqueness ... |
I am studying asymptotic notation and I was thinking of a possibility where if g(n) < f(n) is it possible to have f(n)<=cg(n). For example if -
f(n)=6n+5 and g(n)=4n+5, such that it possible to say (6n+5)<=2(4n+5) where 2 is c. Are f(n) and g(n) here valid function in term of asymptotic notation.
|
Several years ago my professor gave me a book that contained the most important computer science papers, including Von Neuman's paper on architectures and Dijkstra's Go-To paper. The book was an older, blue hard-cover.
Sadly, it got lost somewhere... and so I thought this might be a good place to see if anybody can poi... |
The halting problem is undecidable of course.
This implies that there is at least one program for which we cannot decide whether it halts or not, because theoretically, if all we know is that the halting problem is undecidable, it could still be that there is a program that can decide for every program except itself wh... |
I was asked to model the following sequential circuits C1, C2 as transition systems (i.e. identify the output y function and register functions r1, r2, r3)
For C2 there appears to be not input x and only output y with a register R3. I assumed that there would be two possible states R3 = 0, R3 = 1 and then Y2 = !R3. B... |
problem statement for SKICOURSE is this
Farmer John has N hills on his farm (1 <= N <= 1,000), each with an integer elevation in the range 0 .. 100. In the winter, since there is abundant snow on these hills, FJ routinely operates a ski training camp.
Unfortunately, FJ has just found out about a new tax that will be as... |
From https://en.wikipedia.org/wiki/Programming_language#Type_system
Typed versus untyped languages
A language is typed if the specification of every operation defines
types of data to which the operation is applicable, with the
implication that it is not applicable to other types.[47] For example,
the data repr... |
What are the differences between an implicitly typed programming language and a untyped programming language?
Let me explain the above question and what I have thought about it.
My question comes from reading
https://stackoverflow.com/a/9159863/156458, where the huge slide says
"untyped = no type declaration". I ... |
How exactly is the complexity of a SAT solver measured? My main concern is that, for $N$ variables, you can have, e.g., an OR of $O(2^N)$ AND terms, which would take at least $O(2^N)$ time to process. If the formula can contain duplicate sub-expressions, e.g., $(A \land B) \lor (A \land B)$, then the formula's maximum ... |
What is the difference between a Residual Neural Net and a Recurrent Neural Net?
As I understand,
Residual Neural Networks are very deep networks that implement 'shortcut' connections across multiple layers in order to preserve context as depth increases. Layers in a residual neural net have input from the layer before... |
In programming language theory, there are operations which are distinguished between static and dynamic, e.g. static/dynamic scoping, static/dynamic typing, ....
Does "static" or "dynamic" imply a compiler or interpreter implementation of a programming language?
Let me explain the above question and my thoughts and con... |
$a^ib^jc^k | (i = j)$ then k is even?
I can write it as
$a^ib^ic^k$ where k is even
OR
$a^ib^jc^k where (i != j)$
Both are DCFL and union of DCFL may be DCFL, but I think because of OR operator it gives a sense of parallelism and hence NCFL.
I haven't tried to make a DPDA for it, because in exam I might not be have muc... |
In programming language theory, which concept means that a name can refer to values of different types at different points of execution of a program,
dynamic typing,
implicit i.e. inferred typing, defined as opposed to explicit i.e. manifest typing,
something else?
Let me explain the above question.
My question come... |
What is the problem if we sort the intervals according to their finishing time like the interval scheduling problem? Could someone give a counterexample
?
Note- (refer here for detailed definition)
Interval Partioning Problem: Multiple Identical Resources are available and we have to partition all intervals across thes... |
$$L = \{a^i b^j c^k \mid i \le j \text{ or } (j \le i \text{ and } j = k)\}$$
I think the given language is CSL as i can break this language like this
$$L = \{a^i b^j c^k \mid i \le j \text{ and } j = k\}
\cup \{a^i b^j c^k \mid j \le i \text{ and } j = k\}
\cup \{a^i b^j c^k \mid i \le j \text{ and } j \le i \text{... |
I'm reading Programming - The derivation of algorithms, and I want to understand the purpose of a predicate transformer. This is the excerpt (p. 14-15):
A more precise way in which constructs may be introduced is as follows. For each construct $S$ one defines a predicate transformer, denoted $wp.S$, which is a functio... |
I would like to know how Boyer-Moore text searching algorithm with Galil's rule works,. I tried to search for but I couldn't understand the information I found, for example this Wikipedia page.
And why with this rule we go to a linear time complexity?
|
I am currently trying to wrap my head around intuitionistic logic and its interpretation using the curry-howard isomorphism and propositions as types.
I came about this explained relation between $\forall$ and $\rightarrow$:
A function type $s \rightarrow t$ is actually a function type $\forall
x:s.t$ where the vari... |
My intuition says that I can make a sorting algorithm(may be a strange, not an useful), such that with array it have different worst case time complexity class and linked list(assuming time complexity of operation performed in linked list are same as conventionally used) with different complexity class.
But what about ... |
I'm studying the articleVerifying privacy-type properties of
electronic voting protocols which uses Applied $\pi$-calculus to formalize voting protocols and verifies some privacy-related properties.
In certain parts of the paper they define some transformations over processes which are defined inductively. For example:... |
Subtraction-based algorithm for finding the greatest common divisor works like this:
For two integers a and b (a > 0, b > 0),
if a > b, then gcd(a, b) = gcd(a-b, b)
else if b > a, then gcd(a, b) = gcd(a, b-a).
else if a = b gcd(a, b) = a
What is the $\mathcal O$ of this algorithm?
|
Type inference can be done by a compiler, and in such cases, type inference is static.
Type inference can also be done by an interpreter. An interpreter does the jobs of both compilation and execution. So is type inference done by an interpreter static or dynamic?
This question is an example that motivated my question ... |
I'm not sure how to get from the left hand side to the right. It appears in Sipser's Introduction to the Theory of Computing, in a proof of showing that a $t(n)$ time nondeterministic single-tape Turing machine has an equivalent $2^{O(t(n))}$ time deterministic single-tape Turing machine.
|
Not sure whether this is the correct place to post the question. some of my terms might not accurate.
currently AI is used for classification, inference, and so forth, is AI problem decidable? for example, given a dataset, prior/constraints and neural network, whether it can recognize a pattern (properly accuracy great... |
If we were to find the shortest-path tree rooted at some vertex in a weighted graph G, is it possible that the resulting tree is also a maximum-weight spanning tree of G? Please give an example!
I tried every combination I could come up with using connected graphs with cycles on them (so that there is more than one pos... |
I am new to machine learning and have started brainstorming some model ideas that involve financial instrument/time series data. I was thinking it might be useful to use a classification algorithm to predict if an instrument was in fact up or down y% (TRUE/FALSE) after n days, based on i.e. a combination of technical i... |
I know that sorting the array take O(logn) time. But why finding the minimum of elements take O(n) time, which is more expensive? If I sort the array, I simply output the first element and this would be my minimum.
|
I wish to use alpha beta pruning in a problem with following constraints:
Terminal nodes are likely too distant to be found in most searches
Instead I want to maximize an evaluation function
There is a fixed time limit per search (say 1 second)
Moves are made on a "WeGo" basis ie. we both move simultaneously (I still... |
I have to solve this using the substitution method.
Floor functions cannot be skipped.
IH: Assume that $T(k) \geq ck\log(k) $ for all $k \leq n$, where c is a constant.
IS: Must prove $T(k) \geq ck\log(k) $
Proof:
\begin{align*}
T(n) &= 2T(\left \lfloor{k/2}\right \rfloor ) + k\\
&\geq 2 c\left \lfloor{k/2}\ri... |
I'm completely stuck on Problem 4.10 of the Motwani-Raghavan Randomized Algorithms textbook. I don't want an answer, but hints may be helpful here. I understand the general Valiant scheme for the boolean hypercube but am unable to generalize to an arbitrary regular graph:
"Suppose we run Valiant’s scheme on an N-node n... |
I'm having trouble understanding state tables for turing machines where the state table shown in the above image is supposed to show the change from the top turing machine to the bottom such that an extra 1 was added at index 5. I don't see how when S0 reads 1 (at start, index 1) and shifts the head right it then read... |
I have new logic which has syntax and semantics in usual natural languages and I have to create theorem prover/solver/reasoner for this logic. Is there framework or tool set that can generate such prover from the formal definition of grammar and semantics? I have heard about Isabelle/HOL, is this right set of tools. Is... |
It is known that given a Context Free Grammar $G$, checking that it is ambiguous or not is undecidable. But, if I have a string $s \in L(G)$, does there exist an algorithm to check whether $s$ particularly can be derived unambiguously in $G$?
|
Given a polynomial $f\in\mathbb{F}[x_1,\ldots,x_n]$ what is the computational complexity of computing a generating set of the automorphism group of $f$? On first look this seems like a hard problem (at the least NP-hard). Is the complexity of the above problem studied earlier?
|
The book Theory of codes by J. Berstel and D. Perrin from 1985 studies variable-length codes. The focus is less on error-correction and compression, but more on algebraic properties, synchronization and connections to automata (especially unambiguous transducers). A code over a finite alphabet $A$ is any subset $X$ of ... |
I am to arrange the following 30 functions in terms of increasing order
( all the lg (log) are to the base 2.log* represents iterated logarithm.)
Here's my answer (the functions on the same level are of the same order):
1 ,
lglg*n
lg*n, lg*(lgn)
,
,
,
,
I am not sure where to insert (lo... |
Brief introduction:
Let $n \in \mathbb N$. The non-equality function, denoted $ NE : \{0,1\}^n \times \{0,1\}^n \to \{0,1\} $ is defined as follows:
\begin{align}
\forall x,y\in \{0,1\}^n \;\;\; NE(x,y) = \begin{cases}1 & x\neq y \\ 0 & x = y\end{cases}
\end{align}
In the setting of two party communication complexity,... |
Imagine there are 3 direct-mapped cache designs possible, all with total 8-words of data: C1 has 1-word, C2 has 2 -words block, and C3 has 4-word blocks. Assume the sequence of memory accesses is 3,180,43,2,191,88,190...etc
a) Draw a table with each reference being a row and decimal address, binary address, index, tag,... |
Brief introduction:
In two-party communication complexity, as presented by Yao in 1979, we model protocols as binary trees whose internal nodes are labeled by either Alice or Bob, and the leaves are labeled with possible A node labeled by Alice is a step in the protocol in which she speaks. In these nodes that belongs... |
Is there a real world nonmathematical example of computer software that isn't primitive recursive?
I'm not interested in examples that are somehow closely related to theory of computation or logic (like automated theorem proving, model checking, compiler design etc.), or examples that aren't primitive recursive in a tr... |
The question is:
Given an array of size N, arr, create another array whose index i = number of elements in sub-array(arr, i+1, N-1) that are greater than arr[i].
Eg. if input array is,
5 3 9 8 2 6
output array is
3 3 0 0 1 0
O(N^2) is simple just two for loops.
I think a O(N*logN) is possible by starting from last e... |
I am trying to prove the statement in the title. I have a hard time proving it is true. The way I go about it is by using the definition of $\omega$:
$c\times g(n) < f(n)$; So that if $f \notin \omega(g)$, then $\mathrm{NOT} (c\times g(n)<f(n))$ means that $c\times g(n) \geq f(n)$. And that by definition is Big-Oh.
Is ... |
Is there any literature/survey/papers/books regarding the factorization of Strong PseudoPrimes (wrt. to a given base).
I am aware of the fact that weak Pseudo Primes can be factorized in Polynomial time. But, I was unable to get anything significant/detailed regarding Strong PseudoPrime factorization (I am aware the g... |
i'm trying to understand how to add two numbers in IEE754 half precision format , i haven't found a good reference/tutorial on this , so i've tried to follow the 32 bit floating point addition procedure , but at some point i'm stucked , what i know is:
Half precision (16 bit) IEEE 754 floating point number bit configur... |
Is this problem NP-complete?
I have many restrictions like this and want to find a feasible solution:
((a and b) xor (c and d)) = 1
with a,b,c,d are arbitrary literals. It looks similar to XOR-2SAT but has additional ANDs inside the clause.
|
I'm trying to prove that the following CFG can be converted to a CNF:
S -> aAB
A -> aAa
A -> bb
B -> a
Here below is how I've managed so far:
Step 1: add a new start state
S0 -> S
S -> aAB
A -> aAa
A -> bb
B -> a
Step 2: remove epsilon rules
There are no such rules in this CFG.
Step 3: remove non-terminal to non-term... |
In the last section of chapter 3 (page 57) in Probability and Computing: Randomized Algorithms and Probabilistic Analysis by Mitzenmacher and Upfal, a randomized algorithm is discussed for finding the median of a set $S$ of distinct elements in $O(n)$ time. The algorithm discussed is a Monte Carlo algorithm. As such if... |
I was wondering if you could double check on the following statements being true, false or non-conclusive (as in in some cases true, but false in others). Here they are:
1) $F(n) = \log (n^n)$ implies $F(n) = \Theta(\log n)$.
Answer: It is a tough one? It is confusing because of $n^n$. My assumption would be to have it... |
A Reed-Solomon error-correcting code consisting of N symbols is guaranteed to detect up to N single-symbol replacements in an arbitrarily long input plus the ECC itself, and is also guaranteed to correct up to floor(N/2) single-symbol replacements in the same.
I can't claim to understand the math behind Reed-Solomon EC... |
For the following (related to a binary tree complexity question):
$$f(n) = \sum_{h=0}^{\lg{}n} h2^h$$
Is there any way to express this only in terms of $n$? Or approximate it?
Put in another way, I figure at worst for an upper bound, we could guess at it in the following way:
$f(n) = 0 + (1 \cdot 2) + (2 \cdot 2^2) + ... |
This proof is a proof by induction, and goes as follows:
P(n) is the assertion that "Quicksort correctly sorts every input array of length n."
Base case: every input array of length 1 is already sorted (P(1) holds)
Inductive step: fix n => 2. Fix some input array of length n.
Need to show: if P(k) holds for all k < n,... |
This algorithm computes the number of ways one can make change for n cents assuming one can use six types of coins. Singles, half dollars, quarters, dimes, nickels and pennies. In the following algorithm, what is this type of algorithm called ? Is it dynamic or greedy ? Also, how do I start about finding the complexity... |
So I've been given a piece of pseudo code that involves nested loops. The answer to this question is Θ(n^5) but I do not understand why it is so.
What is the time complexity of this code?
for i = 1 to n
for j = 1 to n*n
for k = 1 to j
Task
where the time complexity of Task is Θ(1)... |
Let $\varphi:\mathbb{N}\to\mathbb{N}^*$ be an arbitrary recursive enumeration of finite strings and
$\mathcal{I}^n_i(x_1,...,x_n) = x_i $
be the $i$-th projection over $n$ variables.
I would like to show from the point of view of recursion theory that the "variable" projection
$$ (n,y) \mapsto \mathcal{I}_y^{\text{le... |
Use examples to identify the need of join dependency.
This is what I have gathered from different website's.
SQL joins are used to combine rows from two or more tables.
A Join Dependency (JD) over a relation schema R is a statement of the form |><|[schema(R1), schema(R2), …, schema(Rn)], where R = {R1, R2, …, Rn} is... |
It is known that an infinite language $L\subseteq \{a\}^*$ is regular iff the set $U:=\{x|a^x\in L\}$ is ultimately periodic. (A set $U\subseteq\mathbb{N}$ is said to be ultimately periodic if there exists bound, $n$, and period, $p$, such that $\forall x\ge n, x\in U\iff x+p\in U$)
My question is given a finite formal... |
In the modal logic K does □ distribution over →?
For example, would the following be correct?
□(p → q) ≡ □p → □q
|
Given two polyhedra(with triangulated faces), P1 and P2. I want to create a polyhedron P, which is the result of joining the two at their region of contact. With join I do not mean union but physically, it is more like welding P1 and P2, so if there is say a cylinder(P1) and a cube(P2) aligned on same axis with P1 part... |
In the answer by Raphael to the question "Is there a system behind the magic of algorithm analysis?", there is an equation:
$$\qquad\displaystyle \mathbb{E}[C_{\text{swaps}}] = \frac{1}{n!} \sum_{A} \operatorname{inv}(A) \tag{1},$$
where $A$ is an array, $\mathbb{E}[C_{\text{swaps}}]$ is the expected number of swaps it... |
According to my lecture and wikipedia NOR and NAND flashes are the most common used. However there isn't really explained why people decided to use these logic gates instead of others. Can someone explain me, what are the factors deciding which gates to use and show how these gates match those properties best?
|
The Max-2SAT problem asks if at least k clauses of a 2CNF formula can be satisfied.
The Max-2SAT(at-most-3) problem is the restriction in which every variable occurs in
at most 3 clauses (counting positive and negative occurrences together). It is known that this problem is APX-hard, the reference being
this book. ... |
In literature in general, are DFS and BFS considered to be special cases of best-first search?
Suppose the cost function is:
$f(n) = g(n) + h(n)$
Is it correct to reason that if and $g(n) = depth(n)$, then
If $\forall_n h(n) = 0$, we have a breadth-first search
If $h(n) = i$, where i is the number of nodes visited befo... |
I'd like to minimize the number of circles $C$ to cover a set of points $P$ in 2D.
There is no fixed radius however each circle must contain exactly $N$ points. The circles may overlap. A point may be covered by multiple circles. All coordinates are floats.
Problem size: $|P| \leq 1000$, $5 < N < 15$
My current approac... |
Looking something up in an unsorted list is a task with time complexity $O(n)$. However, if the list is sorted, the time complexity is $O(\log(n))$. That means it is sometimes worthwhile to sort an array. However, that is a trade-off as a sorting algorithm has a time complexity of $O(n\log(n))$.
As far as I know, you c... |
9.9. Construct a reduction from Accepts-$\lambda$ to the problem Accepts-$\{\lambda\}$: Given a TM $T$ , is $L(T) = \{\lambda\}$?
The question is from Martin's Introduction to Languages and Theory of Computation.
I know how reductions work though I am unsure of several things. It's easy to see that if the inner machine... |
Is there a concept for comparing algorithms in artificial intelligence theory similar to reduction in complexity theory (Wikipedia)?
I'm asking this because I was wondering how AI algorithms are to be classified in terms of general applicability. As far as I'm aware, AI techniques are largely classified by which prob... |
I'm looking for pointers to algorithms which will find long connected similar subsequences which two given sequences have in common. For example, in case of two strings:
abcaabbaabUVWXYZ
UVWXeYZababababab
I'm interested in:
**********UVWXYZ
UVWXYeZ**********
Not in:
ab*aabba*b*****
******aba*ab*bab
(which would be o... |
Probability-related Info theory question that I can't figure out. Thanks in advance!
|
Problem: Given (a,b) and (c,d), find if you can you reach from (a,b) to (c,d) if we can only have the following moves
(a, b) to either (a+b,b) or to (a,a+b).
Example (1,4) to (5,9) is possible because: (1,4) -> (5,4) -> (5,9)
Solution: I can think of is recursive search
Set 1: TestedPoints, initially empty
Set 2: P... |
I have the following divide and conquer algorithm that finds a clique in an undirected graph $G = (V, E)$:
CLIQUE(G):
1) Number the vertices V as 1,2,3...,n where n=|V|
2) If n = 1, return V
3) Divide V in v1 = {1,2,...,[n/2]} and v2 = {[n/2]+1,...,n}
4) Being G1 the subgraph induced by V1 and G2 the subgraph induc... |
L = { < M1,M2 > | M1,M2 are TM's and Ɛ ∈ L(M1) ∪ L(M2) }
Where Ɛ = Epsilon
I know that this language is undecidable, but why it is semidecidable too.
What i have tried is =>
Using Rice's Theorem, part 2
T(no) = (0,1)^+ and T(yes) = (0,1)*
Which gives that T(yes) is not a subset of T(no), and this says that it is sem... |
Recently I was solving a counting problem, which needed this subproblem to be solved:
Given integers $n$ and $t$ (where $1 \le t \le n$) and a decreasing function $f$, find the number of permutations $p_1, p_2, \cdots, p_n$ which satisfy:
for all $1 \le i \le t$, $p_i \le f(i)$, and
for all $t < j \le n$, $p_j \ge f(j... |
It is well established that the class of recursive languages is strictly contained in the class of recursively enumerable languages (Rec $\ne$ RE). Any finite language is decidable and hence can not be RE-complete. My intuition is that an RE-complete language contains infinite number of (finite) strings (information) a... |
Consider processes A and B and the situation where either A will send a message to B or B will send a message to A. Is there a standard algorithm for this scenario that makes sure that exactly one of these two interaction took place?
In a naive implementation where both A and B decide independently whether to send or r... |
I have a doubt regarding bounded waiting.
Deadlock implies no Progress because the processes take indefinite time to decide who will enter the critical section .
But, Does deadlock implies no bounded waiting ?
I think No because bounded waiting is per process and deadlock is for the system.
Moreover, In a deadlock, bou... |
Here is the problem is want to solve:
I want to connect nodes with directed labelled edges, but this two nodes are potentially themselves graphs, hypergraphs or the current structure I don't have a name for.
Here is a simple example with a graph $(v_1,e_1,v_2)$ where nodes $v_1$ and $v_2$ are connected by $e_1$. I wan... |
By reading literature on (denotational) semantics of types, I see that people tried to give several models of types. Reynolds showed that types in general cannot be given a set semantics in classical set theory. However, it was shown later that constructive sets could be used. Now, I also stumbled upon papers where typ... |
According to the lecture, a virtual address first goes to the TLB.
If the TLB hits, it is then checked, if something has to be either read or written from cache.
In case of writing, it is then checked, if the write access bit is on. If yes, then it is tried to write to the cache.
However now it can happen, that the ... |
Say I have
return A[n-1] + Sum(A, n - 2).
I counted the following primitive operations:
return A[n-2] + Sum(A, n - 2)
1 2 3 4 5 6 7
I know accessing a certain index in A counts as 1 primitive operation, but I am not sure about A in the function call. Did I count the right number of operations?
|
A dynamically resizing array list will resize when the number of elements reaches a power of two. So, after n elements inserted, we've resized at sizes 1, 2, 4, ... , n. This also means we've copied over into the newly resized array 1, 2, 4, ... , n number of copies. What then is the sum of this sequence? To answer tha... |
Consider the class $\text{DLOGTIME}^{\text{ALL}}$: the class of problems that can be solved by a machine with unlimited computational power but only access to logarithmically many bits of the input. Which bits of the input it accesses can depend on the values of bits it has already seen, and it has random access to th... |
G → G B ⏐ G N ⏐ ε
B → ( E )
E → E ( E ) ⏐ ε
N → ( L ]
L → L E ⏐ L (⏐ ε
For this grammar, the prompt asks to describe in the language that this grammar describes and builds.
I got to the point of first trying at defining the language each one builds but the recursiveness of this grammar threw me off a bit.
I'm k... |
I've got a DAG of around 3.300 vertices which can be laid out quite successfully by dot as a more or less simple tree (things get complicated because vertices can have more than one predecessor from a whole different rank, so crossovers are frequent). Each vertex in the graph came into being at a specific time in the o... |
I recently came across a problem where I was charged $50 by a merchant with my bank card but there was a communication error, so the money was taken from my account but never arrived in the merchants account. I have contacted both banks and neither know what happened to the money.
How could one would construct softwar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.