instruction stringlengths 35 29.1k |
|---|
Are there any methods, so that I can use a counting semaphore as a binary semaphore?
A binary semaphore should have two possible states: 0 and 1. The operation wait() should atomically look at the state, if the state is > 0, the state should be decremented and the process should continue. If the state is 0, the proce... |
When working on fast parallel multiplier circuit designs, like Wallace tree multipliers or Dada tree multipliers I found many papers and books refer to different components used in the tree to reduce the partial products called things like (4:2) compressor, or (7,3) counter or (7:3) compressor.
My question is :
"What ... |
$F[u, u^{-1}]$ is a ring that contains the polynomials in $u$ and $u^{-1}$ with coefficients in the field $F$.
Some theorems (from https://math.stackexchange.com/questions/1382120/ft-has-undecidable-positive-existential-theory-in-the-language-cdot) are the following:
Theorem 1.
Assume that the characteristic of $F$... |
There is an enormous mass of source code in this world, and I think it's safe to say that most of this source code was once copied from elsewhere, then modified. There is a decent chance of the (small, incremental) modifications having been made traceable in some kind of version control repository, but the (larger-scal... |
I'm trying to understand why an alternate formula for finding the best $p$ items in a 0/1 knapsack with $n$ items isn't working. The formula was proposed by @Carlos Linares López in this answer: Variant of the Knapsack Problem.
Please read the previous answer for context; also I'm positive that the formula is still co... |
Can anybody give me some hint on how to do this? I'm not really sure where to start. The problem says:
We say that an array $A[1...n]$ is $k$-sorted if it can be divided
into $k$ blocks, each of size $n/k$, such that the elements in each
block are larger than the elements in earlier blocks, and smaller than the el... |
Given a multiset of natural numbers X, consider the set of all possible sums:
$$\textrm{sums}(X)= \left\{ \sum_{i \in A} i \,|\, A \subseteq X \right\}$$
For example, $\textrm{sums}(\left\{1,5\right\}) = \left\{0, 1, 5, 6\right\}$ while $\textrm{sums}(\left\{1,1\right\}) = \left\{0, 1, 2\right\}$.
What is the most eff... |
If a process could run as much cores as available, which CPU is faster, a 2-core 2.6GHz CPU or a 4-core 1.3GHz CPU?
|
This question is somewhat of a converse to a previous question on sets formed from set operations on NP-complete sets:
If the set resulting from the union, intersection, or Cartesian
product of two decidable sets $L_1$ and $L_2$ is NP-complete, is at
least one of $L_1, L_2$ necessarily NP-hard? I know that they canno... |
It is known that there are problems in P that, provably, are not
solvable in less than $O(N^k)$, for some $k$. Now consider some infinite
set $K \subseteq \mathbb{R}^+_0$ such as K is unbounded from above (you
can think of $K$ as being $\mathbb{N}$, for easy reasoning).
Theorem: If there exists at least one problem in ... |
Let's say OS is using preemptive CPU scheduling. A process P1 gets a chance to run for some time and then next higher priority process comes and preempts P1. After that higher priority processes are coming regularly and P1 never gets chance. Is this condition called starvation or not?
|
I have problem with understanding why precondition strengthening is sound rule in Hoare logic. The rule is:
$$
{P \implies Q, \{Q\} C \{X\} } \over {\{P\} C \{X\}}
$$
I really do not understand why precondition in consequence goes in reverse direction that implication works (modus ponens).
I can understand why post-con... |
Basic question, but is only information/ data stored in ram? Are computer files such as a word file considered information/ data? This is one of the questions in a summer assignment for ap computer science.
|
I try to minimize the function
$$ f(x_1, …x_n)=\sum\limits_{i}^n-a_i\cos(4(x_i-b_i)) +\sum\limits_{ij}^\text{edge}- \cos(4(x_i-x_j)), \quad
x_i,b_i\in (-\pi, \pi)$$
where $\sum\limits_{ij}^{edge}$ only sums over predefined edges (the edges are sparse, typical there are 4 edges for each $i$). The variables $a_i, b_i$ a... |
There are $n$ plates $p_1$ to $p_n$ each filled with money of value $a_1$ to $a_n$. You can take the money from one or more plates if the sum of the money in them is divisible by three. I need a $\mathcal{O} (n)$ asymptotic time logarithm for finding the maximum earnings that can be achieved. I have no idea for such a ... |
Assume we are given $k$ bins of capacity $b$ and $n$ items with integral sizes $x_1,\dots,x_n$. The bin packing problem is to decide whether there exists an assignment of items to bins such that no bin exceeds its capacity. In this standard from, the bin packing problem is well known to be NP-hard. However, consider a ... |
I am reading Concepts, Techniques, and Models of Computer Programming and came across Flow-based (FBP) and Reactive programming paradigms. Now I have found the following article from J. Paul Morrison, the person who invented FBP. I am also some what familiar with Reactive programming. But I am having hard time to diffe... |
I'm looking at the paxos family of protocols for solving consensus in a network of unreliable processors. I'm working through scenarios where processors fail, and I know I'm wrong, but I don't know why.
I have 3 machines with the state A.
One machine goes down.
The client requests a state change. Paxos works, and mach... |
When attempting to find the following loop invariant for:
int log(int x)
{
int i = 0;
int j = x;
while (j > 1) {
j = j / 2;
i = i + 1;
}
return i;
}
I come up with the following loop invariant:
j >= 0 and i >= 0 must be true before, during and after each iteration.
For case where x >= 0, upon check... |
We have n cards with each card numbered from 1 to n.
All cards are randomly shuffled but all cards are visible
We are allowed only operation MoveCard(n) which moves the card with value n to the top of the pile.
We need to sort the pile of cards with minimum number of MoveCard operations.
The brute force approach which ... |
I have a language, and I want to find a regular expression for the language. How do I do that? Is there a step-by-step, systematic procedure for that? Pretend I am just learning this topic; what approach can I use?
If it helps, you can assume the language is given in English (e.g., something like "$L$ is the set of ... |
Usually, when I program recurrent neural networks, I use a loop for each neuron to figure out it's state. What I realized with this is that in this case, no neuron gets any feedback. They just pump their outputs to the next neuron in the cycle. My thoughts on how to counter this is by having neurons in two different ti... |
The problem gives a MST $T$ and a series of $Q$ queries, each one with a new edge $e = \{u,v\}$ such that no edge between $u$ and $v$ exists in $T$. For every query, we have to improve $T$ with $e$ and print the new weight of $T$.
The best I can do is run a DFS ($O(|V|)$) to find the current path $P$ between $u$ and $v... |
I am studying the Running Gaussian Average Method for background subtraction. One alternative, as described in Wikipedia, also known as Selective Background Updating, is to only update the distribution of background pixels.
I have two questions on this topic:
(1) To determine whether a pixel is foreground or backgroun... |
I'm using K-means for unsupervised learning, using data vectors with an IP address and a language. I need to represent them in an abstract way, so that I can use this algorithm.
|
A simple fact is that $P = NP \to P = coNP$, which follows from the observation that $P$ is closed under complement.
I am having trouble seeing that an analogous statement is true at higher levels of $PH$. For example, is it known that $NP = \Sigma_2 P$ implies $NP = \Pi_2 P$? If so, is there an easy proof? Would su... |
Sun has been making a lot of noise about the Spark M7 and its inbuilt support for the java garbage collector. However there seem to be very little easy to find information about it. Please can someone explain what is so great about “Concurrent Fine-grain Memory Migration”?
Does the M7 cpu have any other novel ways ... |
I've wondered why the tape/tapes are not part of the formal definition of a Turing Machine. Consider, for example, the formal definition of a Turing machine on Wikipedia page. The definition, following Hopcroft and Ullman, includes: the finite set of states $Q$, the tape alphabet $\Gamma$, the blank symbol $b \in \Ga... |
Suppose we have a regular language that describes every string with the exact length of 3.That is obviously a regular language and it still can't be pumped because there is no cyclic behavior in that string/ the corresponding dfa
Can you please help me figure out my mistake?
|
Question:
Is there established procedure or theory for generating code that efficiently applies a matrix-vector multiplication, when the matrix is dense and filled with only zeros and ones? Ideally, the optimized code would make systematic use of previously computed information to reduce duplicated work.
In other words... |
I'm performing a simple one dimensional walk to create sample interest rates. Whilst I know there are lots of options for encouraging values to oscillate around a mean etc. I'm yet to find a simple "proper" way to handle truly random processes going out of bounds. Whilst you could simply turn it in the other direction,... |
I have two numbers x and y.
The upper bits of x are stored at location m, while
the lower bits of x are stored at location n.
The upper bits of y are stored at location i, while
the lower bits of y are stored at location j.
I have the division operator "/" and the multiplication operator "*", but only for numbers store... |
I am trying to verify that the NFA below does not accept babba. However, when I tried to do it by hand I must have made a mistake:
$$\{q_1\}, \{q_2,q_3\}, \{q_1, q_2, q_3\}, \{q_2, q_3\}, \{q_3\}, \{q_1\} \rightarrow \text{Accept}$$
Where is my error?
|
I am working on a project where I have to build an in-memory distributed graph capturing the relation between similar files(based on some similarity metric) stored in shared file system over multiple nodes in a network.
I know basic graph data structure. I googled to know about distributed graph, but what I found mostl... |
I have a graph with the edges already assigned colors and there are edges of the same color as well as different colors incident to each vertex. I would like to find an edge cover (does not have to be minimal) such that no two different colored edges of the edge cover are incident to the same vertex. I thought about ... |
I am having difficulties with understanding the concept of paging.
As a result I've got no idea how I can solve the following exercise - I'm lacking one more equation to solve it.
I've read a lot about paging and watched a few tutorials, but I still cannot solve paging problems easily. I'll provide some of the resource... |
Question: Does the "size" of an algorithm typically refer to the number of its inputs, or its running time?
This seems an ambiguous term to me that I keep seeing in textbooks.
|
I have a generator of files with approximately 7 bits /byte entropy. The files are about 30KB each in length. I'd like to use these as sources of entropy to generate random numbers. Theoretically I should be able to achieve about 26 KB (max) of randomness per file.
This is a hobby and I know about hashes, but they're p... |
In https://cs.stackexchange.com/a/45524/28999, they do a binary search using an oracle for an NP-Complete problem. They show that the original problem can be reduced to that NP-Complete problem, implying that the original problem is in NP.
Why is that allowed? Why are you allowed to continue after the oracle returns fa... |
It is well known that in practice, a substantial difference in run-time between algorithms for testing intersection of a line segment with aligned or oriented bounding boxes (in computer graphics parlance AABB/OBB) does exist. Nevertheless, I wonder if anybody has ever tried to find a lower bound on the run-time for a ... |
Im not sure if I am understanding this question correctly. Its a problem without a solution in my text.
Starting with 1, and at least 01 or at least 010 or both these substrings.....
So a regular expression will be given by:
$1(0+1)^*01010(0+1)^* + 1(0+1)^*01001(0+1)^* + 1(0+1)^*010(0+1)^* + 1(0+1)^*01(0+1)^* = M$
But... |
I've read in an article that $coRP = RP$ is an open question, but that it is obvious that $coRP \subseteq RP^{RP}$.
If $L \in coRP$, I don't understand how access to the oracle helps to build a probabilistic machine that proves $L \in RP^{RP}$.
Any explanation would be appreciated.
|
Can anyone show me step by step how to do a proof on self referential structures.
For example, this example is in scala
lazy val y : Stream[Int] = 1 #:: (y map (_ + 1))
How do I prove that y is a stream of natural numbers. #:: is stream cons in scala.
Also this example is from wikipedia
fibs = 0 : 1 : zipWith (+) fi... |
I've been struggling lately with a problem that was in my last complex algorithms exam, and I can't find a solution.
The problem is as follows:
Half-SAT is a problem where C is a CNF boolean formula with n variables and m clauses, where m is even. We have to determine if there exists an interpretation that satisfies e... |
In the second chapter of Cormen's textbook on Algorithms, he lists a discrete mathematics exercise on so-called "inversions", defined as follows:
Let $A[1 \ldots n]$ be an array of $n$ distinct numbers. If $i < j$ and $A[i] > A[j]$, then the pair $(i, j)$ is called an inversion of $A$.
Question: Is this a mathematica... |
Hello I am a layman trying to analyze game data from League of Legends, specifically looking at predicting the win rate for a given champion given an item build.
Outline
A player can own up to 6 items at the end of a game. They could have purchased these items in different orders or adjusted their inventory position du... |
Here is Wikipedia's explanation of Horner's Method:
Given the polynomial
$$
p(x) = \sum_{i=0}^n a_i x^i = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \cdots + a_n x^n,
$$
where $a_0, \ldots, a_n$ are real numbers, we wish to evaluate the polynomial at a specific value of $x$, say $x_0$.
To accomplish this, we define a new seque... |
Show how to augment dictionary of intervals (insert, delete, search) in order to make possible answer to following questions:
Check if given interval $[a, b]$ intersects with some interval in a dictionary
Check if given interval $[a, b]$ belongs to some interval $[c,d]$ in a dictionary (it means that $[a,b]\cap ... |
Production systems have been used to solve puzzles such as the Tower of Hanoi for years with hard-coded production rules. However, has there been any research in using reinforcement learning to combine basic production rules into more complex ones with the goal of solving a puzzle?
Note that I've asked a similar questi... |
Let us assume the standard situation in communication complexity with two players $P_1,P_2.$
We have a function $f:[n] \times [n] \mapsto \{0,1\}$ that both players known in advance. They wish to compute $f(x,y)$ given that the first player only knows $y$ and the second player only knows $x.$ The communication complex... |
The Arden's lemma states that there exists a solution to the equation between regular expressions
r = sr + t, with r unknown, and it is s*t.
I went through some other topics on the forum and I always saw it being applied, for example, on grammars that have productions like
S->AS|b
so that L(S) = L(A)L(S) + b and the so... |
Given a set with $n$ items, find $x$ subsets, each one of them of size $y$, such that every two subsets share exactly one item.
I've tried to solve it with a reduction to a graph, but I got lost...
Thanks.
|
I have recently encountered the following problem which I heard can be solved by using BIT (binary indexed trees) but I am not sure how:
Given an array $a[1, 2, \ldots, n]$ and $Q$ queries of the form $(L, R, i)$ $(L\leq i\leq R)$. For each query, you have to print the number of $j$ such that $L\leq j\leq R$ and $a[j] ... |
I've been trying to figure out the answer for this question.
How exactly a human brain understands or computes the meaning of any sentence after doing the lexical analysis and parsing? What is the science behind this?
I've searched widely but couldn't read anything satisfactorily. I hope to get one here! Beside, It w... |
The Sieve of Eratosthenes bothers me because you have to specify an upper bound before you begin the algorithm.
Is there a prime sieve that doesn't require this?
More Formally:
Is it possible to write an iterator on which the i'th call to next() yields the prime number $p_i$ in only $O((p_i - p_{i-1})log(log(p_i)))$ ti... |
Let's encode every state and tape word (with position of Turing machine on it) with a single integer. Then the transition function can be represented as a total function from integers to themselves. Now let's apply any known algorithm for searching a cycle in the chain of pointers to that function and we've got it!
P.S... |
Consider a database with the following properties:
It stores symbols (represented as 64-bit integers) and sets of symbols
Sets may contain thousands of symbols, and there may be thousands of sets which are the same except for one or two added symbols
Every set should have exactly one canonical representation (two iden... |
If compilers have an inheritance of compilers(for example, a compiler needs to be compiled by another compiler, and that compiler needs to be compiled by another compiler, and so on) then if there is an inefficiency in one of the compilers up the line of inheritance(like the compiler's compiler's compiler's compiler), ... |
If X denotes the length of string s1 and Y denotes the length of the string s2, then the edit distance between s1 and s2 is never more than
Min(X,Y) or Max(X,Y)?
Please explain.
|
What is language of repeat(L) = {ww | w ∊ L} ?
My try:
I know it {ww | w ∊ (a,b)*} is context sensitive language. Here , what is meant by "repeat(L)" ? Can you explain it ? It is not a homework question.
|
See title. And by all inputs I mean providing the functions with the same input and checking whether they give the same output for each case.
EDIT
If it can be reduced to Halting problem, then how?
EDIT 2
@Ariel's answer doesn't satisfy me since given the concrete machine $T$ and input $x$ he states that there exists a... |
Suppose I have two generic problems $A_{1}$ and $A_{2}$: the instance of $A_{i}$ is a graph $G$ and a number $t$, and the question is whether a certain parameter $P_{i}(G)$ is at least $t$.
Suppose I want to reduce the NP-c problem $A_{1}$ to $A_{2}$. If I can show that $P_{1}(G) \geq x$ if and only if $P_{2}(G) \geq ... |
I am searching for book about algorithms (excercises) with solutions. Can you recommend me one?
|
I know that in general it is undecidable whether two context free grammars generate the same language, but I have to do this exercise and I am finding myself somewhat stuck:
G1:
S->e|aB|bA
B->bS|aBB
A->aS|bAA
G2:
S->e|aSb|bSa|SS
I tried to apply Arden's rule in the first grammar, to variables A and B, but I think ... |
I am trying to build a LL(1) parse table for the following grammar:
S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon
There are two problems here. First, the L rules are a left recursion and the R rules have ( as the same prefix.
So I modified the Grammar to this one:
S -> L
L -> id R X
X -> : L X
X -> Epsi... |
So I saw this question posed on math.se for $d=3$. Suppose we are given a finite set $X \subset {\mathbb Z}^d$ of $n$ points. The goal is to find a hyper box of integer points $ B = [k_{1,1},k_{1,2}] \times [k_{2,1},k_{2,2}] \times \ldots \times [k_{d,1},k_{d,2}] $ so that the Jaccard distance $d(X,B)$ is minimized. Th... |
Both spiking neural networks created with the Neural Engineering Framework (NEF) and Recurrent Neural Networks (RNNs) can be connected recurrently to exhibit neural dynamics. What is the difference between the set of dynamics that they can approximate and/or exhibit?
|
Chapter 7 of The Haskell Road to Logic Math and Programming discusses induction and recursion.
Haskell is strongly typed and we can define the natural numbers
data Natural = Z | S Natural
deriving (Eq, Show)
and we can try to construct addition
plus m Z = m
plus m (S n) = S (plus m n)
Can we write a program that pr... |
I am trying to understand how to use inclusion/exclusion in algorithm.
I think I understand the basic example of what the inclusion/exclusion principle is: the principle is in general illustrated using a venn diagram and the objective is counting the elements of the sets. The principle says that ou first over-count th... |
My previous question Can we prove that $1 + 2 + \dots + n = \frac{n(n+1)}{2}$ using a computer program? has a problem that it tries to cover too much ground. Here is a related question motivated by the comments.
In Lisp and certain other languages code and data are put on equal footing. Lisp is certainly strong enou... |
I do not know if this problems exists with a different name, if it is, I could not find it.
The problem is this:
Given a set $S$ of $n$ points in $\mathbb{Z}^2$, is there a subset $A\subset S$ such that the points of $A$ sum up to $(0,0)$?
If we restrict in $\mathbb{Z}$ this is the classic Subset-Sum problem. Furthe... |
Suppose we have a forest. The leaves have labels. Let's suppose all labels are natural numbers. We would like the forest to support two operations:
rebasing that replaces a leaf on first tree with the second tree.
void rebase(node leaf, node root)
leaf search by the (possibly internal) node of any tree and label we'd ... |
I'm in a Formal languages class and have a grammar quiz coming up. I'm assuming something like this will appear.
Consider the alphabet $\Sigma$ = {a, b, c}. Construct a grammar that generates the language $L = \{bab^nabc^na^p \mid n ≥ 0, p ≥ 1\}$. Assume that the start variable is $S$.
|
How to check if exist pair $(a,b)$ of numbers in BST such that $|a-b| = d$, where $d$ is given.
Example:
contain of tree: $1, 4, 5, 3, 8, 45, 532$
$d=5$,
answer: $yes$, there is pair $(5,8)$
$d=52$
answer: $no$.
I can solve it when number are in array - then I sort them, and in linear time I can find that pair. Never... |
I'm interested in the time complexity of the following problem:
Given an undirected planar graph $G=(V,E)$ and a weight function $w:E \rightarrow \mathbb{Z}$ (so weights can be negative, too), color the vertices in such a way that the sum of the weights of the monochromatic edges (i.e. those between same color vertices... |
Consider the following set:
$S := \left\{\frac{a}{b} \colon a \in \{1,\ldots,A\}, b \in \{1,\ldots,B\} \right\}$
$S$ is the set of all rational numbers that can be represented by two integers $a$ and $b$ that are bounded by $A \geq 1$ and $B \geq 1$. For the sake of simplicity, we can also think of $S$ as a multiset su... |
When programming with high level languages like Python or Matlab, it is always better to model the problem such as the solution is some kind of vector or matrix multiplication, to avoid loops. But this vector multiplication will itself take each elements from both arrays and multiply them so basically there must be som... |
If $B \in NL$ and there exists a Karp reduction (polynomial-time many-one reduction) from $A$ to $B$, then $A \in NL$.
Prove that the above claim is correct, incorrect, or equivalent to an open question.
Trying to solve this, I was pretty sure that the statement is either incorrect, or at least equivalent to an ope... |
The standard search problem studied in AI contains:
An initial state $A$;
A final (goal) state $Z$;
A set of actions that can change the state; each action takes as input a certain state and returns another state.
A solution to such a problem is a sequence of actions starting at $A$ and ending at $Z$.
I am interested... |
I'm currently researching various fusion methods in a multi-modal (video, audio, identity, user position and gesture) human-computer interaction environment (think in terms of a smart-home system). What is the current state of the art in this field and what fusion methods do they use?
The most recent publication I foun... |
In lots of textbooks and papers, authors often state: compiler emits ...
I want to know why they prefer to use emit? (not return, not produce)
Does this have anything to do with the emitter of a compiler?
thanks
|
I am new to automata, and I have been given a brief introduction to regular expressions only yesterday. I have read the various rules which to define a regular expression. But I am unable to differentiate between regular expressions and grammar of a language( I have not been taught the grammar for regular expressions).... |
I am looking for an algorithm that fills a region with one color, but the edge of the region is not completely closed (i.e. one or more gaps are being left). The result is like the use of the Paint Bucket Tool with Gap Size option in Adobe Flash. We can assume that the input of the algorithm has to specify the largest ... |
I understand most concepts regard a resource allocation graph but I see that some resources have more dots (not sure what they are actually referred to) in them than others such as the example below, R1 and R3 have one dot, R2 has two dots and R4 has three dots. I cannot find anything online that explains this so I wou... |
I have an assignment based on operating systems and the question is divided into two sub-questions.
The first is: Prove any seating arrangement of lefties and righties, with at least one of each avoiding deadlock.
The second: Prove any seating arrangement of lefties and righties with at least one of each avoiding sta... |
I have this assignment question but I am a bit unsure how to go about answering it. The question is as follows and accompanied by the image below:
Three processes are competing for six resources labelled A to F as shown
below.
Using a resource allocation graph, show the possibility of a deadlock in
the implementation... |
I've read that in RISC architecture most arithmetic instructions have two "versions":
one that modifies the flags after calculations
one that doesn't modify any flags.
My question is: why is it so?
|
I have this exercise and I really don't know how to complete it:
Prove that for all finite sets S of Turing Machines it is decidable
whether or not given any two Turing Machines M1 and M2 in S they
recognize the same language, that is, L(M1)=L(M2)
I know that the problem of equivalence of languages is undecidable in g... |
I recently learnt that a recursive function is also referred to as a circular function.
See, the recursive function cannot be a circular function because even if there is a call to function itself, it does not happen indefinitely. There is always a base case (or condition) from where the function is supposed to exit in... |
I need to handle Unix signals in a single-threaded application with the following goals:
Signals doesn't mask on receive (thus, the signal handler must be reentrant).
I am not allowed to lose signal data (thus, if a new signal comes before the handler of the previous returned, it also must be handled correctly).
I ha... |
There is a problem I don't know the answer too.
The 3 approximation for the bottleneck TSP that involves first getting the MST.
I have not been able to come up with the right "shortcut" method so far.
To be more specific.
The problem comes from Cormen's Introduction to Algorithms 3rd edition . The problem is
In the b... |
There are m variable in a grammar. The number of productions after removal of unit productions in the worst case is ,(Assume there are no null productions)
(a) O(m)
(b) O($m^2$)
(c) O($k^m$)
(d) O($2^m$)
My attempt:
He asked about number of total production remains in the minimized grammar ,
so , if the there is no n... |
I have a problem with classifying certain CPUs to the proper classes of Flynn's Taxonomy.
1. Zilog Z80
According to this article on Sega Retro, Z80 has limited abilities to be classified as SIMD:
a limited ability for SIMD (Single Instruction, Multiple Data) with instructions to perform copy, compare, input, and outpu... |
Suppose I have an alphabet of n symbols. I can efficiently encode them with $\lceil \log_2n\rceil$-bits strings. For instance if n=8:
A: 0 0 0
B: 0 0 1
C: 0 1 0
D: 0 1 1
E: 1 0 0
F: 1 0 1
G: 1 1 0
H: 1 1 1
Now I have the additional constraint that each column must contain at most p bits set to 1. For instance for p=2... |
I came across a very peculiar recurrence relation :
$\sqrt {T(n)} = \sqrt {T(n-1)} + 2 \sqrt {T(n-2)} $
with initial values $T(0) = T(1) = 1$
Any helps on how to find it
|
I'm reading Microsoft's white paper "Round-Based Public Transit Routing" (the RAPTOR algorithm). In this algorithm, there are some definitions that I don't understand:
About trip:
trip represents a sequence of stops a specific vehicle (train, bus,
subway, . . . ) visits along a line
About route:
Each route consist... |
For example, if the computer has 10111100 stored on one particular byte of RAM, how does the computer know to interpret this byte as an integer, ASCII character, or something else? Is type data stored in an adjacent byte? (I don't think this would be the case as this would result in using twice the amount of space for ... |
Hello people, I'm trying to convert this DFA to RE using the Brzozowski Algebraic Method.
(DFA created with JFlap)
My Attempt
Write down equations
R1 = bR1 + aR2 + ɛ
R2 = bR2 + aR3
R3 = bR2 + aR1
Eliminate equal Rx's from RHS
R1 = b*aR2 + b*
R2 = b*aR3
New equations
R1 = b*aR2 + b*
R2 = b*aR3
R3 = bR2 + aR1... |
I feel like there should be a known algorithm to the following problem, but I am short of ideas how to construct or search for it.
Suppose as an input you have a list of two-dimensional data points (xi, yi). Your goal is to "simplify" this data by providing an output that is equivalent to the input, but grouped togethe... |
I need some help understanding the implementation of the one-writer many-readers problem shown below as I am new to this concept:
I have a rough idea that there will be starvation/deadlock among the readers as there is one writer that multiple readers are trying to access at once. Can anyone please provide some furthe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.