instruction stringlengths 35 29.1k |
|---|
When it comes to defining the memory address structure given the RAM size, cache size, and other parameters such as the cache block size..., we can have the following generalization:
$$Address = TAG|Index|offset$$
We then have: $size(offset) = log_2(word \ count \ per \ block)$
For the index, we will have: $$size(index... |
Is there a reduction between a decidable language $L$ and $\Sigma^*$?
|
Let $L \in RE$. Then $L$ might be finite or infinite.
I assume this is also true for $coRE$.
But, if I have a language $L \notin RE$, it necessarily means that $L$ is infinite, am I correct?
Also, if $L \notin coRE$ then $L$ is infinite, right?
Thanks a lot!
|
Let $p_1,p_2 \dots p_n$ be $n$ points in 2D such that $p_i= ( x_i,y_i) $
Let $d(p_i,p_j)= \max (|x_i-x_j|,|y_i-y_j|)$, or better known as Chebyshev distance.
Find a point $p_i$ such that the distance to it's kth closest point is minimal among all $i$ in $\mathcal{O} ( n\log ^2 n) $.
Edit: $ 1 \le k \le n$
I tried calcu... |
Complexity class P/poly includes languages, which cannot be calculated by means of classic Turing machine, including unary halting problem
However, class NP is relatively simple, can be calculated via Turing machine and is placed on lowest level in polynomial hierarhy
So every NP-complete problem, which can be represen... |
I think anyone would agree that assembly languages ("threshold languages") have some very little abstraction but is it true to say that also machine languages have some degree of abstraction?
|
This is a problem from my Algorithms course in uni
There are $n$ students, each have a single book. They come into a party to exchange books among themselves. Each have a list of students that have the book that they want.
Give and prove an algorithm that says if a switch of books is possible, i.e. every student got th... |
I have a practical programming problem that I am struggling to find an optimal algorithm for, in part because I don't know what to call it. The problem concerns vectored I/O (scatter/gather).
Consider a server s and a set of connected clients C. The server maintains a contiguous array B of variable-length blocks of dat... |
Suppose you have three modules $m_1,m_2$ and $m_3$, each with a capacity of $c_i$ and area $a_i$. You are also given $A$ and $C$. How can you find some of the solutions to choose an amount of each module so that the sum of areas is exactly $A$ and the sum of the capacities is exactly $C$? All variables including the am... |
Given an adjacency matrix or other data based on the nodes, there are many algorithms for determining whether the graph is acyclic (e.g. row reduction or leaf trimming).
If I have only a set of edges (e.g. ${(a,b), (b,c), (d,b)}$), I could obviously convert that into an adjacency matrix and proceed from there.
I'm wond... |
Define a graph problem as follows. Given a graph $G$ and
two integers $c$ and $k$, delete $k$ nodes and all edges incident to them, such
that, in the remaining graph, every connected component has at most $c$
nodes.
What can I say about the time complexity class of the above problem? I can easily prove that under the c... |
I'm trying to break down the Time complexity algorithm for IDDFS. Acknowledging that in general my understanding of maths is not that great. So I will be trying to talk things out.
For BFS it is intuitive to me that we take the exponent of each level of depth since we are expanding all nodes.
For IDDFS, the equation t... |
Assume $$C_1 = (x_1 \lor x_2 \lor \lnot x_3)\hspace{0.2cm} C_2 = (x_4 \lor x_5 \lor x_3) \hspace{0.2cm} C_3 = (x_3 \lor x_5 \lor x_6)$$ Let
$$ \phi_1 = C_1 \land C_2 \land C_3$$ and
$$ \phi_2 = (x_1 \lor x_2 \lor x_4 \lor x_5) \land (x_3 \lor x_5 \lor x_6)$$
Question
Are the two formulas $\phi_1, \phi_2$ equisatisfiabl... |
Say that I am given a graph $H$ and a graph $G$ where the maximum degree of $G$ is known. How can I use BFS to find out if $H$ is an induced subgraph of $G$ in $O(n)$ time?
My current take is the following:
Run BFS on $H$ and take note of the layer depth.
Assume I have a function $g(x)$: $H_{nodes}$ -> $G_{nodes}$, wh... |
Given a finite set of integers $Z$ and a number $z$, I would like to check if there exists a subset $A=\left\{ a_1,...,a_{\left| A\right|}\right\}\subseteq{Z}$ and a set of $\left| A\right|$ numbers $k_1,...,k_{\left| A\right|}$ such that:
$$ \sum_i k_i \cdot a_i = z$$
It is a generalization of regular subset, and seem... |
Given two sets of values $a_1, a_2, ... a_n$ and $b_1, b_2, ... b_n $ what would be a good way to shuffle them together while keeping $a_i$ and $b_i$ at least $gap$ spots apart?
For example, if we have A B C and a b c, then b A C a B c is a valid 2-gap shuffle, but not a valid 3-gap shuffle (because of the a's placemen... |
I've been reading the following paper (open) by Fraenkel and Lichtenstein that shows that the Generalized $n \times n$ Chess problem ($\texttt{CHESS}$) is $\texttt{EXPTIME-complete}$. They start by proving that $\texttt{CHESS}$ is in $\texttt{EXPTIME}$, but I don't understand at all the fragment highlighted in pink (th... |
I'm really confused when it comes to what the difference between bias and threshold is. I have read that they are basically the same thing and that they serve the same purpose. Being on opposite sides of the equation, though, they are "negatively proportional".
The equation for the separator for a single-layer percept... |
as the title says
Can we solve a decision problem with two identical answers like $false\equiv(\lambda f.\lambda y.y)$ or $0\equiv(\lambda f.\lambda n.n)$?
if no why? and if yes then why can't we decide whether a lambda term is in normal form or not?
thanks
|
Someone suggested to me that the halting problem could be solved by a lambda calculus "program", which reduces to $\lambda y.y$ if an input program halts and $\lambda n.n$ if it does not. Therefore it is not possible to extend this into a program that halts if it thinks it doesn't halt. (That's just background, not the... |
I don't get why SCAN is used when LOOK exists. Why move to the end, when there are no longer any pending requests in that direction?
SCAN: In SCAN algorithm the disk arm moves into a particular direction and services the requests coming in its path and after reaching the end of disk, it reverses its direction and agai... |
How decidability/semi-decidability/undecidability has impact on REAL life applications/examples? I understand that it can be used for implementation of various algorithms but what else?
|
In Harvard CS 221 Computational Complexity, Lecture 3, it introduced Branching Programs
A branching program is a DAG that
has 1 start node and 2 output nodes with out-degree 0, labelled 0 and 1. Each non-output
node is labeled with one of x1, x2, . . . , xn and each node has 2 outgoing edges labeled 0 and 1
For examp... |
Is there a way where sort turns a non regular language into a regular one.
What I mean by sort is this:
Consider the language $L =$ { $bac, cbca, acbb$}. $sort(L) = $ {$abc, abcc, abbc$} respectively.
If there is, do you have an example. If not can you provide a proof if you can.
|
The start state cannot have any "in edge" (an arrow point directly to the start state) and only out edge is possible for the start state. Other states except the start state are free of limit in DFA (deterministic finite automaton).
I have doubt between two awnsers which are:
It depends on the language and is not poss... |
The following approximation algorithm for the Minimal Dominating Set Problem is said by a fellow student to be a 1.5-approximation:
Start with empty set $S$
As long as not all vertices are covered:
Add a vertex that is not in $S$
with the most uncovered neighbors including itself.
Mark it and all its neighbors as cov... |
Here is the problem statement. Let $E_1,...,E_n$ be a set of $n$ exercises, each taking 1 day to solve, and suppose we have $n$ days available to solve the exercises. Each exercise $E_i$ has a deadline $D[i]$ associated to it, which is an integer in the range $0...n - 1$. Each exercise $E_i$ must either be solved on a ... |
Here is the problem. Suppose you have to drive from Eindhoven to the south of France. Your start and destination are fixed and the route is fixed as well. You start with a full petrol tank, but since the distance is quite long you will need to fill up your tank several times. There are $n$ petrol stations along the way... |
I am learning about Turing machines. I understand the alphabet set of symbols and the states a machine can be in. However, I do not understand how the transition function works.
I come from a maths background and functions always follow a simple input output. The table of transtions seems out of place.
How does a compu... |
In the Chomsky hierarchy what is corresponding to a contracting grammar?
I can find references to non-contracting grammars (which can be transformed into context-sensitive grammars accordingly to what Wikipedia is saying: https://en.wikipedia.org/wiki/Noncontracting_grammar), but I don't know what would correspond to a... |
excuse me, could someone explain to me the reduction of the problem 3-dimensional matching to subset sum? I was reading Jon Kleinberg's design algorithms book and when I came across this reduction I didn't understand how it really works:
"So consider an instance of 3-Dimensional Matching specified by sets $X,Y,Z$, eac... |
Is it correct to assume that if the input that I hash is sensitive, that I should also consider the locality-sensitive hash generated for that input to be sensitive? I presume that, if an attacker has access to all the hashes and a couple known plaintexts, then they could likely use those to make a cryptanalysis attack... |
We know that finding the size of the maximal independent set of a planar graph is NP-complete. I'm curious about whether it remains NP-complete for maximal planar graphs, i.e., the graphs in which adding any edge will destroy its planarity, or equivalently, all edges of whose faces are bounded by three edges.
I've aske... |
The below text is taken from the book : Operating Systems: Internals and Design Principles by William Stallings, 8th edition, page 68.
Scheduling and Resource Management
A key responsibility of the OS is to manage the various resources
available to it (main memory space, I/O devices, processors) and to
schedule their ... |
How do you calculate the amount of iterations the following loop will have in terms of n?:
for (i = 1; i < n^3; i += n) {
}
I've gotten as far as: $$i=(x-1)n+1\ for\ current\ iteration=x$$ $$Total\ iterations=x\ when\ n(x-1)+1\geq n^3>n(x-2)+1$$
|
few weeks ago I had an exam in automata theory course and I've been asked to write the following non-deterministic finite automata
Write a NFA which accepts the following language - the language contains all the words (above {a, b, c}) with at least 1 appearance of the letter c, or the parity of the count of the lette... |
Consider Merge-sort algorithm that we modify as follow:
Suppose we extend it to divide the input array into $m$ not necessary equal and after sorting each of them, merge them. Now can we conclude that the running time will be $O(n\log n)$?
I think the running time should be $O(n^2)$ as follow:
If the algorithm divide t... |
If a function f has a while loop or for loop, can I compile this function into an acyclic boolean circuit that ensures that each gate is topologically ordered, i.e. there is no feedback? If so, how exactly is that done, by loop expansion? And if compiling the function as a cyclic boolean circuit is allowed, does it sim... |
Problem is "Constructing a DFA accepting set of all strings whose 10th symbol from the right end is $1$ over $\{0,1\}$"
The NFA is easy
$$(0+1)^*1(0+1)^9$$
but DFA has to have minimum $2^{10}$ states.
I've tried to see the pattern by constructing 2nd and 3rd symbol from the right.
I mean, when it is the 2nd from the ri... |
In many academic papers algorithms are described. They seem to use similar "syntax".
Is there a standard for this language? If I want to describe an algorithm, would I improvise my description?
For example, note that papers in general use
a <-- b
to assign a, not a = b. But where is that standard?
|
Is there an algorithm to multiply two polynomials with coefficients in the max-plus semiring $(\mathbb{Z}\cup\{-\infty\}, \max, +)$ which is faster than the trivial one? I'm interested in the coefficients of the product, so I can't ignore the differences between two polynomials which specify the same function. This mak... |
So the problem is: There is a group of n people that want to meet each other and everyone is divided into pairs, so everyone has a partner that they know. Now there will be parties at which they can get to know each other. At every party there can be as many round tables as needed, at which people can sit. When they si... |
Given the following code:
void aux(int n){
while (n > 0) {
printf("%d", n);
n--;
}
}
long f1(int n)
{
long sum = 0;
for (int i = 1; i * i <= n; i++) {
for (int j = 1; j <= i; j++) {
aux(i * j);
sum += i * j;
}
}
return sum;
}
I have calculated the time complexity of aux and I fou... |
I have several lines that are shown in different colours, do not know which are connected to each other in advance. I want to do path planning only using these lines, i.e., route planning. If I am able to construct a graph using these line segments, I can use graph search techniques, e.g., A*, to find the path between... |
From this link Does $NP^{NP}=NP$?
I learned that if $NP^{NP} = NP$, then the polynomial hierarchy collapses to it's first level.
But how to prove it?
|
I had an assignment in which I had to design a pushdown automata that recognizes the language ${w \in [a,b,c]^*|w }$ have the same number of "ab" and "ba".
Tried to make a pushdown automata that if reads first ab pushes 1 to the stack and then if finds "ba" then pops it (and again reads "ab" and then "ba" , push / pop ... |
This seems like it should be a "textbook"/standard problem but I wasn't able to find anything about it, so I'd like to know if anyone else has seen something like it before or can suggest more keywords I could search for / perspectives I could view it from:
Informal problem statement
Informally, the situation is that w... |
Given a multivariate polynomial of degree 4 on $v$ (real) variables such that there are $N$ terms in the polynomial. Is there an efficient algorithm to verify if it has a solution?
Not aware of any algorithm for this problem. Can someone please comment.
I think the solution itself can be calculated by Newton Raphson al... |
I want to generate a set of X int numbers, were 4 <= X <= 100, both positive and negative that add up to target value.
The numbers are between -6 and 4 and there needs to be at least 2 negative numbers, and up to half of the numbers can be negative.
I have seen posts about this being done for all positive numbers but I... |
I have found multiple definitions of what a heuristic is, and I have found multiple computer science-related definitions.
In my university course, the lectures cite the Nielson Norman Group defining a heuristic as an area of measurement. On Wikipedia, a heuristic is defined as a problem-solving technique. These definit... |
Like this person on Google Groups, I'm trying to understand how to write a grammar involving Wolfram Language's low-precedence unary & operator.
The operator works like this:
g[#, #^2] & /@ {x, y, z}
The g[#, #^2] & part builds an anonymous function # -> g[#, #^2], and then /@ maps it over the list {x, y, z}.
However,... |
I am trying to research handling a specific type of possible subgraph in directed acyclic graphs.
However, I am struggling to find the correct term to use.
If we consider the subgraph S to be in a DAG G. Where S is made up of 2 paths, starting at a common node and ending at a common node. Thus forming a "diamond" shape... |
Placed exactly the code and the explanation of the book : Introduction to Algorithms Third Edition
In order to move subtrees around within the binary search tree, we
define a subroutine TRANSPLANT, which replaces one subtree as a child
of its parent with another subtree. When TRANSPLANT replaces the
subtree rooted at ... |
I have a homework assignment that requires me to create CFG $G$ for
$$L = \{a^i b^{i+j+k} c^j d^k\}$$
so that it can accept words like ab, aaabbbbd, abbbcd, but it should not accept abba, aabbbbbc, or abc since the number of b must be the number of a+c+d.
I need CFG of L(G)
I tried using chatgpt but the answers are no... |
I'm learning about strict functions in Haskell.
A function f is strict if f ⊥ = ⊥
Some functions are strict only in the first argument (for e.g. const), others are strict in the second (for e.g. map).
I'm trying to think of a function which is strict in only both arguments at the same time, so
f x ⊥ is not bottom
f ⊥ ... |
Consider the following nonrigorous argument that $P \neq NP$ implies $avgP \neq distNP$. (For those unfamiliar with the latter complexity classes, they deal with average case hardness.)
Suppose A is the algorithm that solves some NP complete problem (say 3-SAT) with the fastest average case complexity possible and supp... |
Consider
$$\begin{align} T(n^3)&=T((n-1)^3)+n\\
T(1)&=1
\end{align}$$
According to the substitution method, $T(n^3)=O(n^2)$ (please if I wrong, correct me). Now, what is the answer of $T(n)$? I think $T(n)=O(1)$ but the answer of my teacher is $T(n)=O(n^\frac{2}{3})$.
|
The problem $⊕2SAT$ is defined as a problem where we need to find the parity of the number of solutions of $2$-$CNF$ formulae and is known to be $\oplus P$ complete.
I introduce the following variant of $⊕2SAT$:
In this variant we put the restriction on the input of the $⊕2SAT$ problem the restriction is that every in... |
It is my understanding, based on this question that problems solved on quantum computers with oracles don’t make any statements about BQP in relation to other complexity classes.
The fallacy is in the construction of the algorithm. It uses an oracle. That oracle computes something using the function in a very specific... |
I am told that if a decision problem that is in NP Complete can be solved in polynomial time, then P=NP. However, would this mean that we would instantly have an algorithm to solve any NP problem. Like if someone solved the traveling salesman problem, would that mean that we would instantly have an algorithm to factor ... |
This is like a follow up question from my previous post about complexity of $positive -⊕2SAT$.
The problem positive $⊕2SAT$ is defined as a problem where we need to find the parity of the number of solutions of positive $2$-$CNF$ formulae and is known to be $\oplus P$ complete.
I introduce the following variant of $⊕2S... |
The famous PPAD class revolves around the End-Of-The-Line problem. Basically, it states that you are given two polynomial depth circuits, $P$ and $Q$, which act as "possible previous" and "possible next" functions, each with an exponentially sized domain. And the task is to find an input that satisfies $P(Q(x)) \neq Q(... |
Suppose we have $n$ intervals given in the form of (startTime,EndTime). I wish to calculate maximum length of the region that is exactly union of $1<=k<=n$ intervals.
Note that there are 2 cases for which I am trying to find an algorithm individually
Union of selected intervals might not be a single interval
Union of ... |
Many problems in computer science input boolean circuits to problems.
Just as a toy example, let's define the below problem to be called $A$:
Given a polynomial depth circuit with $N$ bits of output, C, does there exist an input $x$ such that $C(x) = 0$?
Is it correct to say that an equivalent problem, on a quantum c... |
I want to reversibly transcode arbitrary information (a digital signature), initially $n$ bits, into symbols in an alphabet with $s$ symbols, with little space loss. In my application‡ $s=45$. Thus I can e.g. transcode $n=192$ bits into $m=\lceil n/\log_2s\rceil=\lceil34.961\ldots\rceil=35$ symbols with less than $0.12... |
I need an algorithm that can do facial recognition in a video based on a training set. For any faces detected, it should give an output as how much the face matches with the faces in the training set. How can this be done ?
|
I am trying to solve the Longest Increasing Subsequence(LIS) Problem using different OPT Function than the one which normally used. I have been given this question as an extra credit and I have been trying to wrap my head around the different OPT Functions and the recurrence relation possible. The solutions I found alw... |
I know the basics about base64 encoding, but thinking about it abstractly I have a theoretical question.
If we consider base64 a mathematical function(in our case computable), Does there exists an invariant for base64-encoding function ? It only make sense or to narrow down the scope of the question I assume input bina... |
I am currently learning about NP and coNP related content and have been exposed to the$NP \overset{\text{?}}{=}coNP$ problem.
I would like to know what are the directions to work on if I want to prove that $NP=coNP$? For example, currently I know that if I can prove that a coNP-complete language belongs to NP, then I c... |
I have so show that, for the normal 9x9 sudoku, determining whether there is a solution is just as hard as computing a solution if it exists. I should do that by assuming i have a polynomial-time algorithm for checking whether a given sudoku is solvable and i then should explain how to obtain a polynomial-time algorith... |
We defined a polynomial-time verifier so that it has certificates of length AT MOST p(|x|) for some fixed polynomial p.
Why does it not make a difference to require a certificate $c$ to have EXACLTY length p(|x|)?
|
I need to build an enumerator for $$L=\{0^{3^n}| n\ge 0\}, \Sigma = \{0\}, \Gamma = \{0, x, \sqcup\}$$ that has at most 10 states, including print and halt states. I can ignore the halt state and any edge that leads towards it.
I tried to approach this in the simplest way i could think of, build a Turing machine that d... |
The definition of PPAD (Polynomial parity arguments on directed graphs) revolves around the definition of "End-Of-The-Line"
An exponentially large polynomial-depth arithmetic circuit, $f$, specifies a graph where every node has an in-degree and out-degree of at most $1$. Given that $0$'s in-degree doesn't match it's o... |
Grover's algorithm assumes $U_f$ computing a function $f$ as an oracle input. But in practice, an oracle isn't given. Instead a circuit computing $f$ is given. So let's assume a reversible circuit, $C \colon \{0, 1\}^{N + 1} \mapsto \{0, 1\}^{N+1}$ that computes $C(x, y) = (x, y \oplus f(x))$, where $f \colon \{0, 1\}^... |
Let $L$ be the language of infinite words in $\{0,1\}^\omega$ such that any finite prefix of a word in $L$ has at least as many $0$'s as $1$'s. Is $L$ büchi recognisable?
I think that $L$ is not $\omega$ regular, but standard tricks such as complementation or intersecting with some other language don't seem to work.
|
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program that is made up of many files. There are some files you could delete, and, while it might be crippled, the program could still run. We're assuming each file is independent from the others, so behind the scen... |
I am trying to figure out the solution to this problem:
In this problem we consider two stacks $A$ and $B$ manipulated using the
following operations ($n$ denotes the size of $A$ and $m$ the size of $B$):
PushA($x$): Push element $x$ on stack $A$.
PushB($x$): Push element $x$ on stack $B$.
MultiPopA($k$): Pop $\m... |
I know the answer if it was OR would be (1*01*01*)* U 0*10*10*, but with the AND I have no clue how this can be achieved. There are lot's concatenations that I can't cover by getting the regular expression.
|
I've tried to expand the recursion:
$$T(n) = T(n^{\frac{1}{2}}) + 5n = T(n^{\frac{1}{4}}) + 5(n^{\frac{1}{2}} + n) = T(n^{\frac{1}{8}}) + 5(n^{\frac{1}{4}} + n^{\frac{1}{2}} + n)$$
We have a total of $\lfloor\log_2(n)\rfloor + 1$ elements in the recursion. So we can easily find an upper bound:
$$T(n) = O(n\cdot \log_2(... |
Is it true or false that $n^{n} \in \mathcal{O}(n!)$ ?
Any suggestions how to prove/disprove this statement?
|
I am trying to come up with an algorithm to find the minimal representation of the transformation from a zero matrix to a target matrix.
Specifically, I have an empty matrix and can perform operations such as set(x1,y1,x2,y2) and unset(x1,y1,x2,y2) to edit submatrices.
I looked at some greedy algorithms and quadtree da... |
Consider this situation. A few clients are connected to a server over the internet.
I define network latency as the time between request leaving the client and reaching the server.
What distributions (i.e. gaussian, uniform, exponential) do network latencies typically follow?
|
I am working on a Genetic (or rather Memetic) Algorithm for optimizing a scheduling problem.
I have n orders to schedule and the solution representation is an array of n integers that specify when an order takes place.
Mutation probabilities are typically given as that, probabilities. This however leads to weird (?) be... |
I'm trying to find a problem description that is roughly akin to a budgeted min-cost max-weight bipartite matching where the capacities are greater than 1. Imagine a max-flow problem on a graph that looks like this:
Each node on the left is connected to a set of nodes on the right, but the nodes in that set on the rig... |
I am trying to detect forbidden moves for black in a game called Renju. First, here is an explanation of how Renju works.
Renju is a board game played on a 15x15 Go board. There are two players in the game, which we will call black and white, and they place stones of their color on the board turn by turn. Black starts ... |
I don't know if a solution to this problem is too complicated to figure out, but I've been banging my head on it for a couple weeks, so I'm hoping for an outside point of view.
I have a list of 88 files today from different sources:
Alpha sent 9 files.
Beta sent 7 files.
Gamma sent 19 files.
Delta sent 13 files.
Epsilo... |
I learned years ago that $IP \subseteq PSPACE$ since you could simulate all sets of messages and then determine the probability of success. But lately I’ve been looking at the standard proof of this and I'm having trouble with it.
Basically, I don't understand how we can apply this proof to zero-knowledge settings. For... |
Consider these 2 questions where recurrence relations can be applied:
Q1) Given an (nxm) where n denotes rows and m denotes columns of a grid, find the number of unique paths ($a_{n,m}$) that goes from the top left corner of the grid to the bottom right corner of the (nxm) grid. Rule: Can only move downwards or rightwa... |
This is usually shown by an application of the Statistical No Free Lunch Theorem.
But is this possible to show this by working simply with the definition of PAC learnability and the sample complexity VC bound.
In particular if it's PAC learnable we know that for any $\epsilon$ and $\delta$ we have a sample complexity V... |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT ($4 \leq k \leq 8$) operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empiricall... |
For example, using GHCi,
ghci> f x = x + 1
ghci> :t f
f :: Num a => a -> a
What is the type of the type signature f :: Num a => a -> a?
Motivation
I first encountered this question at work. Since I do not want to leak any information pertaining to my employment, I shall present a toy project instead.
Suppose that I h... |
Question is to construct a regex where all strings containing an even number of 0's:
By constructing DFA graphically, it is
$$(1^*+01^*0)^* $$
But it is also
$$1^*(01^*01^*)^*$$
Can we prove that they are equal algebraically?
|
Given a graph $G$, how can we generate all possible color vectors that could be generated via greedy coloring?
N.B. Greedy coloring takes a graph and an order of vertices. It traverses vertices following that order and, while visiting a vertex $v$, puts the minimum color absent in all neighbors of $v$.
If $G$ has $n$ v... |
Have seen library code for finding square-root, using the Newton Raphson method.
It uses a table of 256 entries, whose significance is unclear, as the initial guess should be dependent on the quantity (x), whose square-root need be found.
So, request if some details could be given.
It states about it, that :
Initial g... |
I expected CVC5 to produce a proof given the following problem in TPTP format.
Why does CVC5 give up on the TPTP problem, but works just fine on the same problem given in SMT-LIB2?
In human words, the problem says that all values X of type tA are in the unary relation rel. And given some arbitrary value a of that type,... |
I have problems to imagine a non-deterministic Turingmachine.
Let's make an example: There is the problem of a Vertexcover. Let $G=(V,E)$ be an undirected graph and $k\geq 0$. The question is whether there is a vertexcover $C$ of size $|C|\leq k$. My book says that this problem is in $NP$, because a Turingmachine could... |
Given two unordered partitions of the same string over a finite alphabet into substrings, how hard is it to reconstruct the original string? If multiple solutions exist, any one will suffice.
Under an unordered partition of a string I understand a multiset composed of the parts of any partition of this string into subs... |
Given is a multiset $S$, a finite set $T = \{t_1, t_2, t_3\}$, and an integer $k \in \mathbb{N}$.
Let $v(t_j)$ be a set of values $\in \mathbb{R^+}$ of length $|T|$ that can be assigned to $s_i$, and $c(t_j)$ be the cost of assigning $v(t_j)$ to $s_i$. Since $S$ is a multiset, assigning $v(t_j)$ to $s_i$ will affect ev... |
There are $n$ cities on a highway with coordinates $x_1$
, . . . , $x_n$ and we aim to build $K < n$ gas stations
to cover these cities. Each gas station has to be built in one of the cities, and we hope to minimize the
average distance from each city to the closest gas station. Please give an algorithm to compute the... |
I have been studying the Ackermann function, specifically the two-argument Ackermann–Péter version.
With the Ackermann function, I developed a problem I call the "Ackermann Decision Problem"
Given non-negative integers, x and y, does A(x,x) = y?
The naive solution to verify the Ackermann Decision Problem would be to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.