instruction
stringlengths
35
29.1k
Actually I found that the set of context-sensitive Languages, $\mathbf{CSL}$ ($\mathbf{=NSPACE(O(n)) = LBA}$ accepted languages) are not so widely discussed as $\mathbf{REG}$ (regular languages) or $\mathbf{CFL}$ (context-free languages). And also the open problem $\mathbf{DSPACE(O(n))} =^{?} \mathbf{NSPACE(O(n))}$ is...
I have been working in the Welder theorem prover for some time now. But I'm confused in the way they handle data-types. I'm not familiar with the terminology of sorts and constructors. Here is how one defines a list data-type in the system: val list = mkSort("A")(Seq(cons, nil)) val nil = mkConstructor("A")(Some(list))...
I am reading Turing's "Computing machinery and intelligence" paper (https://www.csee.umbc.edu/courses/471/papers/turing.pdf) and found a fragment in which he says: I have set up on the Manchester computer a small programme using only 1,000 units of storage, whereby the machine supplied with one sixteen-figure number r...
I've struggling with this problem for a while. Given text $T=t_1t_2\ldots t_n$ and pattern $P=p_1p_2\ldots p_m$ over alphabet $\Sigma=\mathbb{N}$, we say there's a block matching of $P$ in index $i$ if there exist $m$ successive blocks $S_1,\ldots,S_m$ such that $$p_1=\sum_{s_1 \in S_1}s_1 \land p_2=\sum_{s_2 \in S_2}s...
Given Directed Graph G(V,E) with red/black vertices, v is "good" if there's a path from v to a black vertex. in linear time. Question: Find all the good vertices in the graph I've come up with an algorithm which almost works. Run SCC on G. Sort topologically. Run from the last SCC till the first SCC. If we find a blac...
I know that if a language class is closed under operation X then the problem is decidable. for eg: "Intersection of two CSL is CSL"? this problem is decidable because it is already proved that CSL follow intersection closure property. But what if language is not closed under the operation. for eg: problem: Is intersec...
There is given input - words is sequence of numbers: $w_i$ is number in sequence, $i$ is position. All of them are in written in binary system. $$w_1\#,...\#w_k\#i$$ Prove that there exists deterministic Turing machine which find $i$-th number in sorted sequence $w$ in logspace. I am not sure if I cor...
I am looking for an answer regarding the CPU read and write. We know there are two clocks that are working in the computer system, one is the peripheral clock and the other is the CPU own clock on which its control systems are working. I am familiar with the clock domain crossing but I dont understand how the CPU read ...
How BDI (Beliefs-Desires-Intentions) agent models is connected with PSI agent model http://cognitive-ai.com/ (and https://en.wikipedia.org/wiki/Psi-theory)? Is one of the models the generalization of the other? PSI model seems to be more sophisticated but it may lack (at present) all the logical foundations and reasoni...
I have a programming problem, instead of describing the whole domain it's easier for me to create an analogy. The numbers I use in this example are completely arbitrary. Your cousin is coming over later and you must feed him dinner. He will only eat what he randomly decides he wants when he gets to your house and will ...
This question: Chernoff bound when we only have upper bound of expectation is similar, but for an upper bound of expectation. The standard Chernoff bound says that is $X$ is a sum of 0/1 random variables, then, for any $\delta \in (0,1)$, $P(X \leq (1-\delta) E(X)) \leq e^{-\frac{\delta^2 E(X)}{2}}$. Suppose we only h...
I have some sets (A, B, ...) each containing some vectors (e.g. [1, 0, -1]). How can I pick exactly one vector per set such that they sum to a specified target vector? For example: A: { [1, 0, -1], [3, 0, 0], ... } B: { [0, -1, -1], [2, -1, 0], ... } Target: [3, -1, -1] Solutions: 1) A=[1, 0, -1], B=[2, -1, 0] 2) A=...
I am looking for the canonical implementation of the "k-combinations with repetition" algorithm. Simple Example: Input: "ABC" (choose 2) ['AA', 'AB', 'AC', 'BB', 'BC', 'CC'] I have a recursive implementation, I'm looking for the performance optimized state of the art version. Usually people mention Knuth for this...
Algorithm to distribute elements evenly among a population In the software I am doing I have three different categories: Maize: 1- Variety A 2- Variety B 3- Variety C 4- Variety D 5- Variety E 6- Variety F 7- Variety G Fertilizer: 1- Type A 2- Type B 3- Type C 4- Type D Manag...
I have logs of activities without labels, which describe whether an activity is normal or not. Assuming that normal behaviors will follow a Gaussian distribution, I fit Gaussian distributions on dataset. I utilized this to generate a synthetic dataset with abnormal patterns. Then, according to the literature review, I ...
I am trying to implement an algorithm called the 'rapidly exploring random belief tree'. The aim of this algorithm is to come up with a path for a robot, which, instead of connecting start and goal with a least distance metric or something similar, drives the robot into areas where it can get high accuracy measurements...
Given a set $\{1,\ldots,ck\}$, is there a known algorithm to efficiently list all partitions in with $c$ blocks of cardinality $k$? In The art of computer programming (Fascicle 3B) by Knuth, there's a mention of an algorithm by Ruskey that can list all partitions with $c$ blocks. I could just use this algorithm and dis...
I'm pretty new to CFG, and I've tried out some samples as well. As of now I'm trying this for-loop to write it in CFG using BNF: Start{ int z = 20; for(int b = 0; b < 5; b++) { //some statement } } Attempted BNF: <program> ::= Start <blockstatements> <blockstatements> ::= <statement> | <state...
I'm trying to practice some combinatorics and I faced this problem, let's say we have given graph with N nodes and M edges. $$N\leq500, M \leq N\cdot(N - 1)/2$$ In this graph I want to count the sub-sets of edges such that each subset will have exactly $N-1$ edges and the edges forming the subset will form connected gr...
Given is a set of points $P_{1},....,P_{n}$ with $P_{i} = (x_{i},y_{i})$. No two points have the same x and y coordinates. Given is also a set of m axis-parallel rechtangles $R_{1},...,R_{m}$ in a plane, described by their bottom left corner $(l_{j},b_{j})$ and upper right corner $(r_{j},u_{j})$. No two rechtangles int...
I am trying to implement a trigram HMM tagger for a language that has over 1000 tags. In my training data I have 459 tags. Now if we consider that states of the HMM are all possible bigrams of tags, that would leave us with $459^2$ states and $(459^2)^2$ transitions between them, which would require a massive amount of...
I am sorry if I sound repetitive(I've asked a similar sounding question earlier - Relevance of memory reads while calculating the time complexity of an algorithm). Actually, it didn't answered my intended query. May be I framed the question inappropriately, and in an unnecessarily complex and indirect way. In the curre...
I have an exercise where one is supposed to give a function that will enumerate the following language: $L_1 = \{ a^pb^p \hspace{1mm} |\hspace{1mm} p \in \mathbb{N} \hspace{1mm} \wedge \text{ (P is a prime number )} \}$. The solution is the following function: $f: \mathbb{N} \rightarrow \Sigma^*$ with $f(i) = a^{p_{...
A single-tape Turing machine $M$ has the property that, for every input $w$, during the first $2 |w|$ steps, the head of $M$ moves only right (it does not move left nor stays in place); the machine is also allowed to halt at any moment during these first $2|w|$ steps. Prove that the language of $M$ is in $DTIME(n)$. Pe...
My question is as follow. Imagine a random shape cluster of high dimension in an euclidian space, how can i get points which are at the edge of the cluster where edge are defined as segments connecting outermost points. I can imagine to compute the similarity matrix and get points which are the most distant from others...
Let's suppose there are N processes and we have the following code: atomic <int> c = 0; semaphore b = 0; proc P(i){ ... if(c.getAndInc() < N - 1){ b.wait(); } else{ b.signal(); } ... } A deadlock will occur as N - 2 processes will be blocked by $ b.wait() $. I'm trying to identify how th...
I have a directed, weighted graph with no double edges. Each node represents a person, and each edge represents a debt. I want to reduce the total number of transactions required to settle all debt, i.e. have the smallest number of edges while maintaining fairness. I've noticed that you can eliminate edges when you owe...
Suppose I have two processes of 50 bytes and have only one partition (hole) of 100 bytes. Suppose the first process takes up the partition and 50 bytes is remaining . Can the second process reside in the same partition even if free space is available or will internal fragmentation occur in case of first fit? Also is it...
i know that resources duplicate is solution to Structure Hazard but what about code scheduling .... Can code scheduling considered as a solution to Structure Hazard ? with Example please .
Let's say we have number 4920 and we want to find the closest $n^x$ to 4920 2 ^ 12 = 4096 but it's not the closest possible $n^x$, for example 17 ^ 3 = 4913 is closer to 4920 The question is, how do we find the closest $n^x$, where $n$ and $x$ are less than 2 digits long? (because $4913^1$ is not what I want)
Everyone keeps claiming that integer factoring is in $NP$ but I just don't get it... Even with the simplest algorithm (division with all integers up to $\sqrt{n}$) the complexity should be $\sqrt{n}\log(n)$... How is that not in $P$? Is there something I'm missing?
Can someone help with this $L= \{a^ib^j | 2i \leq 2j \leq 3i, i>0\}$
(weak) Church-Turing thesis states every physically realizable computation device can be simulated by a Turing machine (not necessarily efficiently). (1) Then Does any model that is not physically realizable and cannot be simulated by Turing machine? (2) Is there any evidence for this thesis?
I was reading about Amdahl's law and it state that value of Amdahl's law always lies between 0 and 1. My question is, is it still true in today's case/scenario? When we have system like core i7?
Context I'm working on load-balancing traffic between client and server nodes. Assumptions: every server has a static weight that represents its computational power: $W^0_i$ we are able to measure with reliability the latency between a client and a server ($rtt_i(j)$ is the latency to reach server $j$ from client $i$)...
Assume my language is $$ L= ww^{r}\ $$ Now when we use NPDA for this,we will guess middle every time. It may be actual middle or it may not, so a new branch is created every time as I have a choice here. Now each branch will get the current stack contents and start its operation. So my question is, do these branches ...
I have a few math courses to pick from in my studies, and I would love some insights on which math courses from the following list are the most relevant for machine learning. I will note - to avoid this question being closed on "opinion based" cause, that my question does not involve which math courses I like or intere...
I was looking at this picture: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Automata_theory.svg/640px-Automata_theory.svg.png Which made me think, that if all Turing Machines PDA's and FSA's recognize certain sets of languages, there has to be a set of languages which is recognized by Combinational Logic c...
When I send a message from one device to another, during the process during which the other device is receiving the data, is that data stored temporarily on some place on the device or is it immediately stored on the hard-drive of the device. and while using TCP when you receive an ACK does this mean that that data has...
Assume language $L$ as follow:- $$ L = \{ a^n b^x c^m d^y | (n=m) \lor (x=y)\} $$ Is it possible to design DPDA/NPDA for this? I know if the condition would have been "and" then it is not possible. But is it possible with "or"? My approach:- 1. Push all $a$'s to the stack. At $b$ define non deterministic behavior as f...
I have already defined here what is minimal 3CNF formula. In the answer to the question, D.W. answered: What you are thinking is wrong. A minimal, unsatisfiable formula can have more than 8 clauses. In response to: In a minimal k-cnf formula, there should be 2k different k literals clauses exactly, so in a minimal 3CNF...
I've recently been thinking about this problem. Given an array $A$ containing $n$ integers and an index $i$, find the number of subgements of $A$ containing $A[i]$ as their minimum. To better illustrate the problem, consider the array $A = [5, 1, 7]$ and we want to find the number of subsegments containing $A[1] = 1$ a...
Is there any literature / research on the average size efficiency of stacks vs queues? I asked because I was recently working on a problem where, if using a queue, the size quickly blew up and the computer ran out of memory. If I used a stack the size stayed very small. I think the reason in this case was that the se...
I need to figure out the complexity of the following loop in theta notation but I can't figure it out. Some help would be much appreciated. from j := 1 until j > n loop from k := 1 until k > n*n*n loop k := k + j end j := j + 2 end some help with an explanation would be much appreciated. The solutions state ...
This question is referring to the Pumping Lemma for CFLs, namely: If $L$ is a CFL, there is a pumping length $p$ such that any string $z \in L$ of length $\geq p$ can be written as $z = uxwyz$, where $|xy| \geq 1$, $|vxy| \leq p$, and $\forall i ≥ 0, ux^iwy^iz \in L$. Let's say we have a language consisting of $0$s ...
I have an Approximation Algorithm problem and its answer but I am having a hard time to clearly understand. The problem is as follows: Consider the following closest-point heuristic for building an approximate traveling-salesman tour whose cost function satisfies the triangle inequality. Begin with a trivial cycle co...
It's fair to summarize classes in OOP as "product types with functions." However, couldn't there be something like "sum types with functions"? How would inheritance work with them? I'm trying to scout if anybody has considered this question before in language design.
using luhns credit card check algorithm why is digits with 7 length allowed ? for example 1111111 is a verfied credit card number meaningly if it has only six digits its not. this does not look like a credit card number to me, am i missing something ? go to any online credit card validation site and try 1111111 and se...
I asked this in stackoverflow, but the question probably fits here better. This question arose from the objection that LISP is regarded as a functional language with some simple principles, namely functions, variables, and operators that roughly correspond to predicates, propositional variables, and connectives in logi...
I thought this problem had a trivial solution, couple of for loops and some fancy counters, but apparently it is rather more complicated. So my question is, how would you write (in C) a function traversal of a square matrix in diagonal strips. Example: 1 2 3 4 5 6 7 8 9 Would have to be traversed in the following orde...
I have this problem to resolve in dynamic programming: An ice cream shop owner has 4 stores. To meet the demand in the summer he purchased 7 refrigerators for the ice cream. Because the stores are in different places, there are different points for selling the ice cream. It was estimated the profit (in monetary unit) ...
Hi I would like to create a self-affine fractal on L-Systems. The axiom I have created is FF-GGG-GG-GGG++GGG+GG-GGG+GG+GGG+FF++ffGG+GGG+FF+GGG which creates the image below At each stage I would like to replace each rectangle with the initial pattern. I am not sure how to do this.
Prove that for every two positive functions $f(n),g(n)$: $$ \max(f(n),g(n)) = \Theta(f(n)+g(n)). $$ I've just started data structures and I barely understand it, so please be gentle with me.
I've read about basic planar-graph embedding and about embedding a planar graph onto a set of fixed points, but I was wondering how one might constrain the locations of some nodes—perhaps to a set of points—while allowing others complete freedom. Is this achievable with a current popular algorithm, or with minor modifi...
I understand that for a problem to be solvable using dynamic programming, it needs to have the following properties: optimal substructure overlapping subproblems I stumbled upon an article which states that: Counting problems cannot exhibit optimal substructure, because they are not optimization problems. Instead, t...
The modern definition of computable functions $f\colon \mathbb N \to \mathbb N$ as given on Wikipedia quite naturally describes partial functions, and not just total functions. Now I am reading some historical references, and before and around the 1930's people just seemed to be concerned with total computable function...
So hey, I've recently found this problem online and I tried hard to solve but couldn't found an efficient solution. The problem statement is: Given and two integers $n$ and $k$ and an array $A$ containing $n$ pairs of integers of the form $(a, b)$ and $d$ defined as $d = |\sum_{x \in E} x[1] -x[0]| $ where is $E$ is a ...
Assumes we have N position, and 3 entrance gate. For example 10 position: 1--2--3--4--5--6--7--8--9--10 For each entrance gate, there is some people waiting to enter and fill positions, first number is position of gate, associated with chair(front of what chair) and second number is number of people to enter: 5 -> 4 6 ...
This is the task: I have a unitary target matrix $T$, to decompose using matrices from a fixed (finite) universal set $\{M_i\}$, e.g. $T = M_6M_3M_9M_0$. The set is universal in the sense that one can reach any unitary with by combining its elements appropriately. I wrote an RL algorithm with a policy network that I fe...
Let's suppose we have a directed graph $G$ which has at least a pair of vertices $v,w$ such that $(v,w) \in E, (w,v) \in E$. $e.g:$ In the example, there is an edge going from $C$ to $A$ and viceversa. So, my question is, what would be the way to model this graph with a residual graph?
I'm trying to implement a k-opt algorithm and I'm bogged down on a detail: the importance of choosing disjoint edges. My question: Is there any benefit to considering adjacent edges, or is the full power of the heuristic achieved when only disjoint edges are considered? Wikipedia seems confused on this question. Its de...
Consider the following expression :- $$h(h^{−1}(L))$$ I need an example where this expression can be superset of subset of L,but i am not able to get one.I am getting this equal to L always.How can i approach this?
Can you explain me why we can't show decidability of problem using non-determinism ? I know that this problem (described below) is not decidability, however I can't understand why following reasoning is not working. Problem Given a context free grammar $G$, does there exists a word $w∈Σ^∗$ such that $w^4∈L(G)$ ? My rea...
Given $G(V,E)$ and $k$. Is there a clique with size $k$? Given set $X = \{x_1,x_2,\dots,x_n \}$, and collection $A = \{A_1,A_2,...,A_n\}$ of sub-sets of $X$ and $k$. Are there are $k$ different elements in $A$, that every two of them has intersection that isn't empty? For example $A_1 = \{ x_1,x_2,x_3 \}$, $A_2 = \{x_4...
(1) Let's say $T_1$ has $r$ number of edges and $T_2$ has $s$ number of edges; where $r \ne s$ but two trees has same weight since they both are MST. I kind feel this kind not be true because to span $n$ vertices with minimum number of edges, we need $n-1$ edges. so MST must have at least $n-1$ edges; if some MST has m...
Tree Sort algorithm with unbalanced tree may yield $O(n^2)$ worst-case time complexity/performance. But Tree Sort algorithm with balanced tree guarantees $O(n\log n)$ worst-case time performance. So I do not see any practical use-cases to prefer unbalanced tree variant of Tree Sort algorithm - Tree Sort with balanced ...
I want to express the following locigal expression in an IP: $$x_{di} \wedge x_{d'j} \Rightarrow \sum_{\substack{d'' \in D\\ i < k <j}} x_{d''k} = \sum_{i<k<j} a_{k} \ \forall \ d, d' \in D, i,j \in T, i<j$$ where $x_{dt}$ is a binary decision variable ($x_{dt} \in \{0,1\}$) and $a_{k}$ is a binary parameter. The meani...
Building karnaugh map for the whole given boolean formula always costs Θ(2n) both time and space complexities, where $n$ is the number of boolean variables in the given boolean formula. It is recommended to do this if $n$ is small, but if $n$ is large, then practically this is not possible to build karnaugh map for the...
I have a question regarding a normalization of values especially in the case of image processing features classification. What if have a series of values that will never be bigger than 1. A = 0.004 0.032 0.017 Do I still need to normalize it into [0,1] range? The thing is that the A variable will may also contain 0 at ...
My main concern is whether the genetic programming is an active field of research, with some promising applications in practice. It seems like in field of machine learning, the neural networks are the main buzzword, with mentions in mainstream news today, but I have never heard of similar genetic programming "success s...
So, I am studying logic circuits and how to prove them with Venn diagrams. When drawing a Venn diagram for the equation A*(B+C) I figured it would look something like this: But according to the answer key, and wolfram alpha, it looks something like this: Can someone explain why this is? Because doesn't A*(B+C) simpli...
Is the following claim correct?: Every computational problem has a decision version of roughly equal computational difficulty. If the above claim is correct, please give a reference for it. (I find this pdf from Prof. E. Demaine, but he doesn't provide any references.)
I posted a similar question here, however I have another question regarding Venn diagrams and logic circuits... In this problem: $$(A+B)(B+C)$$ Wouldn't the Venn diagram look something like this? Because it simplifies to $B + AC$? And you can either have the $B$ region, the $AC$ region, or both? However, apparently i...
Genetic programming uses either trees (in case of classical GP) or acyclic graphs (CGP and in a certain sense LGP), to represent evolved programs (phenotypes). Is there any reason, why cyclic graphs aren't used?
I have a program that generates power set of a given string, the set being the characters of the string. public static Set subsets(String s) { Set subsets = new HashSet(); if (s.length() == 0) { subsets.add(""); } else if (s.length() == 1) { subsets.add(""); subsets.add(s); } els...
I'm working through CLRS on problem 4-2, which says the following: Throughout this book, we assume that parameter passing during procedure calls takes constant time, even if an $N$-element array is being passed. This assumption is valid in most systems because a pointer to the array is passed, not the array itself. Th...
I'm trying to come up with an implementation of a matcher for regular expressions containing backreferences like: ([a-c])x\1 which would match axa, bxb and cxc but nothing else. While I've seen a number of posts about the theory about what is the class of languages this type of regexes describe, I didn't manage to find...
Not really sure if this is an exact CS question. I'm reading the Patt/Patel Introduction to computing systems Powerpoint presentation and I don't understand about the program counter and instruction register format in LC-2. On the memory pages section in chapter 5, it writes there: "Direct mode addressing gets page nu...
Do I get right, that if we say that counting sort time complexity is O(n+k), this notation means that n is number of all elements to sort and k is number of distinct elements? For example for array [ 3, 5, 7, 5, 1, 5] n = 6 and k = 4 ?
I was asked to prove that the next language is recursive enumerable : $$L= \{ \langle G \rangle \mid SAT<L(G) \} $$ where $G$ is a context free grammar and there is a polynomial reduction from the SAT problem to the language that's accepted by $G$. I can't seem to understand why this problem is in RE. Isn't determinin...
I'm a newbie in machine learning field. And I need to choose the best model for my classification model, so i use "learning curve" from sk-learn to make selection. I train and plot learning curve on models such: Logistic Regression KNN Gaussian Naive Bayes Decision Tree Random forest Stochastic Gradient Descent Percep...
In the third edition of Introduction to Algorithms, the authors state: ... when $a$ > 0, any linear function $an+b$ is $O(n^2)$, which is easily verified by taking $c = a + |b|$ and $n_0 = max(1, -b/a).$ [In the above, $c$ and $n_0$ come from the standard definition of big-oh: $f(n)$ is in $O(g(n))$ if there exist ...
This link contains a demo that trains a Convolutional Neural Network on the MNIST digits dataset in browser. I am not getting below terms- 1. max, min gradient in each layer. 2.max, min activation in layers 3.Forward time per example 4.Backprop time per example Classification loss L2 (a pooling mechanism??! but wha...
Let $\varphi$ be a boolean formula in 3-CNF form (conjunctive normal form with three literals at most per clause). I want to convert it to an equivalent boolean formula that uses only NAND gates with fan-in 2, without introducing any new dummy boolean variables. I'm wondering how much this will increase the size of th...
I was given the next function CH(x) that is defined like this: $CH(<M>)$ outputs the computation history of the run of M on epsilon if M halts on epsilon. If it doesn't the function returns epsilon. I was asked to prove that the language {$ M, CH(<M>) |$ M is a turing machine } is in co-RE\R I can't seem to understa...
I am currently studying Automatons and have one, albeit simple, question about NFA-epsilon 'loops' I know that a string can advance using epsilon without having anything read. So my first question would be, if you had a chain of epsilon-arches, would you just jump to the end of the chain instantaneously (Figure 1) ? My...
Facebook announced that it would employ a machine learning "reporting process using pattern recognition in posts previously reported for suicide" (https://newsroom.fb.com/news/2017/03/building-a-safer-community-with-new-suicide-prevention-tools/). Could anyone explain in more detail how this pattern recognition algorit...
If a language X regular, then is the complement of X also a regular language? If yes, then thank you, else can you please explain why
Given two graphs $G_1$ and $G_2$, a zero-knowledge interactive protocol for a prover to convince a verifier that $G_1\not\cong G_2$ entails: The verifier choosing a random $i\in\{1,2\}$ The verifier choosing a random permutation $\pi$ The verifier sending a graph $G_3=\pi(G_i)$ to the prover The prover sending $j\in\{...
Say for example, I have an algorithm $Al_i$ that produces output from the set $S = \{s_i\}$ for problems from the set $P = \{p_i\}$, and another algorithm $Al_j$ that also produces output from the set $S = \{s_i\}$ for problems from the set $P = \{p_i\}$. For the purposes of this question, $Al_j$ and $Al_i$ are the sam...
I just studied about this 2-4 tree which is a self-balanced tree. Various sources and textbook often mentioned that the insertion, deleting and searching of this tree is $O(\lg n)$. However, none of them explain the detailed reasons for that run-time complexity. Neither of them also explains them mathematically for the...
I saw an answer about the fastest way to sort an array with 6 elements. Turns out that using a sorting network is the best choice. If sorting networks are the fastest way to sort a small(< 16 elements) fixed size array, would it make sense to use them in quicksort or mergesort when the recursive call is for an array wi...
I have read that input alphabet of Turing machine is subset of tape symbols because in input alphabet we don't allow blank symbol. But when ever there is a transition to final state the transition as (Blank,Blank,R/L) (First parameter here is input,second is what machine will write on tape,third is direction).It means ...
I have 3 versions of an image at lower resolutions - 480p, 720p, and 1080p. Is it possible to use those 3 images to predict the next highest resolution image (the 4k image)? My first guess was that I could calculate the difference (or momentum or acceleration?) of each pixel between images and use that to predict the ...
The SubsetSum problem decides whether a set $S = \{s_1, s_2,..., s_n\}$ and $k \in \mathbb{N}_0$ contains a subset of $S$ such that its summation is $k$ or not. This problem is NP-Complete. The Partition problem decides whether a set $S = \{s_1, s_2,..., s_n\}$ can be partitionated in two subsets such that the differe...
The Wikipedia article on finding the roots of polynomials mentions all sorts of methods to do so. But it doesn't give, nor can one easily figure out by following the links, known lower and upper bounds on time complexity in various models (and which approaches achieve them). So, if we're given the $n$ real coefficients...
I'm trying to solve T(n) = T(n-1)*n using repeated substitution. I can expand it, but I'm having trouble with geometric sequences for any problem. I find I'm just memorizing solutions to typical problems. It's sometimes hard for me to go from the expanded equation to a general equation that I can simplify. T(n) = T(n-1...
Let's Have i1. lw $s2,0($s1) i2. lw $s1,40($s6) i3. sub $s6,$s1,$s2 i4. add $s6,$s2,$s2 i5. or $s3,$s6,$zero i6. sw $s6,50($s1) what is the true dependence for register $s2 ? i find 2 i1 -> i3 and i1->i4 what is the true dependence for register $s1 ? i find 1 i2 -> i3 what is the true dependence for register...
As far as I understand, Prolog and related languages are restricted to inference rules of the form $$ p_1 \land \dots \land p_n \rightarrow q$$ which is equivalent to the Horn clause $$ \neg p_1 \lor \dots \lor \neg p_n \lor q$$ I'm wondering if there are languages that relax this constraint to allow arbitrary disjucti...
I am trying to figure how to find an upper bound for the running time of a given recurrence relation (without proving the bound) using the Iteration method. The recurrence is: $$T(n)=2T\left(\frac{n}{5}\right)+3T\left(\frac{n}{10}\right)+n$$ I tried to iterate over it and got: $$\begin{align} T(n)& =2T\left(\frac{n}{5}...