instruction stringlengths 35 29.1k |
|---|
We have a set of positive integers $N=\{a_1,...,a_n\}$, we want to select a subset $N'$ of $N$ with maximum total sum of integers such that this sum should not exceed a given integer $B$.
What is the complexity of this problem.
|
Background:
There are 832 unique Pokemon in the Pokemon universe, and
There are 728 fighting moves that the Pokemon can collectively learn.
No Pokemon can learn to do every fighting move, and some Pokemon can only learn one.
The average Pokemon can learn between 10-30 fighting moves , and
Most fighting moves can be ... |
In my programming concept class we learned that for the array type it's faster to index in memory if the length of an element is = $2^n$. This case make us only need to offset instead of actually doing multiplication.
We also learned about the representation of multivariable arrays with row major. It was then said tha... |
i was going thorugh different searching algorithms,Linear,binary and ternary search.Now i want to know the number of comparisons in these.
For linear search :
procedure Linear_search(a1,a2,...,an:integers,k)
1.location = 0;
2.for i = 1 to n #n+1 times
3. if (a_i = k) then location = i # n times
4.return locati... |
I'm having some difficulty trying to come up with an algorithm for computing $Pr[s \vDash C ~\bigcup^{\geq n} B]$ given a finite Markov chain where $S$ is the set of states, $s \in S$, $B,C \subseteq S$, and $n \in \mathbb{N}$ where $n \geq 1$.
I have algorithms for computing $Pr[s \vDash C~\bigcup~B]$, $Pr[s \vDash C... |
I have a set of RGB-D scans of the same scene, corresponding camera poses, intrinsics and extrinsics for both color and depth cameras. RGB's resolution is 1290x960, depth's is 640x480.
Depth is pretty accurate, but still noisy, the same with camera poses. However, both intrinsics and extrinsics are not very accurate: f... |
Even if there is no general algorithm to decide if any program will halt, but there could be properties or meta-questions about the programs that is decidable. For example, given program $A$ and a program $B$ that is obtainable from program $A$ by adding in finite steps of calculations that halts.
So if $A$ halts, $B$ ... |
We are given 4 integers N,M ,Q and Z.
Initially,the matrix has all zeroes in it.
We have to perform Q operations on the matrix.
In each operation, any cell of the matrix can be selected(same cell can be selected multiple times) .
Once a cell (x,y) is selected, you have to add '1' to all the elements of row 'x' and... |
The $3-SAT$ problem is known to be NP-complete problem. Which means that (as far as I understand), unless $P \neq NP$, for every algorithm $A$ which decides $3-SAT$, $A$ runs in super polynomial time (I know that this is not well defined). A stronger assumption is the "Strong Exponential Time Hypothesis " which states ... |
I'm currently looking at perfect hash functions. One thing I miss from the texts I've read so far is, how they cope when attempting to look up with a key that is outside of the set from which the perfect hash was generated from.
|
Can I solve T(n) = 2T(n − 1) + 1 using the master theorem method?
I don't think it cannot be solved with the master theorem because b=1.
Please let me know, if my guess is wrong.
|
Just doing some work on Finite and infinite languages. And came across some statements I know the answer to but not sure how to explain why.
There are finitely many finite languages.
-This is false right? Since there are technically infinitely many finite languages
Union of any two languages over alphabet (1,0) is r... |
TAPL book, page 56 reads:
Under the normal order strategy, the leftmost, outermost redex is
always reduced first.
I understand this as a restriction of the full beta-reduction evaluation strategy, whose reduction rules are given as follows:
$$\frac{t_1 \to t_1'}{t_1 t_2 \to t_1' t_2}$$
$$\frac{t_2 \to t_2'}{t_1 t_2... |
Given the grammar of the Python language, is there a concise way to specify the space of all possible (and correct) Python programs?
To avoid the underlying halting problem, the specification would include a user-definable maximum program size and running time. This concise specification could then be fed to another pr... |
I am coding in Matlab:
m = [40 50 60]; X=[]; % [] makes an empty matrix
for j=1:3
for i=1:3
x=zeros(m(i),1); % a vector of m(i) zeros
X=[X;x]; % store x under the old previous ones
end
end
and would like to run the code in parallel. Is there a way to calculate from which ... |
Hi all, I'm currently going through the Princeton Algorithms course on coursera, and I'm having trouble understanding the answer to this quiz. I think I understand where the $\frac{1}{2} N^2$ term comes from, but I am completley lost on the $3 \ln N$ term. Unfortunatley this is the only solution.
|
There is this talk http://andrewcropper.com/pubs/jelia19-typed.pdf about higher order Prolog, about use of higher-order predicates (that takes other predicates as arguments) and compositionality of predicates. All that is about Prolog and backward chaining inference.
My question is: do business rules (Drools, ILOG), pr... |
Suppose we have a graph that represents a grid of cells. We are given a cell to start in and a cell that's the destination. There are cells that we cannot enter and they are known as walls. Finally we may only move to adjacent cells (diagonal movements are not allowed).
My question is how would one encode this problem ... |
Give an asymptotic upper bound for $$T(n) = \sqrt{n}·T(\sqrt{n})+n+n/\log n. $$
How can I solve this recurrence relation, which involves square roots?
|
A robot, let's say, Steve, is in the bottom left corner of a rectangular room, the size of which is unknown. His goal is to travel to the top left corner of the room and stop there. There are random walls present in the room. There always is a way to the corner.
Steve can do the following:
Move forward.
Turn left,... |
I need to sync data with WebDAV and other similar backend that do not have a concept of atomic operations. In some cases, I might need to read a file, change its content and write it back. And of course, I want to make sure that no other client read and write the same file in the meantime.
I'm wondering if there's any ... |
I'm designing a tree data structure to store strings in. One classic solution is prefix tree, but I am looking for a solution that the time to check if the string is in the storage is O(logm*logn) where m is the length of the string and n is the total number of character in Alphabet(if the string can be lower case alip... |
We know that singleton languages (languages containing exactly one word) are regular. We also know that a finite union of regular languages is also regular.
Suppose there is a non-regular language $L$. For every finite subset $\{x_1,x_2,\ldots,x_i\}$ of elements of $L$, we can take the corresponding singleton languages... |
I have to proof that in a word $w$ the number of the letter d is always even.
Let $L \subsetneq \Sigma^*$ be a language over the alphabet $\Sigma = \{a,b,c,d\}$
such that a word $w$ is in $L$ if and only if it is $a$ or $b$ or of the form $w = ducvd$ where $u$ and $v$ are word of $L$.
Examples:
$dacad$, $ddacbdcad$, $... |
I was wondering how one would go about proving a language is Not Regular without using the traditional pumping lemma contradiction.
$$L = \{ 1^k 0^n 1^n 0^k \mid k \geq 0, n \geq 0\}$$
I've seen a method before where you would Intersect this language with another one and show that the result is Not regular. But I'm lo... |
The following is the code to curry or uncurry a function in Haskell:
curry :: ((a, b) -> c) -> a -> b -> c
curry f a b = f (a, b)
uncurry :: (a -> b -> c) -> (a, b) -> c
uncurry f (a, b) = f a b
I can understand the type signature part but not the function definition. Would you please explain me how those function bo... |
I try to split the language
$$
L = \{a^ib^j \mid i \neq 2j, i \neq 3j\}
$$
into three languages
\begin{align}
L_1 &= \{a^ib^j \mid i < 2j\} \\
L_2 &= \{a^ib^j \mid 2j < i < 3j\} \\
L_3 &= \{a^ib^j \mid i > 3j\}
\end{align}
and then use one more production $S = S_1|S_2|S_3$,
but I have no idea how to find the CFG for $L... |
In the introduction to the colorfully-named Boxes Go Bananas: Encoding Higher-Order Abstract Syntax with Parametric Polymorphism, Washburn and Weirich describe a problem in traditional formulations of higher-order abstract syntax (HOAS):
One obstacle preventing the widespread use of this technique is the difficulty in... |
I am referring to regular expressions with alphabet {$0$, $1$}. We want to minimize them so that they have the least possible number of symbols and operators. Is there an algorithm to do this?
For instance, what is done on this page in the accepted answer:
https://stackoverflow.com/questions/35112630/minimize-specific-... |
From the wiki https://en.wikipedia.org/wiki/Paxos_(computer_science)
If a Proposer receives enough Promises from a Quorum of Acceptors, it needs to set a value v to its proposal. If any Acceptors had previously accepted any proposal, then they'll have sent their values to the Proposer, who now must set the value of it... |
Is there any good approach to devise a mapping of limited number of strings $N_1 << 2^{15}$ to integers less than $2^{15}$ without conflicts?
Strings are quite often of the form of prefix + postfix, where both prefix and postfix may repeat.
The mapping should be stable in a sense that if the mapping needs to be extende... |
What would you consider similarities between the difference engine and the Turing machine? At this point I feel I know how they both function, yet I can't point out any worthwhile similarities between the two. And how do these two relate to modern phones? Other than the first two being milestones of computational scien... |
I was doing my homework and I am confused on what I'm doing, it can't be that straightforward. I'm making a mistake somewhere. I tried looking for practice problems but they don't cover my issue either, I'm still confused. What will be the pictorial diagram for the following transition table?
|
Let $S$ be a sequence of $k$ many numbers. The position of the number in the $S$ matters. In the $S$ there are only $j$ many different numbers are there means $S$ contains many duplicates. Position is a query which needed to be answered, position(i) returns the element at position $i$ in $S$.
Trivial way to store them ... |
I have been trying to create a CFG for the set
$\{w=a^iba^j \mid i \neq j\}$.
To my understanding, there are essentially 2 scenarios, one where there are more $a$s on the left side of $b$, and one where there are more $a$s on the right side of $b$.
So far I have come up with:
\begin{align}
S &= TbR \mid RbT \\
T &= aT ... |
I am trying to get a CFG for the language:
The set $A$ of odd-length strings in $\{a,b\}^*$ whose first, middle and last symbols are all the same.
(some example of correct answers would be: a, aaa, ababa, aababba, some incorrect answers include: ɛ, aaaa, abbaa)
This is what I've done so far:
S = a|b|aTaTa|bTbTb
T = a... |
Write an algorithm that, given sequence seq of n numbers where 3 <= n <= 1000 and each number k in seq 1 <= k <= 200, finds maximum sum by repeatedly removing one number from seq, except for first and last number in seq, and adding its value to sum of two adjacent numbers. Algorithm ends when there are only two numbers... |
I am struggling to prove the following question.
$L_1 = \{a^n: n \text{ is a product of exactly two primes}\}$
I feel like the language is not regular but I am having trouble proving it. I tried using pumping lemma but got stuck at the end. Here's how I did it:
Assume that the language is regular and $m$ is a constan... |
I'm attempting a question related to Bloom filters:
Our Bloom filter uses $3$ different independent hash functions $H_1, H_2, H_3$ that each take any string as input and each return an index into a bit-array of length $n$. Each index is equally likely for each hash function.
To add a string into the set, feed it to ea... |
So I'm trying to simplify the Boolean expression (1) $A + \bar{A}\bar{B}$.
I noticed that by Karnaugh maps this is equivalent to $A+\bar{B}$, and I also noticed that if I take the complement of (1), I get ~(1)= $\bar{A}(A + B) = \bar{A}A + \bar{A}B = \bar{A}B$, so then taking complements again yields (1) = $A + \bar{B}... |
I'm interested in a better explanation about the paper Computing Optimal Assignments in Linear Time for Approximate Graph Matching.
The graph edit distance is approximated by assignments in linear time.
Briefly speaking there is an embedding of optimal assignment costs into a Manhattan metric: $φ_c(A) = [A_{uv}^← · w... |
I am trying to apply overlapping subproblems and dynamic programming to permutations.
Say, we have a set of $n$ elements in a string. Each of these elements could be a $1$ or a $0$.
Given some string, I am trying to count the number of valid permutations- where a valid arrangement is defined as an ordering with no $1$ ... |
I am not computer savvy, so forgive me for asking why companies that create native mobile apps are forced to make duplicate versions on other platforms. "Duplicate" means the "same", so it means those companies don't have to modify the original version of the native mobile app for other platforms. I am guessing "other ... |
I'm wokring on this problem for a while. I want to know:
The correct name of this problem, so I can look it up in textbooks\online.
Here is the problem descirption:
The (un-ordered) combinations to be generated are:
of 1 item size: {a1}, {a2} .... {c4}
of 2 items size: {a1, b1}, {a1, b2} ... {b2, c4}
of 3 items ... |
Given an interval graph that represents a set of tasks, in a given period of time, to be assigned to a set of employees, the objective is to find a minimum coloring of this graph such that the total duration of the tasks corresponding to each color does not exceed a constant $W$ and there exists, for each color, at lea... |
In the paper "An algorithm for optimal partitioning of data on an interval" (link) the authors describe an algorithm for partitioning data on an interval to maximize a fitness function. The fitness function they use is the sum of the fitness of each block in the partition.
My question is, how can this be done if the fi... |
Suppose we are given an array $A[1\ldots n]$ and a value $C$.
Is there an algorithm with linear expected runtime that can produce an array that is the subset with smallest cardinality of $A[1\ldots n]$ whose elements sum to at least $C$?
|
Let $L$ be the language over the alphabet $\{0, 1, 2, 3, (,), +, -, *, /\}$, $L$ is the set of operations with correctly formatted natural numbers. A single number is considered to belong to $L$.
2 - - 3 is an incorrect expression, 2 + 3 is correct, 2 + (-3) is correct.
Is it possible to write a regular expression for... |
The following question was asked on a quiz:
Let S be an NP-complete problem, and Q and R be two other problems (that we don't know much about). If we now know that Q is polynomial time reducible (i.e., can be reduced in polynomial time) to S, and S is polynomial-time reducible to R, which one of the following statemen... |
The burst time is needed for Shortest Job First (SJF) and Shortest Run Time First (SRTF) scheduling. To get the approximate burst time, we use the equation
$$\tau_{n + 1} = t_n + (1 - \alpha)\tau_n$$
I want to ask whether $\tau_{n + 1}$ is the predicted burst time of the $n + 1$ th process or it is the predicted burst ... |
I'm familiar with results of relativized separation for BPP-BQP, BQP-PH and NPC-BQP. I'm also aware that while e.g. Factoring is not believed to be in BPP, it hasn't been proven and so we're not quite near proving BQP!=BPP.
My question is, do we have any certain, theoretical, unrelativized proof that quantum computers ... |
The claim is as follows:
Let's say we have a $k$-regular simple undirected graph $G$ on $n$ vertices. Then, does $G$ then always have a $d$-factor for all $d$ satisfying $1 \le d \lt k$ and $dn$ being even.
I think its true, since we can construct a
$k+1$-regular graph from $G$ by adding $\frac{n}{2}$ edges for even $... |
I am looking for an algorithm to move a subarray in before an element (which is not part of that subarray) in the same array where the last element of the subarray is the last element of the array with O(1) extra space and O(n) runtime.
e.g. where *p1 = 5 and *p2 = 3:
1 2 5 6 7 3 4
becomes
1 2 3 4 5 6 7
This is what I ... |
Describe construction of finite automata that accepts the language
Double-Letter(L), where Double-Letter(L) is in the language of words
from L, except each letter in the word appears twice. So $abc\in L$
$\iff aabbcc \in $ Double-Letter($L$).
For example if L={a,aa,ab,ba} then Double-Letter(L) = {aa,aaaa,aabb,bbaa}
M... |
In a DAG and all weights are larger than 0. Is it possible to use a max heap to get the maximum cost?
|
I'm trying to draw a dfa for this description
The set of strings over {a, b, c} that do not contain the substring aa,
current issue i'm facing is how many states to start with, any help how to approach this problem?
|
I was wondering if you have 2 states, lets say q0 and q1. Are you allowed to have multiple options to transition between these 2 states?
For example,
- if you have a 1 and the stack is empty, push it on the stack, and transition to q1
- if you have a 0 and the stack is empty, push it on the stack, and transition to q... |
Say we have two circular binary strings $a = a_0a_1...a_{n-1}$ and $b = b_0b_1...b_{n-1}$ with arbitary starting point, and define a and b are orthogonal if $\sum_{i=0}^{n-1}a_ib_i = 0$.
Is there a $O(nlogn)$ algorithm can tell a rotation of such circular binary string is orthogonal to another?
|
I am trying to construct a 3-state PDA to recognise (I need to create a transition diagram for this question)
W = {w ∈ {a, b}^* | w contains at least as many as as bs}
My thought process so far has been this:
1. Start off in q0 (q0 being an accept state)
2. add a $ to the start of the stack (so you can see when the ... |
I am given a set of 3D boxes {$B_1$, $B_2$...$B_n$} and each box have length, width and height. But these values are interchangeable since I can rotate the box. I need to find out the maximum sequence of nested boxes.
I have tried this problem using sort. But I still get stuck. I used built in sort function to sort all... |
Most reading I found about virtual memory, such as http://www.linux-tutorial.info/modules.php?name=MContent&pageid=89 or https://en.wikipedia.org/wiki/Virtual_memory always state that virtual memory is a concept that allows operating system to make it "appear as though you have more memory than you really do".
But isn'... |
I am having a hard time proving the following with pumping lemma:
Is $L_2 = \{a^n \mid \text{$n$ is a product of one or more primes}\}$ regular?
Here's what I have so far:
Suppose $L$ is regular, and let $m$ be the constant pumping lemma.
Let then $w = a^m$ where $m$ is a product of at least one prime number, therefor... |
There are $n$ cities in the country. The car can go from any city $u$ to city $v$, On this road it spends $w_{u,v} > 0$ fuel. At the same $w_{u,v}$ can differ from $w_{v, u}$. The task is to find the minimal tank capacity to be able to travel from any city to any other (possibly with refuels) in $O(n^2\log n)$.
|
In the book "This Will Make You Smarter: 150 New Scientific Concepts to Improve Your Thinking", Rudy Rucker, a computer scientist, state:
A little-known truth: Every aspect of the world is fundamentally unpredictable. Computer scientists have long since proved this.
How so? To predict an event is to know a shortcut ... |
This is a wildcard matching problem. Given a pattern P containing letters and character * that can match an arbitrary string of characters (including an empty string), my task is to write a polynomial-time algorithm to determine whether such a pattern P occurs in a given text T. So here is my answer for the problem.
W... |
Let M be an $\epsilon$-NFA and let $S\subseteq Q$. Prove $\epsilon (S)= \epsilon (\epsilon (S))$.
I would like to prove this by contradiction but I don't know if my idea is correct.
Definition of $\epsilon -closure$:
$\epsilon : 2^Q \rightarrow 2^Q $
a) $S \subseteq \epsilon (S)$ Base case
b) If $q \in \epsilon (S... |
I am new to Programming and learning Algorithms and was studying BFS when I read that BFS could be used for cycle detection. I tried to implement the same on an undirected graph G with Adjacency List Representation.
What I did is as follows:
• Do a simple BFS Traversal using a Queue while maintaining the parent node o... |
Is the problem of deciding whether a SAT instance, where at most one clause is false (that is, any given variable assignment will either lead to all clauses being true, or all but one), is satisfiable solvable in polynomial time?
|
I'm sure that in my following question my reasoning is extremely simplistic and flawed, but I think if someone answered this it would help me understand what the P vs NP conundrum is. So here is my question: why is the following not a proof that NP does not equal P?
Scenario: A computer is given an n digit number that ... |
We are given a and b <= 1e8.
The extended Euclid's algorithm always finds a solution for ax+by=gcd(a,b) (assuming it exists) which can always be stored in an Int.
How to prove the x and y won't overflow an Int?
code: https://cp-algorithms.com/algebra/extended-euclid-algorithm.html
|
I am close to solving question 3.59 from Computer Systems: A Programmer's Perspective 3rd Editionby Randal E. Bryant and David R. O'Hallaron, however I am having difficulties with understanding the result.
Question 3.59 asks you to examine a sample of C and x86_64 assembly code that performs a full, signed multiplicati... |
I have the following question about complexity time classes. Given the language $L = \{0,1\}^*$, is it inside the class P or not?
$$ L = \{0,1\}^∗ ∈ P? $$
|
Can anybody help me out with this? If I try to compare $a$'s with $b$'s to check if $j\ge i$ then I won't be able to compare the same number of $b$'s with the number of $c$'s that is to check if $j\le 2k$.
|
For a given sequence 1, N ,2 ,N −1 ,3, N −2, ... I want to calculate the number of comparisons and swaps for bubble sort. How can I accomplish that using $\theta ()$ notation? I would know how to do it for any sequence, but not for a given one.
|
My understanding of a regular language is that for a language to be formal, it must be able to be represented by a DFA or NFA. To prove a language is not regular you can use the pumping lemma to get a contradiction.
I am trying to figure out whether $R^3$ or $R \circ R \circ R$ is regular if R is also regular.
My under... |
Let $R=(a*)+(b*)$ be a regular expression. Prove that there cannot exist any DFA $M=(Q,\Sigma,\delta , q0, A)$ such that $|Q| = 3$ and $L(M)=L(R)$.
The problem is, I think IT IS possible to construct such a dfa that has 3 states in total.
Am I missing something?
|
Does anybody knows that how we can assign number to nodes for binomial tree . I mean how we can represent the number of nodes by array? please give me hint I am really confused .
|
In exercise 1.1.9 of volume 1 of The Art of Computer Programming, the reader is asked to
formulate a set-theoretic definition for the concept "$C_2$ is a representation of $C_1$"
where $C_1$ and $C_2$ are computational methods described in the previous few pages (reproduced here so the question can be answered withou... |
Consider a simple chess example:
Q is white Queen.
K, R is black King and black Rook respectively.
A B
1 . Q
2 . .
3 K .
4 . .
5 . .
6 R .
7 . .
8 . R
1,2...8 is the rank and A and B are the files of the chessboard.
Assume the king can only move horizontally for this example.
Here, if we search to depth 0, the best ... |
How do we get the rounding of $2-10^{20}$ in IEEE double precision? The textbook says it is $-10^{20}$, but I do not know why. I think my textbook only explains the rule for rounding mantissa.
|
I have a nested graph filtration and each step I have to find the shortest path between two nodes. At each step I just add one edge to the graph so the re-computation of the Dijkstra algorithm is extremely redundant. Is there any algorithm to circumvent this?
|
While gravity in real life is continuous, computers are limited to discrete calculations.
Therefore, a seemingly correct projectile simulation inevitably drifts off.
For example:
// Repeat once per frame
position += velocity * deltaTime;
velocity += gravity * deltaTime;
Graphed, compared to the actual projectile formu... |
Frequently, on a 32-bit CPU, each page-table entry is 4 bytes long, but that
size can vary as well.
A 32-bit entry can point to one of $2^{32}$ physical page frames.
If frame size is 4 KB (212), then a system with 4-byte entries can address $2^{44}$ bytes
(or 16 TB) of physical memory.
The above statement is taken from... |
Given that L is a regular language. How do I show that cut(L) = {ac | abc ∈ L and |a| = |b| = |c|} is not necessarily regular?
My thought process is that this problem can be re-written as:
cut(L) = {aⁿcⁿ | aⁿbⁿcⁿ ∈ L where n ≥ 0}
I can then convert this to aᵖbᵖcᵖ, and have y consist entirely of 'a's as |xy| ≤ p
I can t... |
How do I construct a perfect BST from an unbalanced BST with $n$ elements (assuming that $n=2^i-1$, $i$ is natural). ** At the worst case of $O(n)$**.
|
I have two images of IRON RODS (i.e only two images) and I want to detect how many rods are there in each image and get the diameter of each rod in a image?
I don't know where to start as there are lot of articles regarding object detection and it's hard to find one for my use-case.
If you can help me with a abstract v... |
In the SCP, condition 2 of the accept definition allows a node to vote for one statement and later accept a contradictory one. Condition 2 assumes the existence of a v-blocking set which has not only voted for a but also accepted it. What is the argument to show that this is the case?
|
Having just read through Lamport's paper, I was hoping someone could clarify a few things on the Oral and Signed message algorithms.
Why do we have to run $OM()$, recursively by $m$? If a majority of the Lieutenants are loyal, do they not get the correct value by the first round of exchange?
I'm not exactly clear on s... |
The Question of the CLRS $6.1-7$ exercise reads as:
Show that, with the array representation for sorting an n-element heap, the leaves are the nodes indexed by $\lfloor n / 2 \rfloor + 1, \lfloor n / 2 \rfloor + 2, \ldots, n⌊n/2⌋+1,⌊n/2⌋+2,…,n$.
I looked for the solution here:
https://walkccc.github.io/CLRS/Chap06/... |
This problem has confused me a lot, can any of you help me out.
Thank you.
|
Given a finite set $\Omega$, I have the following problem. Say there is a list of forbidden subsequences $F \subset \Omega \cup \Omega^2 \cup \Omega^3 \dots \Omega^\infty$, while we do not know the contents of list before hand, we can make a query about any sequence $S \in \Omega^i$ to see if $\exists f \in F, f \subse... |
I really need some help with this problem. I'm running into the issue that the input is running out of space to append the 11 or 10. I could really use some help conceptualizing this problem and how to think about Turing machines in general.
Change the original input with a 1 into 11 and 0 into 10. You must also appen... |
Continuing Is every PSPACE-complete problem complete with respect to logspace reductions? : earlier, PSPACE-completeness was defined via logspace reductions (e.g., cf. http://www.cs.cornell.edu/~kozen/Papers/LowerBounds.pdf), whereas it is defined via ptime reductions nowadays (e.g., cf. https://en.wikipedia.org/wiki/P... |
Going through Lamport's paper, I'm a little confused by the second part of the regular set of neighbors definition.
A set of nodes $\{i_1, \ldots, i_p\}$ is said to be a regular set of neighbors of a node if :
each $i_j$ is a neighbor of $i$, and
for any general $k$ different from $i$, there exist paths $y_j,_k... |
I need to find which lossy image compression technique is the best. I chose to test JPEG, WebP and BPG. Which criteria can I choose for comparison apart from quality and speed of compression and how can I measure each criteria using tools like PSNR?
|
I'm stuck on a point while reading about these different accessing methods. As per author.
Sequential access
Memory is organized into units of data, called records.Access must be made in a specific linear sequence.
I understand that it will take variable time to access due to sequential ordering.
Direct Access
indi... |
There are $N$ workers and $2N$ jobs, named from $J_1$ to $J_{2N}$. There's a matrix $M$ denoting the subset of jobs can be handled by each worker: If $M_{i, j}$ is true, then worker $i$ can do job $j$.
Our task is to assign exact 2 jobs for each worker, s.t., each job is handled by exact one worker with respect to $M$.... |
Given a collection C of sets, with union U, find a choice function which chooses a distinct element from each of the sets such that the union of the singleton distinct elements is U.
As an example, if we have the collection {1,2,3,4},{0,2,3,4},{0,1,3,4},{0,1,2,4} and {0,1,2,3} we can choose 1,0,3,4,2 from each of the s... |
I'm trying to grok the pseudo-code for the gas station problem (which I think we should start calling the charging station problem but that's a different story) given as Fill-Row in Fig. 1 in To Fill or not to Fill: The Gas Station Problem. The algorithm is reproduced below for ease of reference:
There are some obviou... |
$L=\{a^ib^i|i\geq0\}$, cfg for $L^2$
can you write cfg for $L^2$ where $L=\{a^ib^i|i\geq0\}$?
the professor's answer sheet says it's $S\to AA\\ A\to aAb|\lambda$
but I think it is wrong because two $L$ have to be identical with each other.
can you help me figure out if there is cfg describing $L^2$?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.