instruction
stringlengths
35
29.1k
I want to create a turing machine that describes the language L={x#y | x,y\in {0,1}* and x is a substring of y}. However I'm not sure how to start writing the transition function δ as I've just gotten acquainted with turing, can you point me the transitions so I can draw the state diagram and understand more?
I have the following Turing machine: A 2R-3L-TM is similar to a standard TM with the change in which the head can only move either 3 cells to the left or 2 cells to the right (those are the only possible moves). and I want to prove equivalence between 2R-3L-TM and standard TMs (one tape and the head can move single cel...
I posted this on mathoverflow but haven't recieved any comments. I wonder if there might be some insight from this community. Thanks! The problem Suppose you have nonnegative integer vectors of length d, $x$, $y$, $z \in \mathbb{Z^+}^d$. We know that $\sum_{i=1}^d x_i + y_i = \sum_{i=1}^d z_i$. I wish to find permutat...
The language $L=\{W\in\{0,1\}^{*} \mid W=0^{x}1^{y} \text{ where } x\geq0, y>0 \text{ are integers and } y\nmid x\}$ is not regular. How would one prove this using Pumping Lemma? I thought about it for quite a while but couldn't quite figure it out. Lots of number theory is necessary I'd imagine.
I have the following problem. Given a below boolean formula (of the type explained below) containing $n$ literals and two parameter $k$ and $l$, come up with a satisfying assignment of literals such that no more than $k$ of them are set to true. ($l$ will be explained below.) An example boolean formula with 4 literals ...
I search good articles or books on neural network. unfortunately i don't a lot of time and only now i started to research this field. so i actually search a good source that will give the fundamental (basic theory and tools to understand complexed neuroal networks). any suggestion?
I have an unlabeled dataset: 500 X-rays of seeds in husk. In each image there are different number of seeds, for instance, from $10$ to $50$. A seed has some features. The main features are a seeds' square and a husks' square in pixels. I need to calculate the these features ratio. I am looking for an objects recogniz...
I have this language {0+1+0+} and i need to prove it is regular,i had the idea to use the closure properties but i can find any regular languages to unify perhaps.Any ideas?
Let's say I have a code which does coin toss at 25% win probability. If I run this code n number of times in the same system it will yield ~25% win. If I run this code on n devices (once each) will the result be ~25%. n = very large number. Are my assertions right? Edit:My key doubt was, since computers use pseudo ra...
I am wondering how to calculate the number of spanning arborescences in a directed graph when a root is specified. For example: where there are 5 spanning arborescences. Note that there is an edge from b2 to b3 and one from b3 to b2. Angela Pretorius mentioned a method in Number of Spanning Arborescences, Mathematics,...
On our lecture slides we have two different notations of the gaussian function. First it gets introduced as follows: $$p(x_n|\theta) = \frac{1}{\sqrt{2\pi}\sigma}exp\{-\frac{(x_n-\mu)^2}{2\sigma^2}\} \text{ with } \theta=(\mu,\sigma)$$ But later it is used like this: $$\frac{1}{\sqrt{2\pi}\sigma}exp\{-\frac{||x_n-\mu||...
I have to prove that if a language $L$ is regular then: a) $NONPREFIX(L)=\{u \in L / $none of the prefixes (not $\epsilon$ or $u$) of $u$ are elements of $L \} $ is regular On this one I think I can divide the words of L in two parts and get it, since regular languages are closed under concatenation, I dont know if thi...
Typically, OCaml and Scala seem to be used for designing any programming languages tool. But what features offer them an edge over other languages. A related question, is a type system for a language always written in the native language itself?
So I recently came across Benford's law and immediately tried to code it out but the answer I got was rather confusing. I've been thinking about it for about an hour now and still can't get it, I think my code is correct I'm pretty sure it is but the result is just not the one others get. Here's the code: float[] a=ne...
Besides the fact that the real numbers ℝ go on forever whereas the floats only go up to a certain point (Float.MAX_VALUE) in Java, what else could I compare between these two sets of numbers?
I need to create a PDA that accepts by empty stack and accepts the language formed by strings over the alphabet $\{a, b\}$ of the form: $uw$, where $w$ is the string $u$ reversed and doubled. So, for example, if $u=ab$ then $w=bbaa$ (the $ab$ is reversed then its characters are doubled). Examples of strings in the lang...
I have this language: $L=\{x^ny^jz^k:k=j\cdot n\}$, I know I can use the pumping lemma for CFL, but I have managed to do it for $k, j, n \leq 0$, and with $k = j \cdot n$ I have not been able.
I am learning computational geometry by myself using these lecture notes from ETH Zurich. Here is an exercise (8.9) I have been stuck for a few days: For a line arrangement $A$ of a set of $n$ lines in $R^2$, let $F$ denote the union of the closure of all bounded cells. Show that the complexity (number of vertices and...
I'm looking for the correct terminology in regard to map (dictionary) data structure. When I'm talking about the semantics of the values stored in map in the direction from keys to values, I'd say, for example messages keys are mapped to message strings When I'm using the opposite direction - describing the values fi...
I was reading Ke chen's paper about coreset construction for K-median clustering. In this paper, he assumed that $A$ is an $[α, β]$-bicriteria approximation for K-median clustering for some $α, β=O(1)$. I am wondering if the construction still work if $A$ is an arbitrary set of $αk$ centers? Can anyone help prove the c...
I know that I can $(\lambda x.1) 0 \rhd_\beta 1$. This is the constant 1, but can I contract it automatically? I mean, is $1$ the normal form of $(\lambda x.1)$? It seems reasonable to do it but when goes to combinators this sense stops, I mean, if I can $\lambda x.1 \rhd_\beta 1$, then I would $\lambda xy.y \rhd_\beta...
I am struggling with the calculation of the worklist algorithm, I do not want to implement the iterative algorithm as so many redundant steps it takes. The algorithm I am following to calculate the worklist for live variables is as below Can anybody explain to me for my example given below, what would be my initial wo...
Given an array $S$ with $n$ real numbers. Design a linear time algorithm that finds $x,y \in S$ such that that $|x-y| \leq \frac{max(S)-min(S)}{n-1}$. I was thinking that it is similar to the closest point problem but that can only be solved in O(nlogn). Please help
I just got my master's degree in mathematics, it was related to abstract algebra. I'm thinking about applying for a doctoral degree, however, I deeply want to study something with an "applied" appeal. Does anyone know a branch of computer science that can be done by math students but that can still be considered math?...
You are given $n$ real (unsorted) numbers $_1,_2,...,x_n$. We want to compute the maximal difference between two consecutive numbers in sorted order. Explain how to do it in $()$ time when you are allowed to use additions, subtractions, multiplications, divisions and “floor” function. Notice that sorting immediately le...
Let's say we consider IEEE 754 double precision floating-point numbers, and we use RNTE - Round To Nearest, Ties to Even - rounding. I know that the RNTE rounding works this way: given two consecutive floating-point numbers, a and b, and a real number x, if a <= x < (a+b)/2, x gets translated to a if (a+b)/2 < x <= b,...
Let $X$ be a finite multisubset of $\mathbb{N}^2$. Let's introduce the following notation: $A$ is a set of all first elements of pairs from $X$ and $B$ is a set of all second elements of pairs from $X$. $cnt_1(n) = |\{(n, b)|(n, b) \in X\}|$ (that is a number of elements in a corresponding set). $cnt_2(n) = |\{(a, n)...
$P \ne NP$ would imply that any polynomial is a lower bound on the time complexity of any NP complete problem. Is some non-trivial lower bound known at all?
I have one formula that I do not understand why it is CNF and one that is not CNF, namely. p && !q (NOT NCF) and !!p(CNF). According to the exercise where I found these examples, 1 is not CNF and 2 is CNF. How can the first formula not be CNF, when for example p && q is CNF. If for example !!p is part of a formula ...
Now that Apple is switching the MacOS platform to ARM chips, much has been said about the benefits of ARM processors (they save energy, are passively cooled, and the Apple M1 seems to be faster than even an Intel Core i9 processor). I'd like to know what advantages of the x86 platform are left. Are there any specific c...
Given $n$ cities, describe a data structure which supports the following functions: Init$(n)$ - initializes the data structure in $O(1)$ Visit$(j,i)$ - adds "citizen from city $j$ would like to visit city $i$" in $O(1)$ Favorite($k$) - prints the $k$ most favorite cities in descending order in $O(k)$ (ignore ambiguity...
Before i explain exactly what i mean, let me just say that i never studied CS or low level programming, so i don't know much about the subject(I'm a self-taught JS programmer). To the point: Imagine you have a group of workers, you need to construct a work-schedule for. Each worker has "constrains", meaning days/shifts...
Let $(E,D)$ be a cipher with message space $M = \{0,1\}^n$ and key space $K = \{0,1\}^n$. Assume that there is an algorithm $A\colon \{0,1\}^n \to \{0,1\}^n$ of size $T$ that given an encryption of a message can guess the entire message with probability $0.2$. Namely, for a message $m \in M$ it satisfies $$P[A(E(k,m))...
There's a data structure that has the following operations: $\text{init}(n)$ - Initializes $n$ integer elements set to zero, $O(n)$. $\text{inc}(i)/\text{dec}(i)$ - Increments/decrements the element at index $i$ by one, $O(1)$. $\text{get}(i)$ - Returns the element at index $i$, $O(1)$. $\text{min}()/\text{max}()$ - R...
In the Art of Computer Programming, Knuth describes a computational method as a quadruple $(Q, I, \Omega, f)$ where $I, \Omega \subseteq Q$, $\Omega$ is pointwise fixed, and each $x \in I$ defines a sequence $x_0, x_1, x_2, \ldots$ such that $x_0 = x$ and $x_{k+1} = f(x_k)$ for $k \geq 0$. He notes that the sequence te...
I am currently working through Metaheuristics by El-Ghazali Talbi where he discusses encodings of algorithms. "Messy representations: In linear representations of fixed length, the semantics of the values is tied to its position in the string. In messy representations, the value associated with a variable is independen...
sort an array where $0\leq a_n\leq n$ sort an array where $0\leq a_n\leq n^2$(hint represent every element in base $n$) All the elements are integers for the first 1 I used counting sort and for the second one I thought maybe after changing to base $n$ using raddix? ONe more thing,i've been asked to prove correctness ...
Given a connected directed acyclic Graph $G=(V,E)$ and a subset $U\subseteq V$. Prove that if for every vertex in $G[U]$ with out-degree zero there is an edge in $G$ to every vertex in $G[V-U]$ with in-degree zero, then there is a path from every $u\in U$ to every $v\in V\backslash U $. I thought maybe to try a proof...
I am reading Data Structures and Algorithms by Alfred Aho, Jeffrey Ullman, et al. In the section about lists it's said: We should note that a position in a linked-list implementation of a list behaves differently from a position in an array implementation. Suppose we have a list with three elements a, b, c and a varia...
I am designing a algoritm for a game using a Monte Carlo tree search AI that I implemented. I play against another player and want to get the best move. Every time I do a move I completely build a new search tree and do as much iterations possible given a certain deadline. Is there a way to use the previous tree that I...
Consider (over $n$-bit strings) the uniform distribution $U$, and another distribution $D$ such that \begin{equation} \text{Distance}(D, U) \geq \frac{1}{e}, \end{equation} where $\text{Distance}$ stands for the total variation distance, given by \begin{equation} \text{Distance}(D, U) = \sum_{z \in \{0, 1\}^{n}} \left|...
In practice, the amortized O(α(n)) data structure is good for every case. But if I want to be pedantic and require each operation to be under a certain time complexity, what's the currently known best complexity, and is it optimal? The normal disjoint set implementation with recorded rank (height before optimization) c...
I'm looking for a solution to search for strings in a large text file. I would like to match strings with as many of those words in close proximity as possible. For example, if a query is for the string "what is the term for a supreme court justice" "a supreme court justice has lifetime tenure, meaning" "the term of j...
I need to provide one simple evidence that graph isomorphism (GI) is not NP-complete. I saw a number of papers on google scholar and answers on StackExchange. However, I have very limited knowledge of graph isomorphism, and I would like to just provide one simple evidence which I both understand and can explain clearly...
I'm interested in coloring a graph, but with slightly different objectives than the standard problem. It seems like the focus of most graph-coloring algorithms (DSATUR etc) is to minimize the number of color classes used. My goal, in contrast, is to maximize the number of color classes of fixed size N. As a concrete ex...
I have the following question, and I need to write it as an integer programming problem: A manager of a company wants to by presents to his 100 employers. He can buy the presents from two different suppliers: Every present costs 110\$. For any present above 500, the manager would have to pay 5\$ extra for insurance (f...
I'm looking for some tips on how to best implement the algorithm to accomplish the following: Imagine a 3×3 cube with a rubik's cube mechanism, i.e. you can freely rotate any of the 6 faces. You don't care about colors. Instead you index the component 26 cubes A–Z and ignore the middle. Illustration image (component ...
I got a question about who and how sets the transation function values in markov decision processes? I mean when some says that an agent, in real world grid, is going to step up by %80 and left/right by %10 each. How did he know that? Do we have to determine the transition probability for each step or agents have to? S...
So there was this question in one of my class tests. It may seem very simple and straight-forward, but I am unable to catch up with its meaning or explanation. I have referred my textbook of COMPUTER ORGANIZATION AND ARCHITECTURE by William Stallings. But that has just got me more confusing. The definitions according t...
I'm searching for an alogrithm that takes two strings, a query and a string that is to be searched for the query. The algorithm should result in a 'found' when the string contains the characters of the query in the right order but with any amount of other characters inbetween. Example: query:'abc', string to search: 'x...
It would be a mess if the answer had to be NO after all these speculations and theorems about these languages but.. I am not conviced liar paradox is well defined. And Godël himself said his theorem is just an exhibit of a liar paradox. I am not conviced halting problem is well defined. I am pretty conviced that if you...
According to Relations Among Complexity Measures by Pippenger & Fischer, the definition of an oblivious machine is: An oblivious machine is one whose head movements are fixed functions of time, independent of the inputs to the machine. In other words, a Turing machine $M$ is oblivious if and only if it exists a funct...
Not sure if this is the right place, but I guess it is better than Reddit and I couldn't find any discussion. I was wondering why Apple include a neural network "processor" and can't help but feel that is a waste as a prospective ML Engineer, so it is very likely that I am missing / in ignorance of something so wanted ...
Let $G = \{0, \cdots , p-1 \}$ be a field. Let $K = G^{m \times n}$ and $F:K \times G^n \to G^m$ be a family of functions. For $A \in G^{m \times n}$ and $x \in G^n$ we have $F(A,x) = Ax$. I need to check if $F$ is a secure pseudo random function. We say that PRF $H: K \times X \to Y$ is $(T, \epsilon)$-secure if for e...
Can someone recommend a graph theory textbook that covers treewidth thoroughly? Something that focuses on the graph-theoretic structure of bounded treewidth graphs rather than solving problems on them. Don't need the strongest/newest results but would prefer something that Preferably something that covers sublinear tr...
Suppose we have access to a stream of ordered pairs, where the $i^{\text{th}}$ element in the stream is an ordered pair $(a_i, b_i)$, where $a_i$ is a timestamp and $b_i$ is an arbitrary real. How can we design a data structure with the following two methods: $\mathcal{O}(1)$ insert Sublinear lookup to determine when,...
I need to prove that $\log\lfloor f(n)\rfloor = O(\log\lfloor g(n) \rfloor)$ if $f(n) =O(g(n))$. I know that if $f(n) = O(g(n))$ then $\log f(n) =O(\log g(n))$, but I can't prove the current statement because it involves the floor function.
I have a graph with average degree $n/2$. How I can find an approximation algorithm for the longest path problem with factor $1/4$?
in my beginner’s computer science class, we are asked to create an bot for a variant of rummy. It has to make logical moves as it needs to beat other very simple bots. I wanted to know how you would go about coding such program. From what I’ve seen in a few Google searches, people seem to rely heavily on decision trees...
If a set of numbers $a_1, a_2, \cdots, a_n$ $($such that each $a_i \in \mathbb{N} \cup \{0\})$ and an $r \in \mathbb{N}$ are given, find set $X = \{x_0, x_1, \cdots, x_r \ | \ x_0 = 0 < x_1 < \cdots < x_r = n\}$ such that $f(r,X) := \displaystyle\max_{j=0}^{r-1} \sum_{i = x_j}^{x_{j+1}-1} a_i$ is minimized over all pos...
I know it is true that if A is not in P, and A reduces B, then B is not in P. But is it true for NP as well? If A is not in NP, and A reduces to B, does this mean B is not in NP? Why or why not? Thanks!
Given the theorem: Let $\Sigma$ be an alphabet. The set $\mathcal{P} \left( \Sigma^{\star} \right) $ is uncountable. In other words, there are uncountably infinite languages over any alphabet. Can someone explain to me how does it hold for $| \Sigma | = 1$ ?
In my books it is written that the concept of pipelining can happen only with Harvard structure as CPU can both fetch data from and write back data to memory at the same time my question is how can fetching and writing back be done at the same time when there is only one bus for data just like von Neumann structure? Ho...
Say we have a number of start strings (green) and a number of target strings (red). Two strings can always be concatenated to a new string which can then be arbitrarily often reused (two arrows in, (1,∞) arrows out). A string can also be concatenated with itself. Is there an algorithm that can tell if this is the DAG ...
I am wondering if Rice's theorem (or something similar to that) applies also to sequential circuits. I.e. given any finite sequential circuit, can there be an algorithm that can formally verify any property of this circuit? I'm thinking yes, because the number of latches is bounded, so is the number of states. Even if ...
I am trying to work my way through some computer science training and I am not able to properly understand the following pseudo code: COUNTING-1 (n) cost times 1 for r=1 to n c1 n+1 2 for c=1 to n c2 n(n+1) 3 sum = sum+1 c3 ...
There is trivially $\emptyset\in\text{NP}$. From the definition of $\text{co-NP} = \{L : \overline{L} \in \text{NP}\}$ where $\overline{L} = \{0, 1\}^*-L$ follows $\{0, 1\}^*\in \text{co-NP}$. Is this true? If so, it is also true that $\{0,1\}^*\in \text{NP}$?
In a setting where I have n clients each owns a subset of the dataset, each computes the mean and variance on his data and send them to the server. The server would average all means and variances. For mean, I simply do the averaging by: $\mu = \frac{\mu_1+\mu_2+.....+\mu_n}{n}$ However, for the variance, I can't figur...
Consider an undirected graph $G$. A subset $S \subseteq V(G)$ is n-dependent if for every $x \in S, d_{<S>}(x) \leq n-1$. The n-dependence number of $G$, denoted $\beta_n(G)$, is maximum cardinality of an n-dependent set of $G$. That is, the n-dependence number of $G$ is the maximum cardinality of a subset of vertices ...
I did some basic research on regular lossy and lossless compression algorithms but somehow I couldn't really figure the right direction for the information I need. My basic problem is that I would like to compress a series of numbers with an unknown number of data points (can be 10, can also be a 1000). The numbers the...
We have a weighted graph, where each node is a city. And the edges between the nodes are a pair of floating-point values (distance and cost of travel). Given a node/city, describe an algorithm that can find the path with the largest distance/cost ratio from said node/city. Note that the path can traverse multiple nodes...
There is plenty of algorithms available online, but they do things exactly opposite of what i need: Find longest path in a graph between any nodes. Do not remember the path, just weight. I need an algorithm that can return both weight and path itself. I have tried two things so far: Dijkstra's algorithm with negativ...
I want to find a solution to a problem that asked before. in the following question: https://stackoverflow.com/questions/43435799/path-with-the-minimum-number-of-alterations-in-graph-with-colored-edgest I have a directed graph with colored edges (red & blue) that may contain cycles. The question is to write an algorit...
This might be a trivial question, but I have the following problem: I want to (perfectly) hash a number of lists of integers of length $n$, with all entries between $k_{min}$ and $k_{max}$. How can I construct a perfect hash function $h$ that takes such a list and outputs an $m$-bit number where $m$ is as small as poss...
By the definition, in an Interactive Proof system the verifier is allowed to generate random numbers, which allows the omniscient prover to not fool it in the vast majority of cases for every problem in $\mathsf{PSPACE}$. The verifier is a polynomial time machine, therefore an ability to generate random numbers makes i...
A Knowledge Proof is a mechanism by which a 'prover' entity can show to a 'verifier' entity that it possesses some certain information without revealing what that specific information is (within some arbitrarily small tolerance of certainty). Is it possible for a 'prover' to show to a 'verifier' that it does not posses...
Regarding the difference between Two Vs Dual Port RAM Here is what I understand: The first can read and write at the same time but can't read twice or read twice at the same time while the second can read and write, read twice or write twice. Is this correct? Plus, Is this connected to software or hardware, let's suppo...
Given below is a question from $\text{GATE } 2015 \text{ CS}$ paper, Consider the sequence of machine instruction given below: \begin{array}{ll} \text{MUL} & \text{R5, R0, R1} \\ \text{DIV} & \text{R6, R2, R3} \\ \text{ADD} & \text{R7, R5, R6} \\ \text{SUB} & \text{R8, R7, R4} \\ \end{array} In the above sequenc...
Consider the language $$ L = \{ w : w \in {0,1}^* \text{ and } w \text{ doesn't contain } 0110 \text{ as a substring.} \} $$ What is a regular expression for this language? I thought of $1(1)^*0(0)^*$. But this seemed to not contain any strings starting with $0$. If I do $1(1)^*0(0)^* | 0(0)^*1(1)^*$ then it can contai...
A language is a collection of strings--assuming we have an infinite number of words then concatenating this collection (keeping things simple, normally you need to at least be able to tell where one word ends and another begins) and viewing the language as the resulting single big string, if the Kolmogorov complexity ...
I was solving problems related to P and NP where I encountered the following problem: Given a standard definition of NP, if x belongs to L then there exists y such that |y| <= |x|^d and A(x, y) = 1; if x does not belong to L then for every y with |y| <= |x|^d we have A(x, y) = 0. 1. what is the new class formed when...
Basically, most of the definition for disjointness are such that $DISJ(A, B) = 1$ if $A \cap B = \emptyset $ and $DISJ(A, B) = 0$ for other case. My confusion is how is $0$'s influence in here. For example, is all-zeros string considered as $\emptyset$ and therefore the result will be $1$ no matter what the other strin...
A lot of the work in data science -- machine learning in particular --involves "reshaping" arrays, tables, and other data structures. These data transformations are not really lossy transformations (except for subsets/selective views), but rather simply getting existing data into a different form acceptable to existin...
I have a question regarding the following sentence: So we can make the following expressions: The best case running time of LINEARSEARCH is a constant function $T(n)=a$ OR $Θ(1)$ The worst case running time of LINEARSEARCH is a linear function of $T(n)=an + b$ OR $Θ(n)$ Merging them together, the running time of LINEA...
Let $\mathcal{C}$ be a basic complexity class (such as $\mathrm{NP}, \mathrm{PSPACE}$). And $\mathcal{C}$ is closed under a reduction "$\leq$" (such as polynomial time many-one reduction "$\leq_{m}^{p}$", polynomial time Turing reduction "$\leq_{T}^{p}$"). Suppose that a decision problem $L \subseteq \Sigma^{*}$ is com...
I want to create a finite state machine that accepts the following language: $$ L=\{w\in\{a,b\}^* | w \text{ contains abb but not on the first position}\} $$ So I began by writing a regular expression from this and this is what I came up with: $(a+b)(a+b)^*abb(a+b)^*$ And for the finite state machine I tried to do this...
So far i've tried with making x = z = p and y = 2*p, but it seems that if I place vxy to represent all b's then I can't get a contradiction.
I have a system that consists of binary inequality constraints between variables, plus some indicator variables that can assume only two values: a, b, c, d ⊆ ℝ i ⊆ {true, false} // unconditional inequality constraints a < b // conditional inequality constraints i -> b < c i -> b < d !i -> b > c !i -> a < d and I wou...
Here is a short description of my problem: Part of my objective function is not a regular function. Instead it's a table. You can see a short extract here: So if the height is smaller or equal to 300 and the length is between 301 and 345 (including 345) the price is p2. My first idea was to create a boolean variable:...
How can an NDTM have a growing number of branches as you feed larger and larger inputs with only finite number of transition rules specified--ie what is the relationship between the number of branches and the number of transitions? An NDTM has a finite number of states, a finite number of input symbols and a finite num...
I take occurrence typing to be typing that "... allows the type system to ascribe more precise types based on whether a [check] succeeds or fails." (adapted from the Racket docs with "predicate check" replaced with "check") Here's a TypeScript example: function foo(x: string | number) { switch (typeof x) { ...
I'm trying to figure out an efficient way (without recursion) to convert a string (number representation) from one arbitrary base to another using custom alphabet. But I cannot think of a very fast efficient method (byte shift?) to do it: def convert_base(target, base_from, base_to): alphabet = '0123456789ABCDEFGHIJK...
How can one show that the counting problem: Given a graph, output the number of perfect matchings Is self reducible? I found a hint in Moore's Chapter on Counting, Sampling and Statistical Physics: Let G be a graph and e one of its edges. Show that we can modify G to produce two graphs, G0 and G1, such that the numbe...
Suppose I wish to show that my decision problem $Q$ is NP-Hard. Why do I need to reduce from one problem $Q'$ of known hardness ? Consider for instance the following situation: Here, I have my set NP of problems, where problems $A$ and $B$ were proved to be NP-Complete through direct proof, and problems $C$, $D$, $E$,...
If you were given a state transition diagram could you tell, just by looking at the diagram, if the diagram represented a DTM or a DFA (especially if it was unlabeled, just a directed graph)? Would there be any difference between the diagram representing the deterministic Turing machine and the diagram representing the...
I have two queues of jobs and each job consists of the pair (utilization %, time to complete). I have one machine and its utilization cannot exceed 100%. The first job in a queue must be completed before the second one can be started (and so on). What is an algorithm to find the best schedule for these jobs so that the...
A directed graph is said to be oriented if for all edges (i, j), (j, i) is not an edge. In other words, the binary relation defined by the edges is asymmetric. Given a strongly connected directed graph, you have to find whether there exists a spanning oriented subgraph which is also strongly connected. In other words, ...
I keep seeing 3 X 8, 4 X 16, etc. kind of decoders explained on youtube 4 is the input (address bus) and 16 is the output. 4 X 16 can only access 16 unique addresses. What if I have thousands of memory address like 4096, 65,536, etc. How many address bus and output is required in these decoders? . . . . If I put 12 bit...
I need to find out if the following problem is decidable: Given a context-free language $L$, decide whether its complement $\bar{L}$ is also a context-free language. I am having trouble in defining the $TM$ I need in order to solve this problem. My thinking was to see if it is possible to construct a $TM$ that takes ...
Without going into details about my life's story, here's the basic facts: I grew up with 386 and 486 and Pentium PCs running MS-DOS 5 (I believe), Windows 3.1 and Windows 95, a well as various game consoles from the 8-bit, 16-bit and 32-bit eras. I have almost none of them left, and what's more, most game cartridges a...