instruction stringlengths 35 29.1k |
|---|
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... |
How can I create a context free grammar for the language $\{p^2q^mpr^nq^{2n+m}| m,n \ge 0\}$, where $\Sigma = \{p,q,r\}$?
|
for every j != i in {0,....,n-1}
How to interpret this for loop? I never seen this type of definition of for loop.
Is it like - j=0 to n-1; j !=i ; ++j
|
Below is a question I was asked in an Interview
What is the best case time complexity to find the height of a Binary Search Tree?
I answered it explaining using the below algorithm
$\mathrm{height}(v)$
if $v$ is a leaf, return 0
otherwise, return $\max(\mathrm{height}(v.\mathit{left}), \mathrm{height}(v.\mathit{right}... |
The typical workflow in topological data analysis is from point cloud data to filtration to a list of bar codes corresponding to each dimension.
A filtration is a sequence of simplicial complexes, each one a subset of the next; where a simplicial complex is a gluing of many simplices such that the intersection of any t... |
This is a naïve and, therefore, possibly malformed question, so apologies in advance!
My view is that a Turing Machine can be seen as the computational basis for procedural/imperative programming languages. Similarly, the lambda calculus is the foundation for functional programming languages.
I have recently learnt tha... |
We're developing a mobile application where one of it's functions is tracking user driving route.
The app simply pushes GPS-coordinates to the server, which stores them into a route.
Then we need to display that route gracefully on a map.
There are 2 problems:
Too many points to draw it all. I solve this by applying m... |
How can an efficient modulus operator be implemented?
Here's a naive way of defining A % B:
given $(a,b) \in \mathbb{Z}$ (represented as int)
while $a > b$ : $(a,b) \mapsto (a-b,b)$
return $a$
This could be very slow. E.g. $(a,b) = (10^7, 13)$. I could be subtracting 13's for a long time.
One more possibility is t... |
I'm currently working on implementing an algorithm to solve a real-world problem I'm encountering in a lab, but with little background in algorithms, I'm struggling to create an ideal solution.
I work in a protein lab and using a mass spectrometer I can get the mass of a protein of interest. Each protein is made up of ... |
Credit assignment is the process of assigning credit (or blame) to a particular move in a sequence of moves (temporal credit assignment) or to a particular node (structural credit assignment) among many nodes, for example, in a network.
My question is somewhat philosophical: Does it even make sense to speak of credit a... |
Since it's called a trap I consider it caused by software, so why it's called a hardware trap? And how does it work?
|
This may not be the right place to ask this kind of question and it also sound a bit stupid, but please help me understand better. I am not able to to see why on page 192 "which imposes another constrain x2 +3 x3<= 600" come up? With the fact that Nuit and Luxe require the same packing machinery. Please take sometimes ... |
I'm asking this, because in every exercise I check if I can relate it to one of the things I know,
like:$A_{TM}$, $\overline{A_{TM}}$, ${HALT_{TM}}$,$\overline{HALT_{TM}}$, $E_{TM}$, $\overline{E_{TM}}$, $ALL_{TM}$
But in many cases I can not find the connection and then get stuck with the question.
For example:$$L = ... |
I need to prove that the following problem is NP-complete: We have $n$ diplomats from $n$ countries and we need to seat them around a round table. We also get a list of diplomats who don't get along with each other, and we can't seat them next to each other.
I thought about a reduction from the $n$-color graph problem ... |
Given that I have a simplified Bison BNF grammar:
%token T_EXP '^'
%token T_NOT '!'
%right T_NOT
%right T_EXP
%right T_FAC
%nonassoc T_LPAREN T_RPAREN T_NUMBER
%type expr
%%
expr:
T_NOT expr # logical not, e.g. !a
| expr T_EXP expr # exponent, e.g. 2 ^ 3
| expr T_NOT %prec T_FAC # factorial, e.g 3!
| T_LPAREN ex... |
In the picture above e is an empty string, and a is a symbol from an alphabet. Every book or professor I have heard from, says than when we make transitions in the NFA, the NFA must guess which state to go to next. In the example above, the NFA must guess whether it should go left or right.
Why do they use the word gu... |
I've google around and have been unsuccessful in finding a name for a data-structure consisting of a list whose elements are unique.
I've seen "unique sorted lists", but I'm looking into the more general, not necessarily sorted, case.
Does anyone know a name and a source for such things? --e.g., a one word name for the... |
Given a graph where each edge has a capacity, is there an efficient algorithm to find the longest path in the graph which does not pass through an edge more times than its capacity? The exact problem I'm trying to solve is given a list of words, find the longest chain of words such that the last letter of the $n^{th}$ ... |
We have $n$ numbers lying on a circle, where $n$ is even. We want to compute the maximum of any $n/2$ consecutive numbers (so, we should get $n$ values in total).
One algorithm is to compute the maximum of every $n/2$ consecutive numbers separately. This leads to an $O(n^2)$ algorithm.
Can we do better? Perhaps using ... |
I am looking for a thread safe data structure where
an element can be searched in $O(\log n)$,
for any value, $x$, the number of elements greater than (or less than) can be estimated in $O(\log n)$,
an element can be inserted in $O(\log n)$, and
an element can be removed in $O(\log n)$.
Can a skip list or some mo... |
If $\overline{M}$ is recursively enumerable and $A$ is recursive, what could we say about $A \cap M$?
I think that as we know nothin about $M$, in general case we can't determine wherther a random element $m$ belongs to $M$, so we coundn't say anything about $A \cap M$. Am I right?
|
I have been given the question "Is the language 010 ∪ 101 regular? Justify your answer."
It is regular and as it can be accepted by an NFA (Draw NFA). Is this correct?
|
I remember reading about Tom Ray's Tierra and how amazing the results it obtained were. However as far as I know, the only "evolution" based computer technology we use now is ML, which is very limited in its abilities. Why haven't we used artificial evolution perhaps similar to Tierra for practical purposes? Is it too ... |
Short version: What is the most space-efficient lossy dictionary (with given false positive and false negative rates)?
Long version: A lossy dictionary is a data structure $D$ that encodes a set $S$ of $n$ key-value pairs $(k_i, v_i)$, assorted with a query operation. Let $K = \{k_1,\dots{},k_n\}$. The query operation ... |
Context:
I am looking at a modified version of the sieve of Eratosthenes. I started by generalising Eratosthenes' sieve, like so:
Choose some starting "root", $n_0\in\mathbb{N}$, a sieve limit (the highest number to sieve), $l\in\mathbb{N}$, and $f:\mathbb{N}^2\to\mathbb{N}^2$ such that $\forall a,b\in\mathbb{N}:f(a,b... |
I have seen attribute grammars for a small handful of tasks:
Parsing simple arithmetical expressions
Type checking
Checking that a variable is initialized
anbncn (seems to be a favorite toy example)...
and that's about it.
What are some practical uses of attribute grammars outside of the field of compilers? I've s... |
In looking for a programming function to validate an IP address within a subnet, I had to calculate the subnet mask from a given CIDR bitmask value ie. 192.168.0.0/24, the value 24 in this example.
The first step is to convert the bitmask value (24) into an unsigned 32bit integer. I found this on the internet (specifi... |
I'm trying to prove $EXP \subset E^E$ (strictly).
I believe I need to construct my own $A \in E^E$ and show that $A \notin EXP$, but I cannot think of a smart way of doing that.
Thanks.
|
For the example below, I am trying to understand how Haskell type classes, type class instances, and data types relate to the concept of initial algebra.
There are two Haskell data types sharing a pair of operations for equality and addition. From my, perhaps incorrect, understanding the instances, which include the da... |
Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below.
repeat
flag[i] = true;
turn = j;
while (P) do no-op;
Enter critical section, perform actions, then
exit critical section
Flag[i] = false;
Perform other non-critical section action... |
If we have an equation with N variables of the form x1 + x2 + x3 +...+ xN with sum S, and upper and lower bounds for each of the N variables, is it possible to find the number of integer solutions (ways) to solve the problem ?
For eg :- if S=5, N=3 and the bounds for variables are 1<=X<=3, then combinations possible ar... |
Say I have a system that is $n$ differential equations that are all coupled together, over a time interval $[a,b]$ with timestep $t$. Is there a straightforward time complexity for MATLAB's built in differential equation solvers ode45, ode23, ode15s? Particularly I am interested in how ode15s grows as the size of $n$ i... |
Given a context free grammar, both the algorithm for determining whether a given string is grammatical and the algorithm for producing a grammatical string in that language are well understood. To produce a grammatical string, just keep replacing non-terminals with one of their right-hand-side productions until you ha... |
I had a simple probability question: suppose we have two coins, coin 1 is heads with probability $= 10\epsilon$ and coin 2 is heads with probability $=\epsilon/10$. Given an unknown coin, how many times do I need to flip the coin to decide which coin I have been given? I feel the right answer is $\Theta(1/\epsilon^2)$,... |
write a Turing machine that accepts L = {a^nb^2n:n ≥ 0} where there are double the amount of b's in comparisons to the amount of a's. So aabbbb would be accepted but aabbaabb would not. I am unsure of how to check that there are twice as many b's then a's. So far i have a change it to an A move to state 1. Then check i... |
I was reading an article on Longest Arithmetic Progression. The solution given has S(n)=$O(n^2)$. Can't I solve it in $O(1)$ space? To find the three elements, we first fix an element as middle element and search for other two (one smaller and one greater). When we found them we still keep on decreasing left and right ... |
I have a collection of people who need to be assigned to one of 10 dates. Each person is in a specific department. The departments have vastly varying amounts of people (from ten to thousands). Each date can accomodate a set amount of people, let's say 5000. My task is to assign each person to a date such that the amou... |
I'm working on an application where the user can add 'calculation' fields to a page. Every calculation field is dependent on x amount of 'number' fields and 'calculation' fields. If calculation field A has field B as one of it's components, field B cannot be dependent on field A, as that would introduce circular depend... |
I'm reading Steven Skiena's "The Algorithm Design Manual", and in one of his War Stories on page 155 he states:
Efficiency is a great challenge in Mathematica, due to its applicative
model of computation (it does not support constant-time write
operations to arrays) and the overhead of interpretation (as opposed t... |
A large body of work looks at the computational complexity of games. In particular, identifying a forced win from a given position.
Is this problem equivalent under polynomial-time reduction to identifying the best forced outcome of a game, where that outcome might not be a win?
If necessary, assume that it’s a two pla... |
Motivation:
Following this discussion about using asymptotic expansions (i.e. polynomial power series) for numerically solving partial differential and algebraic equations (PDAE), I couldn't find any implementation of the method. So I'm thinking of implementing a SymPy function similar to Mathematica's AsymptoticDSolve... |
I am going through machine learning course on coursera. While going through the section on neural networks I came across the cost function for multi - classification problem using neural networks ( ignoring the regularization term ):
$$\begin{gather*} J(\Theta) = - \frac{1}{m} \sum_{i=1}^m \sum_{k=1}^K \left[y^{(i)}_k ... |
If I apply Dijkstra's ,BFS or Bellman-ford algorithm on a disconnected Graph then will the output be a tree or a disconnected Graph only because even if we have a disconnected Graph and we run Dijkstra's algorithm on it then it will return shortest path in the connected component only , but we maintain a predecessor ar... |
$$\{ a^{k}b^{j} : k = 2j , k \geq 0\}$$
I'm trying to wrap my head around CFG's but I am having trouble. From this language, there should be twice as many a's than b's. Here is my attempt.
$$S \to aSb \ | \ a Sa \ | \ \epsilon $$
$$S \Rightarrow aSb \Rightarrow aaSbb \Rightarrow aaaSabb \Rightarrow aaaabb $$
But, I can... |
I've been using multiprocessing and parallelisation for the first time this week on a very large data set using 32 CPUs. I decided to explore it for a smaller task just to see if I could learn anything, just on the 4 CPUs of my Mac.
I created a task to add 100 to every element in a 500,000 element list. To my surprise,... |
Given an array A, we should partition A into two subarrays whose sums are equal, and that maximizes this sum. We are free to omit items from the subarrays.
For example, [7,2,5,7,12] can be divided as the following:
[5,2][7] = 7
[5,7][12] = 12
[7,7][2,12] = 14
We need the final answer as 14 because the max possible s... |
I'm curious if somebody has already figured this out. Is there an efficient algorithm that will generate (in $\mathbb{R}^2$) a sequence of points in such a way that the solution to the travelling salesmen problem is known a priori, and such that we have a uniform distribution on the set of points? For example, I can t... |
I have been looking into the history of programming, and everybody and their grandmothers begin the subject with a claim more or less similar to the following:
At first, programmers used machine code. Later, there were assemblers. Then, pseudo code, and finally Fortran came.
With some Google-fu I can very easily find... |
Let $T$ and $P$ be respectively two sequences $t_1, · · · , t_n$ and $p_1, · · · , p_k$ of characters such that $k ≤ n$. The characters range over a finite alphabet Σ. With each position of $T$, we associate a non-negative value. Let $v(i)$ denote the value for the i-th position in $T$ for $1 ≤ i ≤ n$. Find a matching ... |
There is a well-known problem in CS of finding the maximum sum of non-consecutive integers in a list. There is even an SO post about how to solve it:
https://stackoverflow.com/questions/4487438/maximum-sum-of-non-consecutive-elements
That said, I have read this post many times, and many other posts online about how to ... |
In DFA, is two arrows on each state necessary?
Or it depend on language alphabets? I mean if there is $\Sigma = \{a\}$ then there should be one arrows on each state.
OR if there are $\Sigma = \{a , b\}$ then there should be two arrows on each state.
OR if there are $\Sigma = \{a , b , c\}$ then there should be three... |
Let $R =\mathbb{Z}/N \mathbb{Z}$. Let $f:R\to \mathbb{R}$,
$\rho:R\to \lbrack 0,1\rbrack$. We assume that it takes trivial time to compute any given value $f(m)$ or $\rho(m)$.
Define $$S(\delta,m) = \sum_{n\in R: \rho(n)\geq \delta} f(n+m).$$
Is it possible to compute $S(\delta,m)$ efficiently? To be precise: say we a... |
I tried to solve it as the following:
$$\overline{L}=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)\neq\Sigma^* \big\}$$
I'll show that $\overline{L}\not\in RE$ by reduction from $$\overline{A_{TM}} = \big\{ \langle M, w \rangle \mid M \text{ is TM and }M \text{ rejects } w \big\}$$
I be... |
Given
a unbalanced k-ary tree base (with internal nodes that represent operators and leafs representing values) from the space of all unbalanced k-ary trees T
a distance function delta(t, t') = number of edit operations to transform t into t'
the edit operations add(t) (adding a random leaf), remove(t) (removing a ran... |
I tried solving past exam question but there is this one that I haven't been able to solve.
The question states that a suitable precondition should be found for the statement.
$$
a= i +2; i++\{(a = 7)\land(i = 5)\}
$$
Here's my solution and where I got stuck:
$$
wp(a= i +2; i++,(a = 7 \land i = 5) \\
=wp(a= i +2, wp(i... |
I have a couple of questions based on how SAT solvers work. I understand that SAT solvers may employ any/all of the following techniques:
Randomness
Heuristics
Backtracking
SAT is just one example of an NP-complete problem. Is it common to use such techniques in conjunction to solve intractable problems? I normally s... |
Lets say we have $L_1$ which contains all binary numbers divisivle by 2 but not by 4. I would say this language contains all words with a 10 at the end. Ive found a regular grammar $G$ with $L(G) = L_1$ so that $L_1$ must be regular.
Now I have the problem that my teacher told me that $L_2 = \{ww| w \in \{0,1\}*$ and ... |
There is some thing i dont understand about Hough Transform in polar coordinates.
From wikipedia article:
"The simplest case of Hough transform is detecting straight lines. In general, the straight line y = mx + b can be represented as a point (b, m) in the parameter space. However, vertical lines pose a problem. They ... |
I've only implemented the HM algorithm on a small academic language with a few primitive types and functions. In that case, the unification algorithm would return a type error if two different primitive types were given. For example, if statements unify their condition with primitive type bool, producing the following ... |
How to prove using pumping lemma {0^n OR 1^2n OR 2^3n | n >= 0} is not context free
This isnt the same language as {0^n1^2n2^3n | n >= 0} as this language the numbers need to be in order.
|
I was wondering if there is a complexity class for problems that can be solved efficiently by a quantum computer such that it always gives the right answer? For example the Deutsch-Josza algorithm never fails. Another way of asking would be: is there a class (call it Q) such that Q is to P what BQP is to BPP?
I guess c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.