instruction
stringlengths
35
29.1k
Given an input string, not necessarily a palindrome, compute the number of swaps necessary to transform the string into a palindrome. By swap we mean reversing the order of two adjacent symbols (UVA 10716). I've found an AC solution with the following greedy algorithm (from UVA board): "For each letter find it's first ...
I came across a question which asked how sorting would help in searching for counterexamples to the conjecture that $$u^6 + v^6 + w^6 + x^6 + y^6 = z^6$$ has no non trivial solutions in integers. The answer said to make two files containing values of $u^6 + v^6 + w^6 \pmod W$ and $z^6 - y^6 - x^6 \pmod W$. $W$ is the w...
I'm supposed to find circuits , which can solve the question of membership in a regular language A with fixed length. The depth is limited by O(log(n)) and the size by O(n). Divide and Conquer should be the way to go, but I always exceed the max size. Would really appreciate any help
Does there exist context-free grammar with words of length $n^2$ or $n^3$? I can't see any, we can produce all grammar with words of length $n$ ($S \to Se$), but then it seems to be impossible to substitute each $S$ with sequence of $S$'s of length $n$.
This is real-world problem, but I need to model it with algorithm as I am going to implement it (probably with PostGIS and Google Maps). Problem is: Everyday I am receiving job offers, and I have to schedule interview with them. I have already noticed, that there are two "hot" areas, where is large amount of offices, a...
Following an exercise from Hopcroft-Ullman's Introduction to automata theory: Let's define $k-MDFA$ as two way deterministic finite automaton with $k$ markers, similarly to two way $DFA$ but with ability to place (or pick up) a marker on the input cell currently under the head, but with limitation to placing at most $k...
Let $\Sigma$ be an alphabet, and suppose that $A$, $B \subseteq \Sigma^*$ are Turing recognizable languages where both $A \cup B$ and $A \cap B$ are decidable. Prove that $A$ is decidable. Is this true? I have tried to prove it by considering the intersection and complement of the sets, but I think I am missing somethi...
I stumbled across Terra last year, and the most similar language I can think of is Julia. Terra is inspired by and uses Lua for templating/metaprogramming instead of being derived from e.g. the Lisp or ML families, but like many JITted language implementations it blurs the line between compile-time and run-time. Are th...
If one were to create a variant of a turing complete language which upon completing a calculation randomly changes the answer by one, would it be Turing complete? For example, say I had a Python implementation which, upon every variable assignment, with probability $\frac13$ decreased the value by $1$, with probability...
I know that one can compute the expression $X^{-1}\mathbf{v}$ quickly with conjugate gradient method. Is there a similar approach for computing $\mathrm{tr}(X^{-1}Y)$? Similarly interesting to me are $\mathrm{tr}(X^{-1})$ and $\mathrm{tr}(X^{-1}YX^{-1}Y)$.
I study Graphs Analysis by myself and i understood most of the material just fine. But, there is one huge problem with my approach that prevents me from solving tests. I don't know how to build new Graphs based on requirements and i'll give an examples: Question: G = (V,E) is a directed graph with no cycles (DAG) and w...
For LBAs it's rather easy to prove the decidability of the halting problem, as there can only be a finite number of different configurations when using limited space. But what about PDAs with $\epsilon$-transitions? Is the halting problem decidable for deterministic PDA's with $\epsilon$-transitions? Given such a DPD...
I'm trying to create a nodeJS application. It allows users to rate a bunch of songs and it stores them in their user profiles. I use this information to compare them to other users, and try to find users with similar interests in songs, and I suggest them new songs based on that. Each user profile basically looks like ...
I have looked at the other answers to this but I still don't get it. (for instance: Why is the clique problem NP-complete?) The general clique problem is defined as $\text{CLIQUE} = \left\{ (G, k) | G = (V, E) \in \mathcal{G} \land \exists V_c \subseteq V . |V_c| \geqslant k \land V_c \text{ is clique in } G \right\}$ ...
I know that there are some problems that are very hard to solve in general, but become much easier and asymptotically faster if restricted to only integer values. One such example would be sorting which can be done in O(n+M) if only integer values are allowed. Another example (I think) is the undirected single source s...
What does a dot (.) mean in predicates? $\forall a \in A. \exists d \in D. H(a,d)$ Especially, how is the above different to $ \exists d \in D. \forall a \in A. H(a,d)$ I've never seen this used in German lecture scripts.
If we compare multimedia and text, if we have n bytes of text and compare it with n bytes of video, then we would be likely to think that n bytes of text is "more" information than n bytes of video data. Is there a name or measure of this difference in data? Loosely speaking it is a "density" or a "quality" of informat...
I've been trying to figure out a practice exam question, about if a given $P$. $P$ is the characteristics of recursive enumerable set given as: $$P(A) = \begin{cases} ⊤ &if &|A| ≤ 100 \\ ⊥ & else. \end{cases}$$ Now I know string properties state: Decidable if $ \{ x$ $|$...
I have a group of N participants, and I need to assign them to M activities. Each activity has a different capacity, from 1 to N. Each participant ranks the activities in order of preference, and no two activities can share the same ranking. This happens for many days, and the goal is to: ensure that no participant ...
This action confuses me for a while. As you know, once we come up with a problem and we want to know how hard it is, we will do the "reduction". Intuitively, if we prove problem B is as hard as problem A, we can know the complexity boundary of B. But if problem B is harder than A, why we call the reduction process -- r...
I'm looking to store the order of a series of elements and access the elements in "pages" (elements numbered 101-150, for example) as well as add and delete them. This is being implemented in a graph database which does not support arrays; unfortunately the clear choice is not an option. Additionally it will sometimes ...
Let's say you have pixel bitmaps that look something like this: From this I can easily extract a contour, which will be a concave polygon defined by a set of 2D points. The question is what is the fastest algorithm to pick, from the set of polygon points, the ones that are closest to the natural "endings" of the conto...
I suppose something like this could probably be easily designed, however I was wondering if there's a data structure that somehow uses both list and tree to access data. Something like this (I'll be informal, but I hope I can give you some idea of what I mean). Suppose we have a tree with depth $n$. At depth 1 we would...
In the 'call by value' evaluation of lambda-calculus, I am bit confused with 'value'. On page 57 of the book Types and Programming languages, it is said: The definition of call by value, in which only outermost redexes are reduced and where a redex is reduced only when its right-hand side has already been reduced to ...
I need to solve the following optimisation problem and I can't come up with any solutions. Is there any algorithm to solve this type of problem. I tried to think of a greedy algorithm or brute force, but couldn't solve it. Input : $ n_1, n_2, n_3, n_4, n_5$ : Positive integers $ a_1, a_2, a_3, a_4, a_5 $ : Positive int...
I was reading about Multi Layered Perceptron(MLP) and how can we learn pattern using it. Algorithm was stated as Initiate all weight to small values. Compute activation of each neuron using sigmoid function. Compute the error at the output layer using $\delta_{ok} = (t_{k} - y_{k})y_{k}(1-y_{k})$ compute error in hidd...
I am trying to prove partial corectness of following program: {s = 0 and j = 0} while j <= n do begin { s + j = (j - 1)j/2 and j <= n + 1} s := s + j; { s = (j-1)j/2 and j <= n + 1} { s = j(j+1)/2 and j + 1 <= n + 1} j := j + 1; { s = (j-1)j/2 and j <= n + 1 } end; { s = (j-1)j/2 and j <= n + 1 and j >...
Say you are given the following CFG $G$: $$ S \to S_1 \mid S_2 \\ S_1 \to AbAS_1c \mid \epsilon \\ S_2 \to BaBS_2c \mid \epsilon \\ A \to Aa \mid \epsilon \\ B \to Bb \mid \epsilon $$ What is $L(G)$? So far I've derived the following regular expressions: $ S \rightarrow (a^*ba^*)^*c \mid (b^*ab^*)^*c$ So far I've come ...
I'm looking at Heap data structure implementation from different sources. What I found is that sometimes it's implemented with the first element of array set to magic (default, unused?) value. For example here the first element is added in constructor. And visualization here shows that it's also set to something magic....
If I just want to find shortest between a single source and destination, can I do better Dijkstra (which finds from one source to all destinations)? I am trying to answer a question in the EPI book. The question is as follows: Suppose you are given a N*N matrix in which some of the cells are greyed out and two non-gr...
Given below is a program which when executed spawns two concurrent processes: semaphore X : = 0 ; /* Process now forks into concurrent processes P1 & P2 */ P1 P2 repeat forever repeat forever V (X) ; P(X) ; Compute ; Compute ; P(X) ; V(X) ; Con...
We are given a directed weighted graph $\mathcal{G} = (V, A)$, with $A \subseteq V^2$. The weight function is $w_{\mathcal{G}} \colon \mathcal{G}.A \to \mathcal{P}(\mathfrak{R}_{>} \times \mathfrak{R}_{\geq} \times (\mathfrak{R}_> \cup \{ \infty \}) \times \mathfrak{R})$, where $\mathfrak{R}_{\ast} = \{ x \in \mathfra...
Is there a ready-made tool / library that takes as input a context sensitive grammar $G$ over an alphabet $\Sigma$, and gives the ability to quickly check if a set of strings $\{w_1, w_2, ..., w_n \}$ belongs to $L(G)$ or not? (and if a string belongs to $L(G)$ outputs the derivation tree)? ...OR ... ... in the case...
For a given database table: DB id w1, w2, w3, w4, v 1 A X1 2 B X2 3 A B Y0 3 A B C Y1 4 C X3 5 D X4 6 B C D Y2 7 C D F Y3 8 C D G Y...
I am new to machine learning. But have basic understanding of the concepts. Problem statement : We humans won't perceive much difference between "Tim Cook" and "Tim C0ok". ( 0 is been replaced with zero ). I am trying to model this. Task is to come-up with a model which can predict if two names are visually similar. T...
I've been reading about hidden Markov models and stumbled upon A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition by Lawrence R. Rabiner (Proc. IEEE, 77(2):257–286, 1989; PDF). The following appears as equation 49 in the section about continuous observations in hidden Markov models: $$b_...
The data are in alphabets. U, N, I, V, E, R, S, I, T, Y, O, F, P, O, K, H, A, R, A. Perform pre, in and post order traversals. I'm confused as how to construct it in the 1st place. Only sense i can apply is assigning numbers to alphabets as A=1, B=2, .... Z=26. But I got stuck on how to select the root node and also a...
I have an array of objects, each of them has a numeric id and another array attached to them. The array in the object contains the dependencies of that object. Each dependency is an id from the other objects. There are no circular dependencies. Let's take this diagram: The ids of the objects are in the upper rectangle...
I have a time series that I want to predict with an LSTM. I am able to get very good results using 50 datapoints predicting 51, but I struggle to get any accuracy using something like 200 datapoints to predict 220. After an epoch, my network outputs 0 for all inputs. Is there a technique for predicting multiple time...
I am writing an executable compressor for small (roughly 1 kilobyte) executable files. I am exploring compression algorithms that are well suited for this task. The amount of time required to compress and decompress is not important for my purposes, nor is the complexity of the compressor. I am limited to 4 GB of RAM w...
I'm looking for the algorithm for deleting an element from a linear-probing hash table that does a delete-and-shift instead of just using tombstone elements. The basic idea is quite simple - but I keep getting caught up in corner cases (notably, w.r.t. "wraparound", where an element hashes to a high slot but all the en...
When speaking about tuples, I used to say and write "The number $a$ is the first component of the tuple $(a,b,c)$, and $c$ is its last component". This all went well until I had to speak about software components in the same text; the meaning of "component" got overloaded. (Luckily, I don't have connected components of...
I have a number of small scripts that are being called, in order, by one larger script. So I can run them all with just one command. I was wondering if there was a technical name for this main program (that runs the smaller ones). Currently I am calling it the 'master', but am not sure if that is correct.
Imagine you have a circular buffer holding n bits. You (uniformly) randomly set k of those n bits. (This is without replacement, so you are left with a buffer of n bits of which kbits are set.) Now you randomly select a location in the buffer. What is the probability distribution of the run of set bits starting at that...
I'm encountering a dynamic modelling problem. I've tried a lot of methods but it seems that all of them are of time complexity O(MNK), like the basic algorithm. I wonder if any guys can make some suggestions about any possible improvement of my time complexity? A dynamic model is defined as follows:  State(n,m,t) is t...
The cross-entropy cost function is usually defined as $$C = -\frac{1}{n} \sum_x \left[y \ln \hat{y} + (1-y ) \ln (1-\hat{y}) \right]$$ where $y$ is the expected output and $\hat{y}$ is the predicted output, for training example $x$. But, in TensorFlow MNIST tutorial, they use cross_entropy = tf.reduce_mean(-tf.reduce_s...
I have just started discovering the machine learning world! I found many tutorials showing how to deal with different types of data. I walked through some tensorFlow tutorials and I think they have very good way for showing how the (x, y) pair for supervised learning is "formed". I was not able to find a way for repres...
I know the maths behind, I know if I do the algebra I can get the result of the 3 cases. I also have an intuition of the 3 cases: Quora However, I just cannot memorize this "simple" 3 cases whenever I need to apply them in real life problems. I don't know if it is a shame that a CS graduate has to Google this theorem, ...
$\text{ALL}$ is literally the class of ALL languages. Are there $\text{ALL}$—complete problems? That is, are there problems for which a solution would allow one to solve any problem whatsoever? Such problems could reasonably be considered"the hardest problems, bar none". One such problem seems to be: given a problem ...
Are there any problems that are easy for bipartite graphs, but hard for general graphs? I am asking because some classical problems are formulated in reference to people looking for a spouse, such as the marriage problem (for straight people) and the stable marriage problem (for straight people). Both are in FP. If one...
I'm not a student in computer science, but from what I understand from the Wikipedia article on the topic, a programming language is Turing complete if it can emulate another Turing complete language's algorithm. Now if we consider that languages like Java, C, C++ and so on are considered Turing complete, and that all ...
Say there are two queues (1 and 2) in series. The latency will be $t_1 + t_2$ without overlapping of their service times ($t_1$ and $t_2$ respectively). If there is a overlapping, the latency will be $t_1 + t_2 - T_o$ where $T_o$ is the overlapped time. (Specifically $T_o = \min(t_1,t_2)$ in my case) To my best underst...
So the problem is in how many ways $2n$ elements can be paired, my approach was multiply all odd numbers less then $2n$. $(2n-1)*(2n-3)*...*1$ but my professor claimed it can be done much faster in algorithmic sense, but I don't really see the way to do so. Any hints? Thanks!
Suppose I'm performing machine learning on a simple dataset, and have a bunch of training data of the form: x (feature) y (label) ----------------------- 1 0 2 1 3 1 4 0 5 1 6 1 ... Where the labels are values in two classes, $[0, 1]$. Clearly,...
As I understand it, when we are on a virtual memory based system, we have to access memory 2 times (one for the Page Table and one for the physical address in RAM). But, how many times would we have to access if we had a TLB?
The common understanding of what oracle does is that it answers a question after a single operation. So at first glance, it runs in $O(1)$. But, doesn't it need to actually read the input? Wouldn't this take at least $n$ steps? If so then wouldn't an oracle run in $O(n)$?
I was wondering what factors effect a machine's epsilon value. I was thinking about how modern computers can calculate expressions to higher accuracy then their predecessors, but what hardware and software factors allow for improved accuracy? Is it the implementation of better algorithms for computing various functions...
I been reading about $\lambda$-calculus and related stuff, but I got some confusions which i want to clarify. The call by value reduction is expressed with two rules $$ \frac{e_1 \rightarrow e_1'}{e_1e_2 \rightarrow e_1'e_2} $$ and $$ \frac{e_2 \rightarrow e_2'}{ve_2 \rightarrow ve_2'}. $$ where $e$ is any lambda term ...
In a bottom-up evaluation of a syntax directed definition, inherited attributes can always be evaluated be evaluated only if the definition is L-attributed be evaluated only if the definition has synthesized attributes never be evaluated My attempt: Option $(3)$ should be true, since , Synthesized Attributes: They ...
As the title says, can operations be performed by a turing machine after it has transitioned to the halt state like shown in the following image.
Lets say I have just used the pumping lemma to prove a certain L language is not CFL. If it is not CFL can I use that as a proof that it is Decidable? Or is this not enouph and I still have to provide a Turing Machine that accepts or rejects L? Thanks
I was reading about cutting stock problem https://en.wikipedia.org/wiki/Cutting_stock_problem , this is best solved using dynamic programming but wiki page mentions 2 other techniques names Branch-Bound and delayed column generation... I read them but it all look same ...every case we break problem into sub problem Can...
I was hoping someone could point me in the right direction in terms of what type of problem I am describing here so I can research it. My initial thought is that it is some form of Constraint Satisfaction Problem. Say as an example I am working with food, and I would like to determine from a massive database of recipe...
I have in input an undirected graph and two nodes. It is possible to find a path of lenght k, where k is a constant, in polynomial deterministic times? Or this problem belongs to NPC? Thanks
Consider a chatbot that runs on a turing machine. It has some restrictions: It must talk to itself 1 sentence at a time. It is forced to use English words to reply. (so only around say 80 k different words to pick from) A sentence cannot be longer than N words (say N=100) Is it possible to create such a bot (computer...
The runtime for Dijkstra's algorithm implemented with a priority queue on a sparse graph is $O((E+V)\log V)$. For a dense graph such as a complete graph, there can be $V(V-1)/2$ edges. Since $E \sim V^2$, is the runtime $O((V+V^2)\log V)$?
Given $ n $ numbers and an infinite number of processors can the min or max be found in constant time? Assume a shared memory architecture (all processors can write to a common shared memory) and the ability to perform concurrent writes I have tried dividing up the numbers into groups of 2 each and then using $n/2$ pro...
I'm trying to figure this one out, as I've found the CFG for the palindrome language. I can't work on a solution that also covers #c(w) <= 3. Find a CFG for the language {w∈{a,b,c} | Reverse(w)=w, #c(w)<=3}? Would appreciate your help
William Stallings discuss various step by step process in developing Dekker's algorithm in his Operating Systems book. In process, he reaches to following version of algorithm (which is incomplete as it results in livelock): 1 2 /* PROCESS 0 */ 3 . 4 . 5 flag[0] = true; 6 while (flag[1]) 7 ...
Given a polynomial of degree $n$ modulo a prime number $p$, I want to evaluate that polynomial at multiple values of the variable $x$, what is the best way to do this? I tried using Berlekamp's algorithm for factorization but it takes $O(n^3)$ just to factorize and then $O(n)$ per point evaluation. Is there any other w...
It has been asked before why $\emptyset^\star=\{\epsilon\}$. The answer boils down to $\emptyset^\star$ being defined as $$ L^\star = \bigcup_{i=0}^\infty L^i, $$ where a word in $L^i$ is the concatenation of $i$ words from $L$. So, for the empty language this leaves empty sets for all $i>0$, "but $L^0 = \{ \epsilon \}...
Every paper says that Green's construction is the best 16-input sorting network as for now. But why does Wikipedia says: "Size, lower bound: 53"? I thought "lower bound" meant:"If there exists at least an algorithm that can...". Am I wrong?
Is the problem of converting ambiguous grammar into unambiguous grammar computable? (Consider Domain as all context free languages).
How do I go about solving this? When I try to google examples I only see problems with "+1" or "+n" constants and never anything above that. If possible could anyone also describe the suggest method to solve these as well? () = 3( − 1) + 3 () = 2 (/8) + 4^2 Update: I couldn't find any examples or helpful resources for ...
I've been trying to find out how to determine Hit or Miss regarding this info: 2-Way Set associative cache memory which contains 32 blocks with 4 bytes in each block, Accesses were done to addresses no 7,13,37,27,33,11,7,18,34,23. I know how to determine Hit or Miss in direct-mapped cache but it seems irrelevant in K-W...
Now we can see that Church was associated with the Simply Typed Lambda Calculus. Indeed, it seems he explained the Simply Typed Lambda Calculus in order to reduce misunderstanding about the Lambda Calculus. Now when John McCarthy created Lisp - he based it on the Lambda Calculus. This is by his own admission when he pu...
A question I came across describes a scenario of an information system in a clerical office and states- "Identify the sets of S={subjects}, O={objects} and P={privileges} for the above systems of the manufacturing organisation, and model the case using an access control graph." Further, the question says- "Your graph ...
$$DoubleHC=\{G\,| \text{G has at least two Hamiltonian Cycles}\}$$ I think about take a graph with HC and add to it two vertexes and edges to two randomally vertexes, but without success. Is my try good? or I have to go in other way? Also full solution is good.
Is there an (efficient?) algorithm which given a context-free language $L$ (given as a grammar) and a string $x$ with $x \not \in L$ computes a $y$ with $y \in L$ and $\forall y': y' \in L \implies d(x, y) \le d(x, y')$, where $d$ is the Levenshtein distance? (Secondarily, can one enumerate all such $y$?) The motivatio...
I'm interested in developing a solid CS/Electrical Engineering foundation that would enable me to branch out in the future to any CS-related field. I've read other literature recommendations and have recently gotten ahold of Sipser's second edition Intro. to the Theory of Computation, contains the theories of finite au...
I want to count how may numbers are there in range [1,X] which are divisible by at least two of their digits, different and >1. I found a sequence on OEIS, but this will take lot of time to generate all such numbers as X can be $10^{18}$. How to do this efficiently?
Dynamic trees play an important role in solving problems such as network flows, dynamic graphs, combinatorial problems ("Dynamic Trees in Practice" by Tarjan and Werneck) and recently merging dictionaries ("A Simple Mergeable Dictionary" by Adam Karczmarz), By dynamic trees I refer to the definition stated in Sleator ...
Consider a program written in a common language such as C. Assume that it does not have any explicit parallel constructs. Then, once it is compiled to an executable program, it will be run serially, even if the machine has multiple processors. Now, suppose we wanted theoretically to write a "parallel compiler", whi...
I am interested in solving recursions and while I was trying to solve this one: $a_n=a_{n-1}+4n-3$ I ran onto a problem, I don't see how to find an explicit solution using standard inhomogeneous method(finding homogeneous and particular solution). Specifically I have a problem with finding particular solution. Problem ...
The domination problem $DOM$ is defined as $$ DOM = \{ \langle G,k \rangle\ | \ G \text{ has a domination of size } k, K \in \mathbb{N} \}, $$ and the rainbow domination problem $RDOM$ is defined as $$ RDOM = \{ \langle G,r,k \rangle \ | \ G \text{ has a r-dominating set of size } k; r,k \in \mathbb{N} \}. $$ A $r$-rai...
$H$ is a supergraph of $G$ if it can be obtained from $G$ by adding, edges, vertices, or both. Is there a standard terminology for a graph that can be obtained from $G$ only by adding edges?
Which of the sorting algorithm is (classical implementation with no enhancements) the fastest for a data set with all identical elements? And why? How would one justify the answer to the above question logically? Logically as in without implementing the algorithms and finding the average time consumed for few sample da...
I've become interested in blockchain databases. Everywhere I've read it said that each user has to have his/her own copy of database. Why can't distributed blockchain database be 'distributed' to reside partly on many computers to achieve say fixed 10 times redundancy, not times number of users redundancy? Will speed b...
In a village there are n houses , some have electricity some dont. Those having electricity are labeled as 1 and others 0. Houses are arranged in a line from left to right (1 to n). let x1 x2 x3..... be coordinates of the houses.(1= < x1< x2< x3...) The houses having electricity are to be connected with those which don...
I'm wondering if it is feasible for an OS to return control back to the bootloader, and boot a second OS after itself. Reason being -- I've been musing on bootkits, and wondering if it would be possible for a bootloader to run a micro-linux distribution hidden at the end of the drive (that charades as a slowly booting ...
This is part of a question I had asked elsewhere, and then some of the links redirected me to CS stack exchange. Given $a_1,\dots,a_D$ (all strictly positive), I want to draw points uniformly from $\qquad X =\{(x_1, x_2, ..., x_D) \mid 0 \leq x_1 \leq x_2 \leq \dots \leq x_D\leq 1, \sum_{i=1}^D a_i x_i = 1 \} $ How ...
On page 348 of "Sipser M. Introduction to the Theory of Computation. Cengage Learning; 2012 Jun 27", it says Perhaps at some time in the future, methods that can quantify the complexity of finite problems will be developed. But current methods are asymptotic and hence apply only to the rate of growth of the complexity...
I have a point cloud that has several connections. What I want to identify are the largest (by area) irregular (convex) polygons. I put convex in brackets as it is not fully necessary (like in the red polygon case), but polygons with very small corner angles should not be considered. I know that this is quite ambiguous...
There are some enumeration problems which have little input, except for some termination criterion. Examples for the question at hand would be enumeration of prime numbers in ascending order enumeration of grid points by increasing distance For these there exist two fundamentally different techniques: With one class...
While dealing with a problem, I uncovered this subproblem: Input: A set of sets $S = \{S_1,...,S_r\}$ where $\mid$ $S_1$ $\cup$ ... $\cup$ $S_r$$\mid = n$, as well as a number $k<n$. Output: A subset of $S$, $T = \{S_{t_{1}},...,S_{t_{p}}\}$ so that $\mid$ $S_{t_{1}}$ $\cap$ ... $\cap$ $S_{t_{p}}$$\mid$ $\geq k$ with $...
Can somebody tell me what the lowest amortized cost for the increment operation of a decimal counter is? I can show the costs are O(1) and with max amortized costs of 2 (similar to a binary counter), but is this the lowest possible value?
I'm trying to prove that for a flow network, maximum flow f, and each minimum cut S that f(S)=c(S). Max flow min cut promises that there exists a cut where f(S)=c(S); I want to prove that given multiple minimal s-t cuts Si, that c(S1)=f(S1)=c(S2)=f(S2)..., meaning all outgoing edges of all minimal cuts are fully sat...
$D → T ∨ D | T$ $T → C ∧ T | C$ $C → ¬C | name | ( D )$ $name → a | b | c | d$ I am not looking for the complete answer, but more the methodology of working this out. How would I go about proving that this language is not regular?
I have the problem that I have a grid-based room which has 1 or more exits and I want to "secure" the room with minimal effort. Here a little Example: In this example black squares are not passable, white ones are and the ones with the arrows are the exits that should not be able to be reached. I wan't to enclose the ...
In FKS hashing, I wonder if the size of the table $G[1..n]$ (used to record the functions $g_i$ which is chosen randomly; one entry per bucket) is really strictly $O(n)$. Given that the probability of a hash function $g_i$ is higher than 0.5, I can see that it will mostly hold small values (assuming we start with $g_0$...