instruction stringlengths 35 29.1k |
|---|
I asked ChatGPT to give me the difference between unrecognizable and undecidable languages, and this what it gave me:
Unrecognizable languages can be accepted by a Turing machine, but the machine may not always halt on inputs outside the language.
Undecidable languages cannot be decided by a Turing machine for all pos... |
In the book Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery there is a theorem stating that Gen(2PL) ⊂ OCSR. Can some one help to guide on how to prove this
i.e; Prove that the histories produced by the basic two-phase locking protocol are Order Perserving Con... |
I understand depth first search on a graph, but I'm having difficulty understanding what it means to do depth first search on only certain edges. If given an undirected graph, with 2 types of edges, ordinary edges, and required edges, then apparently according to the resource below it's possible to do depth first sear... |
I just finished watching both parts of Herb Sutter's 2012 C++ and Beyond talk about atomics. In it he mentions that they initially shipped with a bug where the atomic reference count type only guarded the delete behavior with release semantics when actually it needs to be acq_rel, but to me it seems like actually only ... |
from the book, Speech and Language Processing (3rd ed. draft)
I understand conditioning on <s> will give context about the first word.
From the formula above, aren't we computing
P(i want english food </s> | <s>), instead of P(<s> i want english food </s>)? Do we imply p(<s>) = 1?
The n-gram wiki implies same thing to... |
Let us look at the following 2 cases:
We say a binary search implementation in a sorted array of size n has a time complexity of $O(\log n)$. In detail, $O(\log_{2} n)$ because binary search halves the input space with each iteration.
In a recursive code block as below, We say that the time complexity is $O(3^n)$ as ... |
I came across this question presented in a past exam. I can see why the language is not context free (you can't know what the first w is, hence you are not able to duplicate it, I hope it makes sense), but i would like a more formal way to explain it.
I don't really know where to start, if anyone could give me some adv... |
Why is the Program counter(PC) 12 bits and not 24 bits in IAS computer system? PC is said to have next - instruction pair and an instruction has 12 bit adress and 20 bit opcode, so if it's a pair it should store 24 bits , right ?
|
In his book "Foundations of Computing", professor Allison shows an example of "language of equal numbers of as, bs, and cs, but in any order", formally: $L = \{ w \in \{a,b,c\}^*\ |\ |w|_a=|w|_b=|w|_c \}$, where $|w|_a$ denotes the number of $a$s in a word $w$. This language is a variant of the language $L_1 = \{ a^nb^... |
I am working on an LRA Theory solver for SymPy, an open source python library for symbolic computations. You can find my work here. Currently I'm trying to optimize it to run faster.
My implementation is based off of Bruno Dutertre's and Leonardo de Moura's paper "A Fast Linear-Arithmetic Solver for DPLL(T)". My questi... |
I need to implement simple search on Python package names and I'm struggling with ranking the results. Considered Levenshtein distance, but it would give too low ranking for matches which contain the search term exactly but have a long extra prefix or suffix.
I was thinking of applying Levenshtein to each substring of ... |
I would like to know if there are any computational complexity classes where multiple provers interact with a verifier, but the provers work against each other.
For example, suppose it is a decision problem $A$. The verifier has to check if $x \in A$. There are two provers, $P_0, P_1$. $P_0$ tries to convince the verif... |
I have found two definitions of delta reduction:
Barry Watson defines it as the result of applying a primitive computation to terms in normal forms
But in Coq they define it as the substitution of a variable in a local context for its definition.
Although I wouldn't be entirely surprised if one turns out to be a spec... |
I am looking for an implementation for any of the methods to enumerate all vertices of a convex polyhedron defined by $Ax \leq b$
I have found some papers that talk about the problem, for example this one seems like a good lead. However, it is described at a very abstract level, to facilitate proving correctness, ease ... |
I am trying to find an easy to follow resource on implementing any (reasonable) algorithm to find a V-represnetation of a polytope from its h-representation. I only need this to work for $\mathbb{R}^3$
I implemented one which is very silly. Compute all possible intersections of 3 planes among all the half spaces. Then... |
Assume I have $n$ random variables $x$ which need to obey a set of inequality constraints that are linear and can be written as $Ax \leq 0$. Is there a method to sample effectively from these for large $n$, say $n > 10^3$? The first few that are sampled are e.g. from a uniform or exponential distribution, but those con... |
Can you please help identify if the two following variants of the bounded halting problem are in different deterministic complexity classes?
$$
H1 = \{ (\langle M \rangle, w, t) \mid \text{$M$ accepts $w$ in time at most $t$} \}
$$
$$
H2 = \{ (\langle M \rangle, t) \mid \forall \text{$w$, $M$ accepts $w$ in time at mos... |
Maybe this is an odd question. It has always bugged me that computability problems are written in all caps, and in such an "awkward" way. SAT, 3-SAT, COLORING, 3-COLORING, PARTITION, CLIQUE, VERTEX COVER. Etc. They're not proper titles, just single words which don't mean much on their own.
Is there any reason for this ... |
I have been trying to understand how the language $L = \{a^m b^n c^p d^q \mid m*n=p+q\}$) is context-sensitive?
I first encountered this question here.
Would be grateful if you could provide some intuition for identifying class of such language.
Thank you!
|
How to get an estimation of an O(n) function to modern multi-core CPU time? For instance, how can I find the time it takes to run an algorithm in a 4-core/8-core CPU when I know its O(n) ? I searched on google I find nothing about my question...
|
Is the language $L=\{1^n2^n3^m : n\neq m\}$ context free?
I checked and it satisfies the pumping lemma (Right?). Does it also satisfy Ogden's lemma, or any other test for being non-context free?
|
Consider the problem of finding the shortest-path distances from an origin vertex to all other vertices in a digraph. Normally in Dijkstra's algorithm, we visit the vertex whose shortest distance from the origin found so far is least, and that distance is set permanently as the shortest-path distance to that vertex. In... |
How are you intuitively able to tell the Big-Oh of the functions and what order they are on?
$$f(n)=3^n$$
$$g(n)=5^{3log_3{n}}$$
Note this is $5$ raised to $3log_3n$
$$h(n)=1024^{log_2n}$$
|
I am studying Structural Semantics for programming languages and I have come to this proof that I can not achieve.
Whith these rules plus Splitting and No interference, I am trying to get a proof.
I tried:
s0 in State
<S1,s> =>* s0
Stm0 in Stm
<Stm0, s0> =>* <S2,s'>
And somehow put S2 inside Stm0, but it does not ma... |
I was able to use Heap's algorithm for generating permutations and I was able to solve the duplicates problem by looking at all the results and filtering out duplicates myself using a HashSet in Java.
But I was wondering if there is a way to change the code for Heap's algorithm which handles duplicates while generating... |
probably a couple decades too late to ask this question, but does anyone know anything/have detailed documentation about the hardware/design underlying the ALU unit in the early MIPS R2000 CPU?
Ideally I am looking for a circuit diagram like the following:
I don't need/am already familiar with the information from spe... |
From what I know, the classic way of constructing a KD-tree is with alternating dimensions and finding median at each level. In my dataset, I have a lot of duplicated points, and I want to incorporate the duplicates' filtering inside the creating of the KD-tree. However, I am not sure how to proceed.
Obvious option: j... |
There is an obvious construction of linear codes from graphs, where each codeword is a cycle in the graph. Physical bits are edges in the graph, and constraints are vertices.
This has been used in the construction of good LDPC codes with expander graphs by Sipser and Spielman [1], but their construction uses Tanner cod... |
I have two JFrame windows equipped with various components including JButtons and I want the actionPerformed methods for the buttons to send data between the two windows so that one can update the other. Thankfully, I've already got all the button code and everything figured out. The problem is when I try to send a sig... |
You're given a m by n matrix filled with positive integers, as well as some integer k (0 <= k <= min(m, n)). After deleting exactly k rows and k columns (deleting can be thought of as replacing a row/column with all zeros), what's the maximum sum of remaining cells in the matrix you can achieve?
I recently thought of t... |
We have a graph $G$ with $v$ vertices. In $G$ there is at least a maximum clique with $k$ vertices, with $k\lt v$. Is it true that there is at least a vertex of $G$ such that its degree is less than $k-1$?
|
I need assistance in defining axioms for partial functions in total function theory that is available in Coq.
Specifically, I'm looking for a constructive definition of a partial function that includes a constructor for obtaining a partial function from a smaller finite domain.
My use case involves formalizing the prob... |
I have a Python data generator capable of generating SQL-like relational data with primary and foreign key relationships, composite keys, and partial keys. Currently, I store this data in-memory using a plain dictionary (key-value) structure, where I sort headers every time I need to retrieve data to maintain alphabeti... |
I'm working on implementing a solver for Double-Choco puzzle which published by Nikoli magazine. starting by representing the board cells as matrix containing cells with values 1 or 0, where 1 represents gray cells and 0 represents white cells.
For instance:
[
[0, 0, 0, 0, 1],
[1, 1, 1, 0, 1],
[1, 0, 1, 0, 1],
[0, ... |
In general, the problem of finding a Hamiltonian cycle is NP-complete (Karp 1972; Garey and Johnson 1983, p. 199).
Next, as for determining the existence of long cycles, I don't hold much hope for efficient algorithms. However, what about short cycles? For instance, 3-cycles, 4-cycles, and so on. For a $k$-cycle, at wh... |
In order to group unstructured or sem-structured texts for a timeline construction approach, I consider several types of correlations among such texts. These different correlations induce a weighted multigraph, where the texts act as nodes. All edges have a normalized weight between $0$ and $1$.
I wonder what algorithm... |
Consider a set $S$ of segments in the plane. Split each segment in $S$ into a few pieces, and slightly modify the extremities of each obtained segment (by adding a small random value to their coordinates, e.g.). Then consider the set of all obtained segments and add to this set a number of random segments. This gives a... |
I am trying to solve this proof.
In structural semantics I need to proof that:
If <S1;S2,s> =>* <S2,s'>, then it is not necessarily needed that
<S1,s> =>* s'
I tried many things but I am not able to "break" the No Interference Lemma thay says:
<S1;S2,s> =>k s' means that
Exists an state s0 such that
<S1,s> =>k1 s0 ... |
While trying to get an overview of parameters used in the parameterized-complexity theory, it seems that there are no problems parameterized by some basic graph properties like maximum clique, maximum independent set, and maximum degree. Among other resources, I've used this resource https://www.graphclasses.org/classe... |
I have been studying the assosciative mapping in a cache.Every line in a cache has a unique address which is made of:the index and the offset bits which give the the cache set and the cache line and the tag bits.But which algorithm really decides where to put information from RAM into the cache?
|
I have a conundrum to solve but am not knowledgeable enough about cryptography to know whether it's possible to do, and if so, what method to use.
I am a Provider and my task is to prove to some outside Verifier the existence of a Connection to some device, beyond some reasonable probability $\epsilon$. The Verifier an... |
I'm currently developing a custom UI layout library. At the moment a user of that library should supply strings for UI labels in a format that allow for subsequent shortening of those labels, so that they fit into the available space, without omission or indiscriminate ellipsis. Such a label list might look like this (... |
i have this question where im given a an array that contains the distance of a traveler from a certain destination at the i-th time of the day. ideally the array should be in descending order but the array could contain mistakes where the traveler gets further from the destenation and i should find at which index does ... |
Consider the following step where 'abaab', upon failed mismatch, 'ab' the prefix is followed by aligning at 'ab' the suffix. What confuses me is the reason for being able to discard the possibility of a case where 'ab' may be inbetween the two also that might lead to a correct match. So why is it theoretically impossib... |
My understanding is that recursive definitions are considered second-order since they require the fixpoint operator in order to be formulated as "true" definitions. This is even though they contain no higher order quantifiers eg.
times(x,s(y)) = plus(x,times(x,y))
times(x,0) = 0
needs to be written as times = \mu x. F... |
I'm trying to implement a very crude form of the css grid layout. It's layout algorithm is as documented.
“sparse” packing (default behavior)
Set the column-start line of its placement to the earliest (smallest positive index) line index that ensures this item’s grid area will not overlap any occupied grid cells and t... |
I am struggling to write my own recursive function.I understand how to find the base case but I cant find easily the pattern on the relationship between 2 complicated cases.Do you know any website where I can practice that?
|
Wikipedia and other sources define "asymptotically equivalent" as: two functions $f$ and $g$ are asymptotically equivalent if:
$$
\lim\limits_{x \to\infty}\frac{f(x)}{g(x)}=1
$$
But we regard $n^2$ and $2n^2$ as asymptotically equivalent, and these always have a ratio of 2 between them. Is there a different definition... |
As input we are given a graph $G$ and an integer $k$ and are asked to find a dominating set of size exactly $k$ in $G$. This problem is clearly NP-hard, but does it become polynomial time solvable if we assume $G$ has bounded treewidth? For bounded treewidth graphs you can find a dominating set of size at most $k$ by d... |
I am working on an floorplan application where I save elements on an infinite grid in a sparse manner. Specifically, I have the following Python class representing a sparse grid (basically a dictionary mapping coordinates to elements):
from collections.abc import MutableMapping
class SparseGrid(MutableMapping):
"... |
The circumference of a graph is the length of any longest cycle in the graph. The problem of determining circumference of a graph should be NP-complete. However, for graphs of moderate size, is there also a clever brute-force approach?
I referred to the link, where someone mentioned that the Johnson's algorithm is th... |
I was thinking about the language $a^nb^nc^n$, which is obviously not context free, but if we run it through 2 automata at the same time (the first for $a$ and $b$ and the second for $b$ and $c$ and they both accept, the construction would basically accept the language)
|
I was playing a puzzle game and started wondering how they implemented their undo feature. The game only has five possible moves, and only when the player does a move does the game state change, but the game state can be quite complicated.
The standard undo implementation would be to keep track of a stack of all past g... |
Is there any programming language, by which I can write a code that during run time automatically generates so many other codes and furthermore those codes will be run in parallel?
|
Let HALT be a program that can decide the halting problem for any program and its input. HALT has two inputs, the program and the program's input.
Let OPPOSITE be a program that accepts a program as input, calls HALT with its input as both of HALT's inputs, and then does the opposite of whatever HALT has concluded.
If... |
I can easily convert NFA with multiple start states to NFA with single start state with epsilon transition.
But I want to know how can I do so without epsilon transition
Here's my idea
Suppose s1 and s2 are the start states. Let s0 be the new start state.
If s1 or s2 are final states, make s0 final state.
Duplicate al... |
The following is small-scale example is meant to illustrate the general distribution problem
Consider 4 parks, each with exactly 1 pond. Parks are marked as vertices in the following undirected graph:
Each park has a number of ducks in them, and each pond has a maximum capacity of ducks (the parks themselves do not ha... |
I'm currently studying structural properties of network and control protocols and their relation to testing. I'm specifically interested in state machines. They would not need to cover the full behavior to be useful. For many protocols, prototypical state machines can be found online when specifically searching for the... |
I've read Downfall paper. In the university, I've had an introductory course on computer organization and operating systems. We also studied Spectre and Meltdown attacks there. I understood the interplay of speculative execution and side channels in the case of those attacks.
I understand the general similarity between... |
I am working on building exact algorithms for NP-hard problems. Let's consider an NP-hard problem $P$. The brute force approach runs in $2^n$ time. In order to prove that there is no $2^{o(n)}$ time algorithm for $P$, we provide a reduction from the 3-SAT problem (Assuming ETH holds). I want to prove that no exact alg... |
We are looking for a code to list all maximal bicliques in bipartite graphs efficiently, as we want to run it on (large and sparse) graphs, with up to roughly a million nodes and edges in no more that a few hours.
In the literature, we know this fast implementation which implements the algorithm presented in "Efficient... |
I'm reading Java Concurrency in Practice, and I came across the following sentence (section 2.3.1 Intrinsic locks, pg. 25):
Every Java object can implicitly act as a lock for purposes of synchronization; these built-in locks are called intrinsic locks or monitor locks.
Intrinsic locks in Java act as mutexes (or mutual... |
If I start with a directed graph that is strongly connected, is there a straightforward way / algorithm to find the smallest set of edges to remove, such that the result is a directed but acyclic graph?
To be clear, the result is neither necessarily a tree (could have more than one way from A to B), nor is the graph st... |
Let $G = (V, E)$ be an undirected graph such that every $v\in V$ has $\deg(v) \geq 3$. We must create an algorithm that outputs a cycle of length O(log(n)) if it exists. This algorithm must return in linear time. If such a cycle exists return True, if it doesn't return False.
I had a couple ideas of where to start, but... |
Suppose we have a bipartite graph with $N$ vertices on either side.
In the full bipartite graph, the number of edges is $N^2$ and the number of possible matchings (i.e. assignments) is $N!$.
Now suppose a few known edges ($O(1)$ edges) are missing from the full bipartite graph.
How can we find the number of matchings?
... |
Is there an oracle $A$ with $P^A = NP^A$, but $EXP^A \not= NEXP^A$ ?
I found a proof with padding arguments (wikipedia), that
$$ P = NP \Rightarrow EXP = NEXP $$
If an oracle $A$ exists with $P=NP$ and $EXP\not=NEXP$ relative to $A$
then the padding technique would be a proof methode, that circumvents the
Relativizati... |
I'm reading a text book on CPU architecture and I have something that confuses me: The text book defines 4 different instruction execution models in CPUs, Stack (where a CPU only has a stack and is able to perform operations on the first and second elements of the stack and push the result back), Accumulator (the CPU l... |
I looked through Java's Random class and saw that the initial seed is created using:
public Random() {
this(seedUniquifier() ^ System.nanoTime());
}
But every consecutive seed is derived from old seed using:nextseed = (oldseed * multiplier + addend) & mask;
Why is that? Why not use system time everytime?
|
I am reading "An Introduction to the Analysis of Algorithms" by Robert Sedgewick and Kevin Wayne. In this book, Exercise 1.4 asks to develop a recurrence for $C_{N+1} - C_{N}$ and use it to prove that
$$C_N = \sum_{1\leq k < N}{(\lfloor\lg{k}\rfloor + 2)}$$
where $C_{N}$ is the number of compares of mergesort.
Any idea... |
The following code is from GeeksForGeeks
void deleteN(Node** head, int position)
{
Node* temp;
Node* prev;
temp = *head;
prev = *head;
for (int i = 0; i < position; i++) {
if (i == 0 && position == 1) {
*head = (*head)->next;
free(temp);
}
else {
... |
Let $V$ be a set of vectors over $\mathbb{R}^l$, $l\ge 1$, $\pi_i(V)$ be the permutation of vectors in $V$ such that they are ordered by their $i$th component (descending) in order for $\pi_i(V)(\mathbf{v})$ to be the rank of $\textbf{v}$ by component $I$: then define
$$
\operatorname{top}(V, k) := \sum_{i=0}^l \sum_{\... |
Given a sorted array where every element is distinct, we need to evaluate product of every difference, modulo $ 10^9 + 7 $
$$ \prod_{i < j} (arr[j] - arr[i]) \% (10^9 + 7) $$
Best approach I can think of is finding frequency of primes in product by grouping elements with same modular residue, which allows $ O(N * M / \... |
This question is from Exercise 1.7 in the book An Introduction to the Analysis of Algorithms by Robert Sedgewick and Kevin Wayne.
Assume that the running time of mergesort is $cN\lg{N}+ dN$, where $c$ and $d$ are machine-dependent constants. Show that if we implement the program on a particular machine and observe a r... |
In search of an efficient data structure to store some sort of list hash that I can compare to a value to obtain a probability of it already being in the list.
Perhaps it makes more sense defined as follows:
Given a multiset
$$X_n:=\{x_i \ | \ \ 0 \leq i\leq n\}$$
we define a singular value (or finite set of values sig... |
We have $3n$ items with profits $p_1, \dots, p_{3n}$ (sum = $P$) and weights $w_1,\dots,w_{3n}$ (sum
= $W$). We want to determine whether we can choose exactly $n$ items with profit at least $P/2$ and weight at most $W/2$.
Is this problem NP-hard? It is very similar to the usual knapsack problem, but the constraint of ... |
I'm trying to understand David Pisinger's balanced algorithm for the subset-sum problem with bounded weights, which can be found on page 5 of his paper Linear Time Algorithms for Knapsack Problems with Bounded Weights (link). Before asking this question I have read the following sources:
https://codeforces.com/blog/en... |
I am trying to teach myself asymptotic notations. I feel like I'm in over my head. I read the explanations in the text book, and Khan Academy. But when I try to do proofs, I can't grasp anything.
I'm trying to prove that If f (n) = ω(g(n)), then f (n) is not in O(g(n)) or o(g(n)).
I know that they don't intersect, as ω... |
In quantum computing, there is an error correcting code called the color code where each error in the bulk of the code produces three types of symptoms (one red, one green, one blue). Pairs of errors can push a symptom of one color around. The task of decoding is to find a minimal set of errors that merge the given sym... |
We have a $N \times N$ cost matrix where the cost denotes the amount incurred for assigning a worker to a task.
The number of possible assignments is $N!$. Let us call this set of all possible assignments as $Z$.
Assume we have a subset $S$ of assignments from the $N!$ possible assignments.
How can I get one best cost ... |
I'm studying the convex hull algorithms in the high dimensions. There were two papers by Bernard Chazelle and T.M. Chan from the 90s, to have achieved the at then the state of the art complexity. However, when I tried to find the recent papers, most of ones I found was about the "approximation" of the convex hull, rath... |
I am not an expert with functional programming. What I know is that the bag data structure satisfies the definition of a monad. There are two different implementations of Bag: one with linked lists, B1, and one with hash maps, B2. In B2, you are storing integers that are the multiplicities. I want to know:
Are B1 a... |
In category theory, we are taught that polymorphic functions correspond to dinatural transformations, a k a multivariant natural transformations between functors of mixed variance
$\operatorname{G} \in \mathbf{Set^{op}} \times \mathbf{Set} \to \mathbf{Set}$, if there is one type variable.
I have been investigating anot... |
There are many algorithms used for Very large-scale integration design (VLSI) or EDA (Electronic Design Automation). Most of them are challenges that imply some combinatorial/mathematical optimization.
For instance, some well-known problems and their algorithms can be interesting for the field - Graph generation, Floor... |
Given recurrence equation :
$T(N) = T(N-1) + T(N-2) + N$
Given base case
$ T(1) = -3$
So I rewrote the equation as
$ T(n)+ n - T(1) = T(n-1)+ (n-1) - T(1) + T(n-2)+(n-2)-T(1)$
Substituting $ V(n) = T(n) + n - T(1)$ we get :
$V(n) = V(n-1) + V(n-2) $
which is the Fibonacci relation , hence :
$ T(n) = \frac{\phi^{n} - \p... |
Notation: We write $|\alpha|$ to denote the length in characters of an expression $\alpha$ in propositional logic.
Consider an expression $\alpha_n$ in disjunctive normal form built from $2n$ variables where each conjunct contains $n$ variables chosen from those $2n$ original variables.
All $\binom{2n}{n}$ conjuncts ar... |
Self-taught programmer here. I'm reading CORS, and right at the beginning, question 1.2-2, there asks a question:
For inputs of size $n$, insertion sort runs in $8n^2$ steps, which merge sort runs in $64n\lg n$ steps. Which values of $n$ does insertion sort beat merge sort?
I simplified this to $n=8\lg n$, and ran it... |
I have a finite region of 3D space that some (arbitrarily-shaped, concave) geometry occupies, and I need to identify whether that geometry forms a closed 3D volume (or multiple disjoint closed 3D volumes). That is, I need to identify if, and where, the geometry isn’t airtight. The geometry is, effectively, a series of ... |
I've you've ever had a table of text like in Word or Google Docs, you'd know that there are ideal widths for each table column to minimize the height of the table and fit the most text, here's an example. I've tried thinking about how I could implement that myself, but have no ideas. I wonder if this would be some sort... |
SAT Solvers focus on CNF formulas. For many implications it is much mroe natural to use implications and conjunctions to encode problems, and when converting to CNFs, information is lost, and the solver may need to extra work.
Is it possible that if we would rewrite SAT solvers to solve formulae using conjunctions and ... |
From this research paper I want to write an algorithm for finding envy-freeness(EF) and Pareto optimality(PO) division for more than two agents.
We consider the problem of fairly and efficiently allocating indivisible items (goods or bads) under capacity constraints. In this
setting, we are given a set of categorized i... |
I recently had a software engineering exam, and there's a particular question that's causing some confusion between my professor and me. I'd like to get some insights from the community to better understand this issue. If I can convince my professor I was right, I could get a higher grade.
The Question:
The question in... |
I'm a freshman in computer science and I have a question that has been bugging me after my programming and electronics classes were over.
My question is that in an integer datatype (assume short datatype in Java, where the range is from -32768 to +32767.) I understand (based on what has been taught) that this is becaus... |
I am trying to encode some circuit checking algorithms, but encountered difficulty creating a 2SAT representation for a NAND circuit. Is there a proof that this is not possible?
|
I am trying to decide whether the following language is context free:
$$L = \{ a^nb^{3n}c^n \, | \, n \geq 0 \} $$
Assume $L$ is context-free.
Let $p$ be the pumping length given by the Pumping Lemma.
Choose string $s = a^pb^{3p}c^p ∈ L$. Then, $|s| ≥ p$.
Take an arbitrary decomposition $s = uvxyz$ where $|vxy| \le p$ ... |
Let us assume I use bloom filters of size $m$ bits with $k$ hash functions.
Now I have two set $X$ and $Y$. Let $B(X)$ be bloom filter of the set $X$. In general I know that $B(X\cup Y)= B(X) \lor B(Y)$. Let us assume that $|X|=n, |Y|=m, |X\cap Y|=l$.
So I can use formula from wiki for math expectation for number of no... |
I know there are algorithms for translating regular NFAs into their corresponding DFAs. Can these algorithms be applied to automata that employ transitions involving counters in a straightforward way, or are there special considerations that need to be taken into account, or even different algorithms altogether?
|
We have $3n$ items with profits $p_1, \dots, p_{3n}$ (sum = $P$) and weights $w_1,\dots,w_{3n}$ (sum
= $W$). We want to determine whether we can choose exactly $n$ items with profit at least $P/2 - 1$ and weight at most $W/2$.
If the profit must be at least $P/2$, we can set the profits to be equal to the weights and r... |
Here:
$W$ is "bitness" - number of bits in one machine word, that could be stored in memory slots
$N$ - number of memory slots (each has bitness equals $W$)
My solution:
If max length of machine word is $W$ so there are $2^{W}$ different machine words. Suppose, that each possible machine word works like an address o... |
I implemented an incremental Delaunay triangulation algorithm. It basically works except it has this weird issue.
The algorithm starts by creating a bounding triangle that it then splits recursively as new points are inserted. Then the 3 extra points are deleted. This yields these kind of meshes before deleting the poi... |
I am trying to solve the following problem:
Suppose there are traders who can exchange one good for another. Each trader $i$ defines two functions $y = f_{i1}(x)$ and $x = f_{i2}(y)$, with which we can determine how much of $y$ or $x$ we can receive after exchanging with this trader. For example, trader 1 can exchange ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.