instruction stringlengths 35 29.1k |
|---|
Let's say I have an android app that frequently sends current GPS location of the user. If person is driving with bus, I can easily get GPS location of the bus and display it on the map and update it accordingly every 30 seconds.
Let's say that instead of one bus there are 3 buses driving along same route. My problem i... |
Imagine you have to solve this question (+ you have obstacles, i.e. walls), but you're allowed to move in any of 4 directions (not just 2: down and right). How can you solve it? I'm struggling to apply the same dynamic programming principle.
EDIT: one more similar question.
|
I checked wikipedia PCB and its written that -
Since PCB contains the critical information for the process, it must be kept in an area of memory protected from normal user access. In some operating systems the PCB is placed in the beginning of the kernel stack of the process since that is a convenient protected locati... |
I have a square matrix M, which originally looked like this:
133 199 101 121
142 133 199 101
156 142 133 199
108 156 142 133
(so symmetric around the diagonal). Not only that, but each diagonal is constant, so M'[i, j] = M'[p, q] if i + j == p + q , however it has been shuffled both row-wise and column wise. The only... |
Definitions
Assume we have a Shopping List $L$ which is a list of pairs of Items and Quantities: $L = [(i_1, Q_1), (i_2, Q_2), (i_3, Q_3) ...$
We also have a Stock List $S$ which is a list of pairs of Containers and Prices: $S = [(C_1, p_1),(C_2, p_2), (C_3,p_3)...]$
Each container is a list of 3-tuples of Items, Quant... |
My first question was a little too simplified in that it turned out to be an integer linear programming problem solvable with the Simplex Method. However, what I think I am wondering about is how to solve constraints across multiple theories, as with SMT solvers. To demonstrate, I have created a set of constraints usin... |
According to Ryan Williams's answer $ALT\text{-}SPACE(a(n),\log n)\subseteq NSPACE(a(n)\log n)$.
Does there exist any better bound (for example something like $ALT\text{-}SPACE(a(n),\log n)\subseteq NSPACE(\log (a(n))\log n)$), or is it tight or an open problem?
|
So i am given a system of 20 bits virtual addresses and 18 bits physical addresses using paging with pages size 4Kbytes.
I am told to find the maximum number of virtual pages that a process can have and the maximum number of physical memory frames the system can have.
So 2^12 page size makes 12 bits for offset and 8 bi... |
For example, consider L* algorithm for learning a regular language, or A* search algorithm. What do these names - in particular, the star character - mean?
It looks like it might be the case that the star is used in a way similar to the Kleene star - e.g. apparently, A* was preceded by A1 and A2.
|
I have a guess about the problem above. Suppose I have a binary search tree $T$ initially empty. Suppose I drawn $x_1,\ldots,x_k$ (from some real interval $[a,b]$) keys and I want to insert the keys in such order in $T$, what's the expected depth/height of this tree?
My attempt is the following, suppose $x_1$ has been ... |
I can do the very simple transitions but it gets difficult when you have transitions jumping over 1 or more states.
I have this difficult DFA i need help converting to RE:
using STATE ELIMINATION
if you could explain ripping state q1 from the DFA it would help a lot
|
Let's take integer numbers from [1..36]. We can generate 376992 different (order is not important) five-number-combinations like (1,3,5,7,12), etc. Such five-number-combinations always have five distinct (unique) numbers. Each such five-number-combination always contains 5 four-number-combinations (like (1,3,12,7), etc... |
On both Wikipedia and the paper it was introduced the randomized meldable heap uses the following procedure to meld two heaps:
function Meld(Node Q1, Node Q2)
if Q1 is nil => return Q2
if Q2 is nil => return Q1
if Q1 > Q2 => swap Q1 and Q2
if coin_toss is 0 => Q1.left = Meld(Q1.left, Q2)
else Q1.right = Meld(Q1.ri... |
In context-free grammar, are both the following grammars correct for the same language?
$$L = \{a^mb^n : m, n \in N_0 \text{ and } m \ne n\}$$
(grammar one)
$S \to S_1 | S_2$
$S_1 \to A_1B_1$
$A_1 \to aA_1 | a$
$B_1 \to aB_1b | \epsilon$
$S_2 \to A_2B_2$
$A_2 \to aA_2b | \epsilon$
$B_2 \to bB_2 | b$
(grammar two)
$S \t... |
I struggle to find this, suppose I apply any feature detection algorithm. From my references it seems to me it's not usually explained what kind of data structures would be suitable for storing such features.
For example in opencv it seems to me that the Canny Edge detector will return a matrix (I assume the code/gray ... |
Can artificial intelligence solve problems like Post correspondence problem?
|
When I read the book "A Practical approach to compiler construction" the chapter 4 "approaches to syntax analysis" and the section 4.2.3.3 Left Recursion, it says:
"The left recursion has been removed at the cost of an extra non-terminal symbol"
I have no idea why say that, since $A_1$ still contain recursion?
|
From what I understand data entropy controls the limit of data compression and it depends on the probability of the characters in the file. Assuming that we have a file of size 256 bytes containing 256 different symbols and we made a bigger file consisting of many copies of that file, And because the small file has the... |
I'm reading Schrijver's Theory of Linear and Integer Programming, and I have a problem understanding cycling happens in the simplex method. The simplex is described as below:
Solving $\max\{cx\mid x \geq 0; Ax \leq b\}$ At each stage a set $C_k$ is maintained, which consists of $n$ linearly independent equalities from ... |
I have a set of tasks, and a LTL specification that describes which orders of the tasks are legal. I want to find a way to enumerate all permutations of the tasks that meet the specification.
For example, suppose there are two tasks, A and B, and the LTL spec <>(A&<>B) is. This spec says that A should eventually be d... |
Consider the set disjointness problem. Alice and Bob hold n-bit strings $a$ and $b$ respectively.
They would like to compute the function
$$
\text{Dis}(a,b) =
\begin{cases}
0 &\text{if } \exists i : a_i = b_i = 1 \\
1 & \text{Otherwise}\\
\end{cases}
$$
It is well known that this problem has ... |
I am studying binary trees and I am failing to see what numbers can be inserted into this specific node position. The values to pick from are : 16, 24, 36, 45, 49, 51, 58.
I have tried values 24, 36, 45, and 16, 24, 36. I have tried these values because going from left to right, they go in increasing order. Though thi... |
In an answer to this question, a sketch of the proof that total computable functions are not enumerable is made:
Because of diagonalization. If $(f_e:e \in N)$ was a computable enumeration of all total computable functions from N to N, such that every $f_e$ was total, then $g(i)=f_i(i)+1$ would also be a total computa... |
In an algorithm I'm designing, I need to do this cycle on a priority queue of constant size N many times, as quickly as possible:
get $K$ highest priority elements (do on them some outside calculation)
append $4K$ kind-of-sorted elements back into the priority queue, removing and ignoring the first $K$ elements from... |
What is the point and application of recursive and recursive enumerable languages. Finite Automaton is used for pattern matching, designing computer architecture and protocols, CFG is used for designing compilers but what about Recursive and Recursive enumerable languages?
|
Assume that a full binary tree is layed out in memory recursively in the following way.
First the Root followed by Tree representation of left subtree followed by tree representation of right subtree. Assume tree is complete and full.
If a search path requires to go from array location $a[i]$ to $a[k]$, then its refer... |
How does exactly 1 in 3 sat work given the variables Xi, Xy, Xz if one of the variables in the formula are negative.
We know that the results are if they are all positive given that:
R(Xi, Xy, Xz) =
TFF
FTF
FFT
How would the result look like if one or two of the variables were negative? R(-Xi, Xy, Xz) or R(-Xi, Xy, -X... |
Why does set of all strings over the alphabet {0,1} is represented by (0+1)*? As per my understanding (0+1) means either 0 and 1 and * means 0 or more occurrence of the given string. Now when we do (0+1)* it looks like we have to select either 0 or 1 and do a * on that so the resulting should be something like
$\{\eps... |
Is $\Omega \left(\frac{n}{\log{n}} \right)\subset \tilde\Omega(n)$?
|
I have a sorted array $A$ of non-arbitrary elements. Now, I have another element $c$ and I want to find out where it belongs in the sorting of $A$. The cost of comparing $c$ to $A_i$ is $\Theta(i^2)$. I do not directly care about the number of comparisons, I just want to minimize the sum of the costs of the comparisons... |
Given a set of points on a plane find the set of $n$ points that are closest to the origin. (Points are pairs of integers.)
Input: list of points.
Initialize a priority queue $Q$, where priority is measured according to the distance from origin (larger distance is higher priority).
For each point $p$:
Add $p$ ... |
Assuming each node stores its depth, how can I achieve this? Note that I'm not talking about a binary search tree so I shouldn't need rotations. All I want is filling the tree from left to right.
|
There are $n$ jobs where each job $i$ has an arrival time $r_i$, a deadline $d_i$ and a cost $c_i$. The problem is to find a scheduling time $t_i$ (where $r_i\leq t_i\leq d_i$) for each job $i$ in order to minimize $$\sum_i\max_{j\in S_i}(c_j),$$ where $S_i$ is the set of jobs scheduled at time $t_i$.
Can we solve this... |
1D Pink noise, is easy enough to generate. See https://www.dsprelated.com/showarticle/908.php for example.
What about higher-dimensional pink noise, such as 2D or 3D pink noise? Is there an algorithm to generate that?
EDIT: One approach might be to simulate a natural process, since pink noise often arises in nature.
|
In the 1988 paper Rotation Distance, Triangulations, and Hyperbolic Geometry, Sleator, Tarjan and Thurston show that for any pair of $n$-node binary trees, the maximum rotation distance between them is $2n-6$ for all $n \ge 11$.
They also claim that this bound is tight for sufficiently large $n$. I see how they achiev... |
This is the definition of a handle:
1.A “handle” of a string is a substring that matches the RHS of a production.
And
2.Whose reduction to the non-terminal (on the LHS of the production) represents one step along the reverse of a rightmost derivation toward reducing to the start symbol.
I don't understand the second co... |
So first off do the modern operating systems like windows and linux have a method for detecting starvation? if not, why? and if they do, then how are they going to detect starvation of a process? (this was a question in our exam)
my take was this so correct me if this is not good or not possible:
i said we should impl... |
Suppose, we have two non-overlapping convex polygons $A$ and $B$. How can we draw one straight line which divides $A$ into two parts of equal area and also divides $B$ into two equal area parts?
Also, can we do this in complexity $O(n^2)$ or better? ($n = |A| + |B|$)
|
I came across this implementation of PJW and it seems incorrect:
h = ( h << 4 ) + ( k );
if( ( g = ( h & 0xf0000000 ) ) != 0 )
{
h = ( h ^ ( g >> 24 ) ) ^ g;
}
In a more readable form:
h = ( h << 4 ) + k;
g = h & 0xf0000000;
if( g != 0 )
h = h ^ ( g >> 24 ) ^ g;
(Syntax: << and >> are bit shif... |
Most of texts say VLIW, which is lack of hardware to detect hazards and schedule the instructions. But I haven't see any evaluation about how much VLIW can save area(h/w complexity) and power compared to matching superscalar.
Any reliable source is welcomed. Please share with me.
|
At work we build large machines, these get deconstructed, placed i crates and shipped away to the client.
Now we are just guessing how many trucks we need and how we lay the crates out to fit as many of them inside a truck.
For example:
We have a truck and want to load 8 crates of equal size into it. There are 2 possib... |
I am trying to solve a two dimensional combinatorial problem.
Hereis my input space {{RA1,RA2},{RB1,RB2},{RC1,RC2}} and i have to choose two out of three elements{A,B,C} and one out of two possible variations for each of these elements {1,2}. I have an objective function to maximize and i have some constraints. Based ... |
Suppose we have a weighted tournament graph. (A directed graph in which every pair of distinct vertices is connected by a single directed edge.)
The weights are constrained to be 0 and 1.
I know that every tournament contains atleast one hamiltonian path and can be found in time complexity $O(n^2)$.
However, I have t... |
A device is generating 14-bit integer which is stored as int16 (short), a scaling process will then scale the data to value of order 10E-3.
Does it then matter if I store these number with half float or single float? Suppose the scaling factors are just single float.
|
The Minimum Cardinality Exact Cover (MCEC) problem is just like set cover, but the output sets must be disjoint.
Formally, given a collection of subsets $S$ of a finite set $U$, the problem asks for a subcollection $S'$ of $S$ of minimum cardinality such that the union of $S'$ is $U$, and $S_1 \cap S_2 = \emptyset$ fo... |
I have recently created a sudoku solver using C#, which outputs the solution to a sudoku after a reasonable amount of time in many cases. I have used the basic sudoku SAT-reduction (i.e. x111 meaning this is true if column 1, row 1 is filled by 1). The method I have done this does not take in a large clause of variable... |
I'm stuck with this problem:
Given $L$ a CFL on the alphabet $\Sigma$. Prove that $L^r=\{x^r|x\in L\}$, where for each $a\in\Sigma$ and $y\in\Sigma^*$, $$\epsilon^r=\epsilon,$$ $$(ay)^r=y^ra,$$ is context free or not.
Since I don't have the alphabet I cannot think of a grammar that generates this language, so I decide... |
What does it mean that "replace the process's memory space with a new program"? So who's memory space will be replaced by whom?
|
I proposed a new sparse coding algorithm which has good results compared to the baselines, however, it has a non-convex optimization framework.
I solved the problem using a general solver (e.g. Matlab), and although the solution is local optimum, it is still better than other relevant approaches.
So how important is t... |
I have an Excel with 40columns and 20k rows, and i have to store it in a database but i cant figure the best approach for it, the excel format is like this:
This table has 30 columns for days, then 11 columns for the next 11 weeks and then 9 columns for the next 9 month, in resume the first month is in days the next 3 ... |
I am confused how to solve this recurrence equn. after a particular step (step involving ? in the picture)
(Plz help me solve the question with same method which I have used and correct if any of the steps are wrong!)
Attached is what I have done so far..
|
I am studying data structures from Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein, and in the section of heapsort it talks about a data structure beneath the algorithm : a heap, that means, a binary tree with all of its levels complete except possibly the lowest, which is filled from the left up to ... |
The question is pretty much explained in the title. I have the necessary discrete math background and would like to learn algorithms and data structures in the process (of coding) - so the book quoted in the title seems a good read. Since the author states clearly in the preface that the book is suitable for an advance... |
I was going through the concepts of AVL tree and came across the definition of AVL tree from the wiki.
In computer science, an AVL tree (named after inventors Adelson-Velsky and Landis) is a self-balancing binary search tree
even most of the definition claims that AVL tree is BST, but is every AVL tree needs to be BS... |
Suppose we have an $m \times n$ grid or table, with $m$ being the number of rows and $n$ being the number of columns. The user can select the number of colors (let's say $k$ colors) and how often each color is allowed to occur (i.e., we have a vector of numbers of occurrence of the colors $(i_1, i_2, \dots, i_k)$). The... |
I thought about these languages:
$$L_{1} = A_{TM} = \big\{ \langle M, w \rangle \mid M \text{ is TM and }M \text{ accepts } w \big\}$$
$$L_{2} = \overline{HALT_{TM}} = \big\{ \langle M, w \rangle \mid M \text{ is TM and }M \text{ doesn't halt on input } w \big\}$$
Their intersection:
$$L_{1}\cap L_{2} = \big\{ \langle... |
For problem explanation: https://www.geeksforgeeks.org/tug-of-war/
I know the exponential solution to the problem, but can it be improved by greedy or DP approach. If yes then please explain the ideology of the solution. Also please mention if there are exceptions to this greedy or DP solution where it may not apply.
|
I was just solving an exercise when the answer of this suprised me :
We have a memory hierarchy built with 2 levels of caches and a main memory, the access time of the L1 is 1 cycle, for L2 it's 10 and the main memory can be accessed in 100 cycles. We are then asked to calculate the AMAT of this memory.
The miss rate o... |
Is that a "thread" consists of both "user thread" and "kernel thread" as two parts?
And when I create a "thread", is that I create a "user thread" and another "kernel thread" is created "in the background" by OS also?
I'm confused because of the second picture.
The book I'm reading is "Operating System Concepts, 9th ed... |
I need to design a data structure to which I can efficiently add new words(Strings) and search for an existing word. Also, the search word can contain . in it which can match any character. For eg. if I add strings "abcd" and "abed" then search for "ab.d" should return me both of them.
I tried to tackle this using pref... |
Computational complexity classes, such as $P, NP, PSPACE$, etc, are defined according to the factory by which computational time increases, as the input size $n$ increases.
But this doesn’t allow us to talk about the complexity of a particular problem (i.e. for a particular $n$).
For example, I believe that “generalize... |
I have some questions regarding this old contest problem:
Problem,
Solution
I don't quite understand the second paragraph of the second solution which begins with "Unfortunately, the permutation...".
Could anyone explain this part?
|
So I tried to prove that $D =\{x \in \mathbb{N} | \Phi_x(x)\uparrow\}$ is not recursively enumerable in the following way:
let's suppose that $g$ is the computable function that represents $D$ $$g(x) = \left\{\begin{array}{rcl} 1 & \mbox{if} & \Phi_x(x)\downarrow\ \\ 0 & \mbox{if} & \Phi_x(x)\uparrow\ \end{array}\righ... |
I read a post about differences between synchronous and asynchronous transmission modes.
That post has a picture about how bits flows from terminal to computer in async mode.
But how computer can distinguish between 1s and determine what 1 does actually mean. Is it parity bit, is it start/stop bit or maybe it's start... |
In the use case diagram, we draw use cases as an ellipse. Are the use cases the same as functions? I mean by functions, those functions which we write in the program.Thank you in advance.
|
I'm just learning about the Little Man Computer CPU simulator, and am using a version online here: http://peterhigginson.co.uk/lmc/
The instruction set used by the simulator is the same as the one here, I believe: https://en.wikipedia.org/wiki/Little_man_computer#Instructions.
I have got confused right at the beginning... |
Theoretically, is it possible to convert the processing power of the CPU into several tens of bits of memory?
My question is unusual, but it's very interesting. I'm looking for a way to create a small (64 bit) memory department that the user could not access.
|
I tried to prove by contradiction.
$L_{1}$ is undecidable and $L_{2}$ is finite language then $\overline{L_{1}}\cap \overline{L_{2}}$ is decidable.
$$L_{1} = \overline{HALT_{TM}} = \big\{ \langle M, w \rangle \mid M \text{ is TM and }M \text{ doesn't halt on input } w \big\}$$
$$L_{2}=\emptyset$$
then,
$$\overline L_{1... |
If an attacker has an unlimited physical access to CPU, but does not have access to memory, including RAM, can he attack and gain access to the user's data?
I heard the opinion that this is impossible according to the laws of physics, even with an electron microscope. It's true?
|
Does anyone know if Deep Learning Bots can already, for example, train
on many books of an author and output a similar but new book?
I've been wanting to get into ML for quite a while but was lacking a project to use as an incentive to keep learning, and this specific AI has caught my interest. It seems feasible fr... |
It's universally accepted that storing an unencrypted password for automated authentication is a very bad idea, for the saved password can be used by malware, etc.
There is a number of systems that store encrypted passwords for the purpose of automated authentication elsewhere. For example, one can configure git to aut... |
Why the busy waiting is not eliminated even after we put the current process into the process list and "block()"ed it? So even if the process is in waiting state we still call it "busy waiting"?
I'm reading Operating System Concepts, Silberschatz, 9th ed., pages 215~217.
|
Maybe it is not accurate at all, but it looks very accurate for me.
I'm making a scientific calculator for my portfolio, and I found an interesting phenomenon.
Because computers store decimals not accurately but approximately, I thought that asin(sin(30rad)) wouldn't give 30rad, and sqr(sqrt(7)) wouldn't give 7, etc..... |
Given a string $S$ of length $N$ and a string predicate $F$, find the maximum substring, $s$, such that $F(s) = \text{true}$. Assume that $F$ satisfies the following:
If $F(g) = \text{true}$, then any proper sub-string of $g$, above a certain cutoff length $L$, also evaluates true.
Strings below the cutoff length eva... |
What's wrong with the following argument that $NP \subset coNP$?
let $L \in NP$; then there exists an NTM $N$ that decides $L$ in $f(n)$ time where $f(n) = O(n^k)$ for some natural number $k$.
Define $H = $ on input $z$:
run $z$ on $N$ for at most $f(|z|)$ steps.
if $N$ accepted, reject. If hasn't accepted, accept.
T... |
I read in Proofs and Types by Girard et alii. the following excerpt that talks about the calculus of natural deduction:
Now a sentence at a leaf (of the deduction tree) can be dead, when it
no longer plays an active part in the proof. Dead sentences are
obtained by killing live ones. The typical example is the
$... |
The solution given in Cormen is as follows:
Reading this solution, the first doubt that comes in my mind is what if the median lies in array B. According to this solution, we are applying binary search on A only, then how will we get the median if it lies in B. Also the pseudo code is less than understandable. Can any... |
Let's say that we have an original homomorphically encrypted program with any possible code inside. What methods can it use to ensure that it is impossible to create an exact copy of it? Are there such ways?
I understand that a person without a key will not see the internal content of a homomorphically encrypted progra... |
Why the part highlighted the following picture is need? I've been trying to follow to logic flow of it as follow:
Imaging a Situation:
Two processes enter/call F, first A, second B:
Process A: mutex(value: 1 -> 0) enter the body of F, then calls x.wait(), so mutex(value: 0 -> 1) but this process into waiting state beca... |
I would like to write a solver for these kind of Arrow-Ring puzzles. However, I can't encode all the constraints correctly.
I noticed that Sudoku can be solved using integer programming and I am hoping it can be done for this kind of puzzle as well. Let's take a look at the rules:
Draw a line to make a single loop.... |
I have a graph with integer-valued edge weights (possibly negative) on which I would like to obtain a maximum-weight matching.
However, I am using python-graph-tool, which only has max-cardinality max-weight matching, which from what I understand, only finds the max-weight matching of the max-cardinality matchings. Ho... |
In certificate view of NL the size of our guess can be polynomial.Can this guesses be like $a^n b^n c^n d^n$. Can we force the guesses to be in some format? I think it(the format) can be in regex format. can we use $a^n b^n c^n d^n$ format for our guesses?
|
I'm stuck on this problem:
Given $f:\mathbb{N} \rightarrow \mathbb{N}$ a partial recursive function that is also injective and total. Prove that the function $f^{-1}:\mathbb{N} \rightarrow \mathbb{N}$ $$f^{-1} = \left\{\begin{array}{rcl} x & \mbox{if} & f(x) = y \\ \uparrow & \mbox{otherwise}\end{array}\right.$$ is par... |
This is a picture of faster multiplication hardware taken from Computer Organization and Design (5th Edition). I'm having some difficulty understanding it. I was trying to simulate this for a test multiplication of : 1011 x 101. Firstly, P0 is simply the LSB of the (Mplier0 * Mcand) which gives P0 = 1 The two operands ... |
I've been watching a lecture series on computer organization and one of the lecturers statements is something along the lines of 'the clock cycle can only be as fast as the time it takes to complete the longest datapath'.
This doesn't make sense to me. Couldn't chips be architected so that the control unit can check... |
What are Levenshtein distance algorithms, but for images?
I will have one static image (the target: what it should look like) and one variable image (actual: what the user has created)
For example,
Target:
The following should be classified as "close enough"
Actual:
But the following should be classified as "incorrec... |
A weighted set cover problem is:
Given a universe $U=\{1,2,...,n\}$ and a collection of subsets of $U$, $\mathcal S=\{S_1,S_2,...,S_m\}$, and a cost function $c:\mathcal S\to Q^+$ , find a minimum cost subcollection of $\mathcal S$ that covers all elements of $U$.
How to design a deterministic algorithm to solve we... |
The given description of language is:
$\Sigma=\{a,b\}$ and $L=\{a^nwa^n:n\geq 1,w\in\Sigma^*\}$
I felt its regular as we can always interpret $aabaa$ in string $aaabaaa$ as $w$. That is we can always interpret $a^n(a+b)^*a^n$ as $a(a+b)^*a$. So isnt it correct to call this language regular. The book calls it not regu... |
I have some questions regarding the exact nature of non-deterministic algorithms. Is it right that non-deterministic algorithms do not rely on any randomness whatsoever? In which case, this Wikipedia article which mentions Fermat's little theorem includes generating random numbers. I had thought that non-determinism wa... |
I am trying to sample the edges of an undirected graph using weights. The goal is to run a sparsification algorithm on the graph. I see the point that L1 norm is best for sparsification. Can someone tell me how exactly is L1 sampling performed on edges of a graph.
To be more precise with my query, Should we vectorize t... |
With respect to Dynamic Programming we make a statement that :
Greedy algorithm have a local choice of the sub-problems whereas
Dynamic programming would solve the all sub-problems and then select
one that would lead to an optimal solution.
Now in Dynamic Programming we have some problem with recursive nature whi... |
I have an array of images. And, there is a function that calculates the distance between two images.
I wish to cluster the images based on this distance. So the clusters contain images that are all at short distance to each other.
So only the distance between two images can be used to form the clusters. An image has no... |
How can I express this language $L = \{0^n 1^{2n} \mid n ≥ 0\}$ as a context-free grammar?
I am new to this field and I am not sure what should I do. Please help me.
|
Given a tree, with some nodes annotated, such that the annotations form another tree, I'm thinking "sparse subtree" is an appropriate term for describing the latter tree as it relates to the original tree. But I'd like to check with y'all because I plan to use the term in writing for an audience that will include CS sa... |
I came across following problem:
Suppose $L_1$ and $L_2$ are two languages, $M$ is a Turing machine
$L_1 =\{M|M$ accepts at most 2016 strings$\}$
$L_2=\{M|M$ accepts at least 2016 strings$\}$
If $L=L_1\cap L_2$, then which one of the below is correct?
A) $L'$ is recursively enumerable
B) $L\cap L'$ is recurs... |
I was calculating the time complexity of the following recurrence relation given that T(1) = 1 :
T(n) = 2T(n/2) + Logn
I was calculating the value and this is where I reached:
T(n) = logn + 2log(n/2) + 4log(n/4) + 8log(n/8) + .....+ 1
I have tried solving this by opening log but I'm unable to reach O(n). I don't want a... |
Is it $NP$-complete given $c(x),g(x)\in\mathbb{F}_2[x]$ where $g$ generates a cyclic code of length $n$ (so $g\mid x^n-1$), and $\deg c<n$ to find the nearest codeword to $c$?
This is related to the following problem in finite fields: given $\hat{g},\hat{x}\in\mathbb{F}_{2^k}$, find the sparsest polynomial $F\in\mathbb... |
From the text Principles of Type Refinement page 14:
The author introduces in definition 2.2.7 the rule:
$$ \dfrac{\Pi \vdash t : R \qquad R \le S}{\Pi \vdash t : S} $$
and gives the following contravariant form:
$$ \dfrac{\Omega \le \Pi \qquad \Pi: t : R}{\Omega \vdash t:R} $$
where $\Omega,\Pi \sqsubset \Gamma$ and $... |
I have a problem which can be completely solved using dynamic programming, but in a very intractable way (On^4, where n is around 1000). I won't get into the details of the problem since it's a bit complicated, but it involves comparing properties of subsequences of a single string, where the property of subsequence (... |
In order to understand the question, imagine a simple situation. Alice tells Bob that her CPU's frequency is X Hz. Bob does not take her word for it. Bob can not meet with Alice and check what frequency her processor really has. Can Bob send her a soft program that accurately determines the frequency of Alice's CPU? Is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.