instruction
stringlengths
35
29.1k
Given a network $G=(V,E)$ , a max flow f and an edge $e \in E$ , I need to find an efficient algorithm in order to detect whether there is some min cut which contains $e$. Another question is, how do I decide whether if $e$ is the lightest edge of at least one minimal cut? I've thought about running Ford-Fulkerson algo...
Let consider a general version of Two Generals' Problem, when there are $n$ generals located on the arbitrary graph and they should agree on exactly the same value whether to attack or not to attack. It's well known that Two Generals' Problem represents a version of the Consensus Problem with unlimited number of the...
Motivated by Max-Flow: Detect if a given edge is found in some Min-Cut, I'd like to ask the following questions: Given a multiset of real numbers $B$, how hard is it to compute the minimal positive difference $\delta_\min$ $$\delta(B_1,B_2)=\left|\sum_{b\in B_1}b-\sum_{b\in B_2}b\right|$$ taken over all partitions $B...
My question refers to the draft of Mathematical Foundations of Automata Theory, IV.2.1 (pages 89ff in the pdf). I will repeat everything necessary nevertheless: Let $M,N$ be monoids and $\varphi: M \rightarrow N $ a monoid morphism. We say that a subset $L$ of $M$ is recognizable by $\varphi$ if there is a subset $P$ o...
We have a sorted list of side lengths that can be used to form a polygon. There are $n$ such values ($n \le 1000$). Now we need to find if we can use any 10 of these values to form a non-degenerate convex polygon. How do we approach this? Anything up to the order of $O(n^2 \log n)$ is acceptable. Better if possible. I ...
Realize I didn't mention x86 or any more details to make this non-specific to any platform, but to just get a general idea of how this is done(this is also a long question with a lot of details). I know most PC motherboards for desktop (if not all) computers have two sections; north and south bridge, and a chipset conn...
Problem  Given a Turing machine $M$ which has known runtime ${O}(g(n))$ with respect to input length $n$, is the runtime of $M \in {O}(f(n))$? Is the above problem decidable for some nontrivial pairs of $g$ and $f$?A solution is trivial if $g(n) \in O(f(n))$. This is related to the problem Are runtime bounds in P dec...
What are degenerate polygons? How does one check whether a given pair of polygons is degenerate or not?
We have two integers $z, k$ We form a sequence now of first z natural numbers. i.e. $1, 2, 3, 4, \ldots z$. Now we have to find total number of permutations of this sequence such that the sum of any two adjacent numbers is $ \le k$ ( $z \leq 10^6$, $\;\;z < k < 2*z$ ) Here is what I have been able to think untill now....
I'm working on old MC-Questions about decidability und don't have the answers to the following ones: 1.) $L_1$ and $L_2$ are not decidable $\Rightarrow$ No superset of $L_1 \cup L_2$ is decidable 2.) For Turing-acceptable languages L is "L = $\emptyset$" a non-trivial property. 3.) There are context-free languages $L_1...
I have seen this model question on synchronous circuit , but i could not understand the logic, can anyone please help me? "Develop the state diagram for a synchronous sequential circuit which will recognize the bit sequence 1101 (ie, every time the sequence 1101 is detected in the input bit stream, the circuit has to ...
I have some concerns about the Halting problem. This is the proof I know: Let $h(M, i)$ be a function, $M$ being Turing machine and $i$ input for the Turing machine. Let $h(M, i)$ output true whenever $M(i)$ halts. Let $h(M,i)$ output false if $M(i)$ does not halt. Then define $p(M)$ on Turing machine $M$. $p(M)$ will ...
The notion of polynomial time Turing reductions (Cook reductions) is an abstraction of a very intuitive concept: efficiently solving a problem by using another algorithm as a subroutine. For example, by stating "$A$ is polynomial time Turing reduced to $B$", we indicate that we can solve the problem $A$ in a polynomia...
I'm in the middle of planning a 5000ish word essay on fully homomorphic cryptography, the current practical implementations and their limitations. Which areas of CS as a subject have been (or will be) most affected or will utilise fully homomorphic cryptography the most in the coming years and developments? PS. I did s...
Let $L$ be a star-free language over finite alphabet $\Sigma$. A substitution will be a map $\sigma : \Sigma \to \mathcal{P}(\Sigma^*)$. It seems obvious that if $\sigma(a)$ is star-free for every $a \in \Sigma$, then $\sigma(L)$ will be star-free. ($\sigma(L) = \{ w_1 ... w_n | w_i \in \sigma(a_i) \land a_1 \ldots a...
Let $a$ and $b$ be integers, and let $\text{RANDOM}(a,b)$ be a method returning an integer from the range $[a,b]$ uniformly at random. Now consider the following program, that takes as input an array $A$ of integers. PERMUTE-BY-SORTING(A) 1. n = A.length 2. let P[1..n] be a new array 3. for i = 1 to n ...
What is the difference between Babbage's analytical and difference engine? Can they even be compared?
This is a question from a 2007 exam paper for a course I'm studying, question 2 on page 2. Theorem: Let $L$ be a context-free language. Let $L_{even}$ be the subset of $L$ consisting of all the strings in $L$ that have even length. Then $L_{even}$ is context-free. The question is to prove this theorem using two of th...
I'm thinking of using something similar to the Merge Sort algorithm. So the recurrence running time of Merge Sort is T(n) = 2T(n/2) + n. What should I do about if n/2 is less than or equal to m, OR if n/2 is greater than or equal to m? I believe the given function should be location inside the "Merge" function of the ...
Suppose I have a system with 32-bit logical and 16-bit physical address spaces, and the page size is 512 bytes. For simplicity, ignore the valid/invalid bits in the page table. How many sections will the logical address be divided and how many bits will each section have? The logical address will be divided into three ...
Apparently, if we use Djikstra's algorithm to find the shortest path between the root node and all other nodes in a weighted graph with no negative cycles, we are done after updating the distance of each node $|V| - 1$ times. This puzzles me because I think that a single round of breadth first search is enough. Why mus...
A sink in a directed graph is a node with no outgoing edges. If I perform a depth first search, why is it that the node with the least post-order number (and thus the highest pre-order number) not necessarily a sink - isn't this node found last? Also, intuitively, the node with the greatest post-order number should be ...
There are $n$ bins, the $i$th bin contain $a_i$ balls. The balls has $n$ colors, there are $a_i$ balls of color $i$. Let $m=\sum_{i=1}^n a_i$. A swap is take a ball from one bin and swap with a ball from another bin. We want minimum number of swaps such that each bin only contain balls with the same color. I know a ea...
Take the image and spectrum below. If I look at the spectrum, it just look like noise.... How to make sense of it intuitively? Image: Frequency spectrum of image (using Fourier Transform):
By default, a hash table is unordered. I have a simple question on the retrieval of elements in a hash table Can we retrieve elements from a hash table in the same order as they are put inside?
How can I find the serial number of an n-choose-k combination? I would like a function that gets as input: $n$, $k$, a set of $k$ elements out of the set ${0, 1, ... n-1}$. The output should be a number in the range $[0, C(n,k)-1]$, such that: Each different combination gets a different number; All numbers in the r...
Are these languages recursively enumerable? $L = \{ \langle A\rangle \mid x\in L(A)\implies |x|\leq 13\}$ $L = \{\langle A\rangle \mid L(A) \subseteq \overline{L_{\mathrm{uni}}}\}$, where $L_{\mathrm{uni}} = \{\langle T\rangle x \in \{0,1\}^*\mid x \in L(T)\}$. How would I prove / disprove that these languages are RE...
I was thinking about the following problem the other day: You are stuck on a desert island with a battery-powered emergency radio. You know that if you feed enough power into the radio that you should be able to alert someone to your position. In fact, as soon as you provide the radio enough power to reach someone e...
Describe a (general) procedure that, given some finite automaton M, produces a new finite automaton M’ with: M’ rejects ε, but accepts otherwise the identical language as M does.Note that M may or may not accept ε, while M’ does not! My solution is to discuss the different cases. If M doesn't contain ε, then, don't ...
If not, then what does it mean when for some state $q$ and some symbol $a$, $\delta(q, a)$ does not exist?
I need to prove a bisimulation relation on $CA_{\tau}(N)$ (communication algebra with tau-steps) and names $N$. It need to prove that $p!d.x||p?d.y$ is bisimular with $p!d.(x||p?d.y)+p?d.(p!d.x||y)$ by finding a suitable bisimulation relation $R$. I was thinking of $R=\{(x,x) \mid x \text{ is a reachable state} \} \cup...
In Graph-Theory there are many ways for efficient approximation-algorithms to solve the Metric TSP. The best solution seems to be the Christofides Heuristic with a factor of 1.5 to the optimal solution. My Teacher said, there would be the so called $\frac{4}{3}$-conjecture, which states: there might be a approximation ...
(This question might be legitimately crossposted to stackoverflow or mathoverflow or programming StackExchanges.) Preface I'm reading this paper on solving linear systems of equations Ax = b using an explicit inverse (held by conventional wisdom as a big no-no): Druinsky & Toledo, "How accurate is inv(A)*b?", http://ar...
Exact cover by 3-sets is $\sf{NP}$-complete: Instance: Given a finite set $X = \{ x_1,x_2,...,x_{3n}\}$ of $3n$ elements and a collection $C = \{ ( x_{i_1}, x_{i_2}, x_{i_3}) \} $ of $m$ 3-elements subsets of $X$; Question: Find a subcollection $C'$ of $C$ such that every element in $X$ is contained in exactly one me...
I have given an undirected graph $G$ with vertex $\{1, ... n\}$ and two star subgraphs $S_1$ and $S_2$, always consisting of ALL neighbors of a given vertex, and the goal is to check wether the two star graphs have a vertex in common. This will be will be executed $M$ times for $M$ a large integer. My approach would b...
Apple has just proudly stated that their new mac pro will be able to give up to 7 teraflops of computing power. Flops stands for Floating Point Operations Per Second. How exactly is this benchmarked though? Certain floating point operations are much heavier than others, so how exactly would a FLOP be a benchmark for co...
I'm doing some exam study and came across a question I'm not really sure on. Consider the Bayesian network below: Let's denote "Disease" with $D$ and "Symptom" with $S$. I want to find $P(D \mid S_A, S_B)$ but it's not working for me. I've tried (among other things) to apply this rule: $\qquad \displaystyle P(x_1, x_2...
In Don Knuth's famous series of books, The Art of Computer Programming, section 2.3.1, he describes an algorithm to traverse binary tree in inorder, making use of an auxiliary stack: T1 [Initialize.] Set stack $\rm A$ empty and set the link variable $\rm P\gets T$ T2 [$\rm P=\Lambda$?] If $\rm P=\Lambda$, go to step T...
Of course, converting NFA to DFA is not a problem. But what about the other direction? My motivation is the notion of minimization regular expressions using the DFA minimization algorithm.
Let consider well-known problem in distributed computing Broadcast Problem in network with stopping crashes. The most appropriate solution to the broadcast problem is flooding algorithm, when the source of the message just send it to all available nodes of the network on the first round, if there are crashes on the edg...
I have one algorithm that generates a feasible solution to a linear programming problem. However, it is very likely that this is not a corner point. This makes it not suitable for direct use as an initial feasible solution for a bounded Simplex solver. How can I efficiently find a corner point from this solution that I...
I have n commodities with each a unique source and sink node. Each source-sink pair is connected in some manner on a directed acyclic graph. All arc weights are non-negative. The goal is to find the shortest paths to transport the commodities between their respective source-sink pairs. Is there any algorithm that can s...
Recently I've seen this very good apps https://play.google.com/store/apps/details?id=com.kingjim.shotnote&hl=en https://itunes.apple.com/JP/app/id411332997?mt=8 this apps reconstruct the image from the camera based on the marker (this is what I think :) ) it also have a special paper that have marker. What I've still h...
I have the following formal grammar: $$G= (\{S,A,B\},\{a,b\},R,S)$$ $$R=\{S \rightarrow A\ |B, A \rightarrow \varepsilon\ | aA\ |bA, B \rightarrow \varepsilon\ |Bb\ | b\}$$ Now, we see, the production rules $A \rightarrow \varepsilon$ and $B \rightarrow \varepsilon$ implies that this grammar is not context-sensitiv ($...
I am trying to understand the algorithms by Peterson and Dekker which are very similar and display a lot of symmetries. I tried to formulate the algorithms in informal language like follows: Peterson's: "I want to enter." flag[0]=true; "You can enter next." turn=1; "...
I am trying to prove by induction the following theorem: Use Induction to prove the following fact: for every integer, $N\ge 1$ , a BST with $N$ nodes must have at least $\log( N + 1)$ levels. I've proved the base case but I am struggling to figure out how to apply induction to prove for the $K+1$ case. Any suggestio...
Or at least generate a set of strings that one NFA accepts, so I can feed it into the other NFA. If I do a search through every path of the NFA, will that work? Although that will take a long time.
Let $L$ be a language such that $\overline{L}^R$ (the reversal of the complement of $L$) is context-free. Is then also $\overline{(L^R)} \in \mathrm{CFL}$?
We define an onto function from $[n] \times [n]$ to $[n-2] \cup \{0\}$ as follows, where $[n] = \{1,2,3,\ldots ,n\}$, $$f : [n] \times [n] \rightarrow [n-2] \cup \{0\}.$$ 1) $f(x,x) = 0$. 2) $f(x,y) = f(y,x) > 0$, for $y ≠ x$. 3) $f(x,y) \leq \max\{f(x,z),f(z,y)\}$ for all $x,y,z$ belonging to $[n]$. How many such func...
I'm looking for a data structure that can work as a priority queue with reasonable maintenance complexities (like $O(\log n)$ for insertion and deletion) and that has a theoretical unbounded limit for its number of elements (like a tree structure, that is bounded only by the computer's available memory, and unlike a tr...
I've been reading a book on using loop invariants and induction to prove program correctness. Then I came across the following program which got me thinking... Specification for Cube_Root(n) Pre-Condition: $n$ is a natural number. Post-Condition: Cube_Root returns a natural number $i$ that is the cube root of $n$ or it...
Define the Nerode equivalence over a language $L \subseteq \Sigma^{*}$ as $u \sim_L v$ iff $uw \in L \Leftrightarrow vw \in L$ for every $w \in \Sigma^{*}$. The Nerode equivalence ${\sim}_L$ has finitely many equivalence classes precisely when $L$ can be recognized by a finite-state automaton. This is the Myhill-Nerod...
I try to solve Physical Travelling Salesman Problem using evolutionary algorithm and I have diffucult to detemine how to choose the parent , on which we do the crossover. Assume I have popultion of 100. The parent should be selected randomally? or according to their fitness? If I choose them randomally I don't think ...
I don't know whether it was a joke, but once I read what was referred to as a formal definition of a file in a versioning system such as git, hg or svn. It was something like a mathematical object like a homeomorphism. Was that a joke or is there really computer science theory about versioning systems and the mathemati...
Here given is a sequence from OEIS. The sequence is triangle of coefficients from fractional iteration of e^x - 1. Few terms are: 1, 1, 3, 1, 13, 18, 1, 50, 205, 180, 1, 201, 1865, 4245, 2700, 1, 875, 16674 The expression of finding the sequence is also given as: A(n;x) for n-th row satisfies A(n;x) = Sum_{k=0..n-1} S...
I am trying to come up with a regular expression for the following language: The set of all strings with at most one triple of adjacent 0s. What does "triple of adjacent 0s" mean? Does it mean 010101, or something else?
I have a a few fundamental doubts in recursive enumerability and countability and below, I have written what I understand them to be with proofs. But there are contradictions at the end. What is wrong with the statements/proofs i have made? Countability (C=Countable): A set $X$ is C when a bijection exists between the ...
Well, i have a binary search tree $T$ that is equilibrated by height witch has $2^d+c$ nodes ($c<2^d$). What is the number of comparisons that will occur in the worst case scenario, if we ask whether $k\in V(T)$ and why does it arise?
I searched for linear solver libraries and found out about PETSc library which is considered to be a powerful and useful library. PETSc consists of implementations of various iterative methods with preconditioners and sparse matrix storing methods. All the methods are realized sequentially and in parallel using MPI. I ...
I have to create a roadmap for the quantum computing technology. Looking around I found the timeline on wikipedia that is pretty wide but does not highlight the key events in quantum computing research neither sets the possible future for research. Could somebody help me to define which are key events in the quantum co...
A nice easy one. I'm interested to know the most standard and accepted way to denote the update of a mapping in the context of a theoretical computer science paper. By example, suppose we have a mapping $m$: $$ m = \{1 \mapsto 2, 2 \mapsto 3, 3 \mapsto 4\} $$ Now suppose we wish to mutate the $m$ such that $~m(1) = 666...
Assuming $P \neq NP$ Is the following langauge in $P$ or $NPC$: $L=\{\langle\phi\rangle\mid\phi$ is a 3CNF formula with an assignment satisfying at least half of the clauses$\}$ The first thing I tried to do is to find a 3CNF formula $\phi$ such that $\phi \notin L$ and I haven't managed to do so. Is it possible that ...
I always wondered how various certain languages like Java, HTML5 and browser extensions are made with cross platform(operates and functions the same, regardless of OS, being Linux/Windows/BSD not specifically CPU architecture) compatibility in mind... Is there a certain developmental process semantic or otherwise that...
Θ - Tightly bound O - Upper bound Ω - Lower bound I understand that for addition, the max asymptotic value is taken, for example... if ƒ1(n) = O(n) and ƒ2(n) = O(n log n), then ƒ1 + ƒ2 = O(max(ƒ1, ƒ2) = O(n log n) and for multiplication, the multiplied asymptotic value is taken, for example... if ƒ1(n) = O(n) and ƒ2(n)...
I have seen it mentioned that dependent type systems are not inferable, but are checkable. I was wondering if there is a simple explanation of why that is so, and whether or not there is there a limit of "dependency" where types can be indexed by values, below which type inference is possible and above which it is not?...
I know that we can minimize DFAs by finding and merging equivalent states, but why can't we do the same with NFAs? I'm not looking for a proof or anything like that--unless a proof is simpler to understand. I just want to understand intuitively why NFA minimization is so hard when DFA minimization is not.
Denotational semantics are abstract functions that give meaning to statements of a programming language. They accept an expression and return a value. But how do you define denotational semantics for languages that define, for example, functions (and later use these functions), or global variables, and change some glob...
In the book on complexity by Arora and Barak, there is an exercise to show $Space(n)\neq NP$, the proof of which goes by showing that $NP$ is closed under Karp reductions, while $Space(n)$ isn't. To show that $Space(n)$ isn't closed under Karp reductions, the suggested technique (both in the solutions given at my place...
I need your help with an exercise on Ford-Fulkerson. Suppose you are given a flow network with capacities $(G,s,t)$ and you are also given the max flow $|f|$ in advance. Now suppose you are given an arc $e$ in $G$ and suppose this arc's capacity is increased by one. Give an efficent algorithm which returns true iff th...
I'm interested in surprising data structures that extend the things people learned in their first algorithm/data structure course. Usually by offering an additional operation at a very low cost. I learned that one can create a dynamic array with $O(1)$ access and $O(1)$ amortized append a long time ago. I thought there...
Consider 3-player game. Players $x,y,z$, each player has two strategies. $x$: $x_1$ and $x_2$, $y$: $y_1$ and $y_2$, $z:z_1$ and $z_2$. The outcome of the game are represented by the labels of the player who has playoff $1$, otherwise outcome is $0$. The best way to represent the game is to depict two tables, the firs...
Find the number of topological sorts in a tree that has nodes that hold the size of their sub-tree including itself. I've tried thinking what would be the best for m to define it but couldn't get anything specific. Maybe $\mbox{Number of sorts =}\prod\limits_{x\in \mbox{children}}\mbox{Number of sorts}(x)$ Meaning tha...
Some context: I'm to write a program that sorts the lines of a file in C for Linux. Since I have to read all lines of the file (fgets() for example) I'm thinking about inserting them in a tree like structure in a sorted manner using the so called tree sort algorithm. Looking for a self-balancing tree structure I came a...
It is known that the language of words containing equal number of 0 and 1 is not regular, while the language of words containing equal number of 001 and 100 is regular (see here). Given two words $w_1,w_2$, is it decidable if the language of words containing equal number of $w_1$ and $w_2$ is regular?
I've been working on this graph and just completely botching it. I mean to say that my solution may be the worst possible other than if a monkey had thrown darts at the graph to decide the next path. Anyhow, I'm lost and really trying to get a grasp of where my conclusion and the proper conclusion diverged dramaticall...
I am working on a program that involves detecting faces in photos, i am reading a paper that someone has wrote and they said that they had more success detecting faces once he they applied some enhancements to the image, one of these being a contrast enhancement. The exact words are... Contrast enhancement improves th...
I am working with sparse matrices (not particularly huge, <100Mb) and I want to compute the largest independent set on the bipartite graph $(N,E)$ defined as follows: suppose the matrix is named $A$ and is of size $m \times n$. $m+n$ nodes ($1,\dots,m$ for the rows, $m+1,\dots,m+n$ for the columns) the edge $(i,j) \in...
I am having a difficulty in deciding the scope of the left-most lambda in the following expression. λx.x(λuv.v)(λab.a)(λcd.c) I have learnt that we should put brackets in such a way that the scope of lambda will be maximum. So arrived at candidate- answer 1, below. On the other hand, since the expression (λuv.v)(λab....
Suppose I have two mutually recursive functions like this: f1(x) { .//some code . . f1(x-1)+g1(x-1); } g1(y) { . .//some code g1(y-1)+f1(y-1); .. } How can I calculate time complexities in such cases?
Is it possible to write a universal loop program for if-then & loop programs and it is possible to write a universal while program for while programs? Long version and some background: Before anyone asks, YES, it is a homework and I am not here to find an answer, but only clues to help me get this question right ! I'l...
There seems to be a sense of competition in creating the fastest computer in the world, and I feel like technically you just have to continue increasing the core number to gain more flops, which is exactly what some countries are doing, so how would you really bench mark the technological level of a supercomputer for e...
Productions of the form A-> A are removed immediately, but what if the production is of the form A -> AA? example: A -> AA | a
I have read the Wikipedia article on Recursively Enumerable languages. The article suggests that the halting problem is recursively enumerable but undecidable. My idea till today was that the halting problem belongs to a class of languages which are not even recursively enumerable. But the article suggests that the hal...
I am writing this, because no matter how I look at the algorithm I see an error :-) Aho & Ullman in "Theory of Parsing, vol.1" (pp. 357-359) described the algorithm for building $FIRST_k(A)$ set for any $A$ non terminal by incrementally building helper set $F_i(A)$ which has such property that every $F_i(A)$ set is con...
I often see claims that modern functional strictly-typed languages are 'safer' than others. These statement mostly linked with type systems and their ability to explicitly express the following pitfalls: Alternatives in function result. Maybe and Either datatypes vs. exceptions and null-pointers in C++-like languages....
I have a problem where, there are a set of nodes and dependencies between them. I want to cluster them based on the maximum number of dependencies. Dependencies can be thought of as number of edges connected. I want to group those with maximum dependencies. For example in the set $\{1,2,3\}$ and $\{3,5,7\}$ if $\{3,5...
I have a problem that states the following : Given a cyclic graph , output for each node if the node removes all cycles in the graph. The most trivial way to do this is using a Union-find disjoint set , and for each node , try not putting it in the Union-find disjoint set , if there are no cycles , then this node sho...
I have an issue for which I am looking for an algorithm (if it exists) What I have: An array of items which have certain properties, e.g. item $A$ has properties $x$ and $y$. Example: $[ A(x,y), B(x,y), C(x,y), D(x,y), E(x,y) ]$ What I want: A result list consisting of elements of the original list, such as $[ A(x,y), ...
How is a hypergraph different from the bipartite graph generated from the hypergraph by introducing new vertices for each hyperedge, and connecting these vertices with the vertices connected by the original hyperedge. Alternatively, I could also start with a bipartite graph, designate one of the sets of vertices as the...
I have a deep appreciation for formalisms like the Turing Machine and the $\lambda$-Calculus, and enjoy studying them and learning more about how they relate to physical computers. I am now learning about writing GUI programs, and the graphical library (GTK) relies on things like signals and callbacks, which I have not...
I have to show whether a program containing only if-else statements but no loops is able to calculate the following type of functions: $f^n(x)$. The function $f$ is applied $n$ times to $x$, so I guess this is a recursive function. How can I prove that formally?
Let $B=\{b_1=g_1,\cdots,b_n=g_n\}$ be a set of binary variables $b_i$ and their corresponding values $g_i \in \{0,1\}$. Let $M=\{\sum_{e \in A}e \;:\; A \subset B\}$, i.e., $M$ is the set of all possible linear combinations of the equations in $B$. Given $S_i \subset B$ for $i=1,\cdots,m$, is that possible to compute, ...
I have a problem that I think should have been studied. I am looking for algorithms for it. Each item is a set of key-value pairs. Let $x$ be an item and $F$ be a set of items. Each key and each value can appear multiple times. The number of possible keys and possible values can be arbitrary large. We are given $x$ and...
I am studying for my exam and I wanted to do some extra excercises, but I have some problems with solving :) Can anyone please help or give me some advice where to start? Thank you! We can represent every list of lambda expressions $x_0, x_1, ..., x_k$ with lambda expression $[x_0, x_1, ..., x_k]$ , defined as: $[x_0, ...
As I remember: A decision problem is a problem that has the answer yes or no. An algorithm (in the context of automata theory) answers yes or no; it halts on all inputs, accepted or not. A TM represents an algorithm. The TM accepts an input string and executes with that input. If the machine ends up in an accept state...
I'm looking for an algorithm to construct a grammar which, given a set of words which can have multiple identical symbols, represents a compressed version of this set, that is, I can generate only the words of the set but the grammar will take less memory than the set himself. Besides, I'm looking for an algorithm whic...
I have this problem, maybe anybody could help. Given a graph $G = (V, E)$ and an integer $k \geq 1$, find the minimum number $l$ of vertices to remove to make the largest connected component of $G \setminus \{v_1, \dots,v_l\}$ have at most $k$ vertices. I wonder it this problem can be solved quickly (in polynomial tim...
Given a graph $G = (V, E)$, find $k$ vertices $\{v^*_1,\dots,v^*_k\}$, which removal would result in a graph with smallest largest component. I assume for large $n = |V|$ and large $k$ the problem is difficult (NP-hard), but I am interested in small values of $k$ ($k \in \{1, 2, 3, 4\}$). For $k = 1$, I think it is p...
I am trying to understand how the Mersenne Twister random number generator works (in particular, the 32-bit TinyMT). I am still relatively new to the concept of RNG. As I read the source code, I noticed there were two ways to seed the MT: with a single integer seed or an array of integer seeds. What is the point in see...
Is there a name for the DAG obtained from a directed graph by collapsing together the strongly connected components?