instruction
stringlengths
35
29.1k
Below is a well-known equation for generalized recurrence relation in a divide and conquer paradigm (as described in CLRS) -- $$T(n) = aT(n/b) + f(n), \quad \text{where} \quad a \gt 1 \text{ , } b \geq 1$$ If we consider a case for merge-sort, the relation will look like this -- $$T(n) = 2T(n/2) + \Theta(n) \qquad \qq...
I just not sure does empty set have a context-free grammar in Chomsky normal form? That is, for $B=\emptyset$, then a context-free grammar is $S \to S$, I think which doesn't have a Chomsky normal form. I am not sure. Can some one explain?
Given an array of integers. Find two disjoint contiguous sub-arrays such that the absolute difference between the sum of two sub-array is maximum. The sub-arrays should not overlap and it can not be empty. eg [2 -1 -2 1 -4 2 8] ans (-1 -2 1 -4) (2 8) diff = 16 Better than $\mathcal O(n^2)$ solution was expected.
Searching for a number in an array is said to have a runtime of O(n) because there may be cases where the number doesn't exist in the array. In such cases, you'd have to have gone through the entire array, which is O(n). But how about in the case where we know the number definately exists in the array? Does the runtime...
During my involvement in a course on dealing with NP-hard problems I have encountered the PCP theorem, stating $\qquad\displaystyle \mathsf{NP} = \mathsf{PCP}(\log n, 1)$. I understand the technical definition of a PCP verifier, so I know in principle what kind of algorithm has to exist for every NP problem: a randomi...
This is somewhat related to another question I asked, but I feel it's different enough to warrant its own question. I'm doing research where I'm trying to find the structure of complements of a certain class of finite languages. It's easy for me to get the minimal DFAs accepting these languages, but I'd like to examine...
When calculating runtime dependence on the input, what calculations are considered? For instance, I think I learned that array indexing as well as assignment statements don't get counted, why is that?
These are 5 action descriptions with conditional effects: Action(A, Precond:{X}, Effect:{when P : ~X), Z}) Action(B, Precond:{Y}, Effect:{when Z : ~P), ~Y,~Z,X}) Action(C, Precond:{~Z}, Effect:{when P : ~X), Y}) Action(D, Precond:{~X}, Effect:{when Q : X)}) Action(E, Precond:{Z}, Effect:{when Q : ~Z)}) What state wou...
I have the notion of a social network which is robust against malicious attacks from the outside. My vision is a system that is structurally built up as a distributed network of equal servers that operate on the same data and offer the identical services. Users should all interact on the same network, independent of th...
We are given an array $a[1 \ldots n]$ with all $a[i]>0$. Now we need to find how many distinct sums can be formed from its subarrays (where a subarray is a contiguous range of the array, i.e., $a[j\ldots k]$ for some $j,k$, the sum is the sum of all of the elements of the subarray). For example, if $a=[1,2,1]$, then th...
Is there an efficient algorithm which gives the minimum cost closed walk in an undirected graph, which visits all vertices? Does this problem have a name? I tried to reduce this to similar problems (in particular the traveling salesman problem) to see if it was NP-hard, but was unsuccessful. Here's an example: Then a ...
Given a set $S$ of $k$ numbers in $[0, N)$. The task is to randomly generate numbers in the range $[0, N)$ such that none belongs to $S$. Edit - Also given an API to generate random numbers between $[0, N)$. We have to use it to randomly generate numbers in the range $[0, N)$ such that none belongs to $S$. I would als...
There is a river which can be considered as an infinitely long straight line with width W. There are A piles on the river, and B types of wooden disks are available. The location of the $i$-th pile is $(X_i, Y_i)$. The $i$-th type of wooden disks has radius $R_i$, and its price is $C_i$ per disk. Disks can be placed on...
I know that for executing a program, it should be copied to RAM. But the problem is whole of it may not be copied always. Since the size of the RAM is limited, there is mechanism called virtual memory. If the addressed thing is not in memory, a page fault occurs and the data is copied to the RAM. My question is who ke...
It's known that the complement of a DFA can be easily formed. That is, given a machine $M$, we can construct $M'$ such that $L(M') = \Sigma^* \setminus L(M)$. Is it possible to construct such a complement for a non-deterministic finite automation (NFA)? To my knowledge, it isn't.
I am reading about dependent types theory in the Homotopy Type Theory online book. In section 1.3 of the Type Theory chapter, it introduces the notion of hierarchy of Universes: $\mathcal{U}_0 : \mathcal{U}_1 : \mathcal{U}_2 : \cdots$, where every universe $\mathcal{U}_i$ is an element of the next universe $\mathcal{...
I am trying to understand interactive proof systems and tried the following problem as an exercise. We know that $PH \subseteq PSPACE$ and $IP=PSPACE$, so come up with (easy to understand) interactive proof systems for $PH$? An interactive proof system for $NP$ is trivial, but I failed to get an interactive proof syste...
We mostly write programme in high level language. So while studying I came across assembly language. So an assembler converts assembly language to machine language and a compiler does the same with high level language. I found assembly language has instructions like move r1 r3 , move a 5 etc. And it is rather hard to s...
I have about $500000000$, $64$-bit integers, so these numbers are very large. I want to sort them as quickly as possible. I have couple of questions: What data structure do you suggest for storing this data? What algorithm do you suggest for sorting these numbers? I'm concerned about speed.
does $BPP\subseteq P^{NP}$ ? it seems reasonable but I don't know if there is a proof of this!could any one post a proof or any material that discusses the statement or something that look like this .
Recently I have had this question in one of my interviews. You have 1 Million sorted integer, you have a value of $x$, compare each pair in this array and if the addition of two pair is less or equal to $x$ then increment the paircounter. I have implemented this solution in C++ however I will write pseudocode here(I am...
How can I solve $\mathcal{O}$-notations without using Java or any other programming language? I only want to use pen and paper.
In Andrew W. Appel's book, Modern Compiler Implementation in ML, he says under chapter 17 that Computability theory shows that it will always be possible to invent new optimizing transformations and proceeds to prove that a fully optimizing compiler will solve the halting problem: A program Q that produces no output an...
I am given an undirected tree $T$ in the usual graph theoretic sense. Given a vertex $v$ and an edge $(v,u)$ incident to $v$, I need to answer queries of the form return any leaf of $T$ that is reachable from $v$ with a path including $(u,v)$, and no other edges incident to $v$? More informally, the restriction is that...
Suppose I want to write a classical software simulator of a quantum circuit with $N$ qubits. When it comes time to simulate the quantum Fourier transform I can evaluate all $2^N$ states to determine the probability amplitudes, and then perform a Fast-Fourier Transform on the probability amplitudes in time $o(N 2^N)$. ...
If a school has an IP that's like 10.0.x.x, and a department in that school has it's own site that's an extension of the school's site, does that department's IP just change the last two numbers in the IP? Does the school have to purchase extra domain space? Could I have additional addresses established at my IP addre...
I'm looking for a context-sensitive grammar that describes the following language: $L = \{ ww \mid w ∈ \{a,b\}^{\ast}, |w| ≥ 1\}$ . I've got problems with the fact that no rules such as $X \to \varepsilon$ are allowed and therefore I can't place any nonterminal indicating the "middle" of the word. Is there any trick t...
I'm trying to find parameters $\omega, \alpha,$ and $\beta$ which maximize $$ \sum_{i=1}^m{\left\{ -\ln(v_i) - \frac{r_i^2}{v_i} \right\}} $$ where $$ v_i = \omega + \alpha r_{i-1}^2 + \beta v_{i-1}^2 $$ Since numerical values for $r_i$ and $v_1$ are given my first thoughts were to use the normal equation $$ \Theta =...
I have many vectors in my database. They are in high dimensions such as: $v_1$ : $\langle 23, 23, 1, 33, 103, 219, \dots \rangle$ $v_2$ : $\langle 92, 83, 1, 33, 239, 192, \dots \rangle$ ... I will use Hamming distance to calculate their difference: The difference between $v_1$ and $v_2$ is $4$ because elements $3$ a...
My problem. Given $n$, I want to count the number of valid multisets $S$. A multiset $S$ is valid if The sum of the elements of $S$ is $n$, and Every number from $1$ to $n$ can be expressed uniquely as a sum of some of the elements of $S$. Example. For example if $n=5$ then $\{1,1,1,1,1\}, \{1,2,2\}, \{1,1,3\}$ are ...
I try to understand why fragmentation is a problem for NTFS and FAT but not when using inodes. In all cases, files are not necessarily stored in a contiguous fashion so I don't see the problem for the former two. So where is the crucial difference?
I'm trying to proove $NP$-membership for a problem from the following certificate. I have $n$ sets of integers : $$(S_i)_{i \in \{1,\dots,n\}}$$ Each set has a number $m_i$ of integers. I make "combination" from those sets by taking at most one element in each set. A "combination" has between $0$ and $n$ elements (assu...
A question about Laplace's approximation: In Laplace's method, we need to find the mode of a function and take second order Taylor's expansion. The first order term will vanish (since the gradient is zero at local optimum), and the second order term will be used to give a covariance of the gaussian. I am wondering if I...
The global alignment problem can be generalized by setting the cost of some boundary gaps to 0. Gaps at both end in both strings have 0 cost, then we get the semiglobal alignment. Gaps are at the left end of the first string, and right end of second string have 0 cost, then we get overlap alignment. If both boundary g...
Specifically: 1) A direct-mapped cache with 4096 blocks/lines in which each block has 8 32-bit words. How many bits are needed for the tag and index fields, assuming a 32-bit address? 2) Same question as 1) but for fully associative cache? Correct me if I'm wrong, is it: tag bits = address bit length - exponent of ind...
I'm currently working on my masters thesis, and it's about clustering on graphs. I'm working with an idea using ants to solve the problem. I'm currently working on the implementation and am wondering exactly how well to represent the edges of the graph. Each edge is augmented with certain information such as its phero...
I have a real function $f:\mathbb{{R}}^{d}\mapsto\mathbb{R}$, where $d>1$. The question is how to compute the level set $A=\left\{ \theta:f\left(\theta\right)\geq a\right\} $. I am a statistician knowing very few things about computer science. I would appreciate very much if anyone could suggest some reference, methods...
Given a linear system of the form: $$\begin{array}{c} x_r = a \quad x_j = b \\ c_1x_1 + c_2x_2 + \ldots + c_nx_n = N \\ x_1+x_2 + x_3 + \ldots + x_n = k\\ 0 \le a,b,x_1,x_2,x_3...x_n \le 1\\ k \ge 0 \end{array}$$ How quickly can the feasibility of the system be checked? To clarify: $x_r,x_j$ are members of $x_1,x_2...x...
I've constructed an algorithm that solves the 3SUM problem in $O(n\lg n) + \frac{n^2}{4}$ time. I'm new to algorithms and was wondering how good is my running time? Googling didn't help. thanks..
Let there is a binary-string, $B$, of length $N$. The probability of occurrence of 0 and 1 in this binary-word is $p$ and $q$ , respectively. Each bit in the string is independent of any other bit. There is an algorithm (divide and conquer) which finds the location of 1’s in a given binary-string, in Q # of steps (cos...
I'm attepting to model a process flow where the transition to the next state is occasionally based on not only the input to the current state, but a prior state as well. Below is an example graph descibring the process. The essence is: If both State Q1 and State Q3 recieve an input of one, after State 3, transition to ...
The paragraph on V-opt heuristic TSP algorithms at this site mentions a very effective algorithm due to Lin-Kernigham-Johnson. That page says: For many years Lin–Kernighan–Johnson had identified optimal solutions for all TSPs where an optimal solution was known and had identified the best known solutions for all othe...
The problem is from CLRS 9.3-1: In the algorithm SELECT, the input elements are divided into groups of $5$. Argue that SELECT does not run in linear time if groups of $3$ are used. If we do the "divide by $3$" technique, we will come up with this recurrence -- $$T(n) = \begin{cases} \Theta(1) & \text{if $n \le K$}...
Is $L = \{A^n B^n C^n \mid n \in \mathbb{N}\}$ a context-free language, e.g. $AAAABBBBCCCC \in L$ If so, what's that context-free grammar that produces it?
I am trying to solve the question 6.12 in Arora-Barak (Computational Complexity: A modern approach). The question asks you to show that the $\mathsf{PATH}$ problem (decide whether a graph $G$ has a path from a given node $s$ to another given node $t$) which is complete for $\mathbf{NL}$ is also contained in $\mathbf{NC...
For a language L we define: $\qquad A(L) = \{ x \in L \mid \text{ no proper prefix of x is in L} \} $ Are regular / context free languages closed under this operation ? For regular languages I thought about taking the DFA that accepts the language L and create a new NFA by making all accepting states sinks (so the on...
I've written a recursive-descent parser generator, and I'm trying to classify it (call me a cowboy coder if you must). According to wikipedia, S → 0S0 | 1S1 | ε, which checks for an even-length palindrome, is a non-deterministic grammar. My parser generator can handle this grammar. Does that mean my parser is non-deter...
I've been using Clojure for about 18 months. Recently, I've come across terms such as Monads, Continuations, et al which I'd like to learn about. I could visit Wikipedia and read about these two topics, but I'm looking for a reference which also help me learn about related matters that I don't even know exist. Is there...
I realize non-deterministic pushdown automata can be an improvement over deterministic ones as they can "choose" among several states and there are some context-free languages which cannot be accepted by a deterministic pushdown. Still, I do not understand how exactly they "choose". For palindormes for example every so...
Suppose that I have run maxflow algorithm on a graph G and, as a result, I have a set of edges with flow on them. I would like to enumerate all possible sets of paths that comprise the maxflow. That is, each set of paths will make the max flow. But I suspect there could be multiple set of such paths.
(It might be useful to refer to page 9 of Multi-Armed Bandit Allocation Indices by Gittins, Glazebrook and Weber if you have it, because there explanation will be much better than mine.) I'm trying to write a program that finds that optimal expected reward for a 2-armed Bernoulli bandit process where the first arm has ...
I need to know if the following problem is $NP$-complete. The data are as follows : $n$, number of items $\{s_{i}\}_{i \in \{1, \dots n\}}$, item sizes, sorted by ascending values. $S$ knapsack capacity. $T$ a lower bound on the value to be attained. Now, for each $i \in \{1, \dots n\}, c_i = \log i $ is the value o...
In other words, can a programming language be referentially transparent even if not everything is an expression? And can you say that if in a programming language, everything is an expression, then it is referentially transparent?
I've got the following theoretical problem which puzzles me a bit: I can obtain a string of n bytes (as octets, one byte = one octet = eight bits) of random data. I need to preserve the randomness while reducing the base from 256 to x where x is below 256 (and not 0, 1, 2, 4, 8, 16, 32, 64 or 128). As I want to preserv...
Assume I have producer and consumer in a monitor. The code of the consumer signals the producer and then does something else. I know in a Hoare-style monitor, after signaling, the thread that is signaled wakes up and is is now schedule. What about the other instructions in the consumer after the signal? When will the ...
I'm trying to create simple tokenizer to transform following (only part shown) search expression to tokens word1 near(1) word2 where word1, word2 are some words and near(1) is distance operator. The question is how this expression should be tokenized. I see two ways 1. <WORD, word1> <WORD, near> <LPAREN> <NUMBER,1> <...
A team has decided that every morning someone should bring croissants for everybody. It shouldn't be the same person every time, so there should be a system to determine whose turn it is next. The purpose of this question is to determine an algorithm for deciding whose turn it will be to bring croissants tomorrow. Cons...
I got a very hard automatically clustering problem with some training data (500 samples, each with roughly 5-50 classes and 10000-20000 data points in total). What I need to do is to cluster an input into multiple classes (the number of classes is unknown). So far I had some several clustering algorithms, each gives m...
My task is to design a FSM whose output goes high for a single cycle whenever the pattern 0110 is detected on its input. The patterns may overlap, so an input 0110110 of would cause the output to go high twice- once for the first pattern (0110110), and once for the second pattern (0110110). a is used for the input and ...
In FIFO: when process get cpu time and then go to IO. What happend in the time it is in IO? another process can run? After finishing IO it continue or "loss its turn"? Why FIFO give priority to cpu bound process? In RR: assume slice time is s and after (s-2) for eample it get IO, what happend with the 2 other seconds?...
$f(n) = 3n+3$ ; $f(n) = O(n)$ By definition : $3n+3 \leq c_1.n$ By dividing both side by $n$ $3+\frac{3}{n} \leq c_1$ means we are getting constant range for $c_1$ for any $n$. Again it shows $c_1$'s value must be greater than $3$ at any cost. e.g. if we take $c_1$'s value 3.5 so $n$'s value will be $6$. Now if we pl...
I've been reading about the differences between serializability and linearizability, which are both consistency criteria for replicated systems such as replicated databases. However, I don't know in which cases linearizability would be needed, even though it's stronger than serializability. Could you come up with scena...
From TAoCP, Vol. 3 by Knuth we know that expected (mean) probe counts for hash tables with open adressing and double hashing collision-resolution are: $1 \over 1 - \alpha$ - for unsuccessful search ${1 \over \alpha} ln({1 \over 1 - \alpha})$ - for succesful search Where $\alpha$ is load factor. Are there expressions ...
I am confusing with the following example. $n^{1.001} + n\log n = \Theta ( n^{1.001} )$, why not $n\log n$? $c_1 \le \frac{\log n}{n^{0.001}} \le c_2 $ OR $c_1\le \frac{n^{0.001}}{\log n} \le c_2$ For me both are same. Means both are giving some constant range for $c_1$ and $c_2$. $10 n^3 + 15 n^4 + 100 n^2 2^n = \...
In the web draft of Arora and Barak, "Computational Complexity: A Modern Approach", the way I understand their definition of a round of interaction is that it consists of either the verifier or the prover sending a message. In other sources on the matter, it seems to me that a round consists of both the verifier and th...
I have made a connect four game in JS and currently have a functioning minimax algorithm. The problem I'm having is that it is very, very easy to beat, even with a large depth. This is leading me to believe that I need a better heuristic function, but I cannot come up with much better than what I already have. So, I th...
I'm wondering, what is the time-complexity of determining emptiness for 2-way DFAs? That is, finite automata which can move backwards on their read-only input tape. According to Wikipedia, they are equivalent to DFAs, though the equivalent DFA might be exponentially larger. I've found state complexity for their complem...
When we talk about distributed computing - it often refers to problems in biology or web search where there is a large quantity of data to process, or email where there is a large number of concurrent users. Often in financial services, the problem space is OLTP for online banking, or overnight batch processing for su...
For a regular language $L$, its DFA complexity is the size of the minimal DFA accepting it, and its NFA complexity is the size of the minimal NFA accepting it. It is well-known that there is an exponential separation between the two complexities, at least when the size of the alphabet is unbounded. Indeed, consider the...
Let $A$ be an array of totally ordered elements. A subarray $A[i..j]$ is decreasing if $A[k]\geq A[k+1]$ for all $i \leq k < j$. It is increasing if $A[k]\leq A[k+1]$ for all $i \leq k < j$. It is monotonic if it's either decreasing or increasing. We call an array is $k$ monotonic if the array can be partitioned into ...
Full disclosure, I'm interested in what this means about transformations on NFAs, but regex expressions seem like a easy way to ask the question. If you have a regex that uses the plus operator (match one or more) can it, in the general case, be transformed into a regex that uses only the star operator (match zero or m...
What is the worst case running time to search for an element in a balanced binary search tree with $n 2^n$ elements? The answer is $\Theta(n)$. My answer: To search an element in BST is $\log (n)$ so $$ \begin{align*} \log(n 2^n ) &= \log(n) + \log(2^n) \\ &= \log(n) + n\log 2 & \text{(base is 2)} \\ ...
Let $W(n)$ and $A(n)$ denote, respectively, the worst case and average case running time of an algorithm executed on an input of size $n$. Which of the following is always true? (A) $A(n) = \Omega(W(n))$ (B) $A(n) = \Theta(W(n))$ (C) $A(n) = O(W(n))$ (D) $A(n) = o(W(n))$ Answer: (C). What do all these options "mean"...
I want to begin by saying that this is NOT a homework question. I am reading Introduction to Algorithms - the famous CLRS text to become a better programmer. I am trying to solve the problems and exercises given in the book by myself. I am trying to solve Excercise 10.1-2 from Chapter 10 Elementary Data Structures fro...
I understand that fuzzy clustering using FCM produces a membership matrix for the set of data points we feed to it. What characteristics will an anomalous cluster produced during this method have? (Considering I only have unlabelled data)
I'm studying randomized algorithms and I sometimes come across results like (1) The algorithm has an expected $O(f(n))$ cost. and (2) With constant probability, the cost is bounded by $O(f(n))$. I'm perfectly fine with statements like (2), but I'm puzzled to what extent a statement like (1) is useful: For certain ...
I have an assignment to do and I'm quite stuck with the following question : Use Rice's theorem to show that $ \qquad L' = \{ \langle M \rangle \mid \; (\exists \text{ TM } M') \; [ L(M') = L(M) \text{ and } M' \text{ has less than 29 states} ] \}$ is undecidable. I have absolutely no idea how to proceed. Would someo...
Now I am confused about symbolic execution (SE) and reachability analysis (RA). As I know, SE uses symbols to execute some code to reach each branch with branch conditions. And RA can be used to find the reachability of each branch, right? When RA is used, we can extract the branch condition for each branch. If so, wha...
My similarity search seminar topic are M-trees. I would like to give some examples about where they are practically applied, but I can't find anything googling. Does someone know if M-trees are still used and what for? I am interested in answers regarding both practice and applied research.
Consider 2 stations that share the same bus. Both stations are perfect synchronized each other and when they have packets to transmit, they are starting the transmission in the beginning of a same slot. Transmission is as follows: when base $i$ has a packet to transmit attempts with probability $p_i, i=1,2$. Different ...
This is a practice problem for a midterm in a class I'm taking: Given a regular language $L$, describe formally a Turing machine that recognize $L$. I'm not sure how I should do that.
The Kurose & Ross book uses "store-and-forward delay" as a synonym for the transmission delay of a packet over a network link. As a newcomer to computer networks, it isn't immediately obvious to me how these two terms are synonymous. My current understanding is that if not for the store-and-forward behavior of packet ...
I just had a CS mid-term and one of the questions was: OOD allows ADTs to be created and used. True False I answered false, but my answer was marked as incorrect. I suspect what the question means is "objected-oriented design can be used to implement abstract data types", but if that's what it means it seems very c...
Is developing an optical character recognition system for an alphabet which has no previous ocr considered a reputable conference or journal worthy research project, given the fact that there are so many commercial ocr system? Though, lots of conference proceeding and journal entries shows up when googled, but most of ...
Grover's algorithm uses an oracle function $f(x) \to \{0,1\}$ to find the location of a single marked element from an unordered database of $2^n$ elements with high probability. As part of an assignment I am supposed to design a variant of the algorithm that finds all of the $t$ marked elements ($t$ is known). I want t...
I am trying to learn how to build parse trees. This is a very simple example as I am hoping I can catch on to the concept. $\mathtt{y=x+z}$ Wouldn't this simply require $\mathtt{(term) = (term) + (term)}$? I'm not sure how to express my answer on here but would it only require one branch due to the $\mathtt{=}$ sign?...
I have a constrainted optimization problem in the (Shannon) matrix entropy $\mathtt{(sum(entr(eig(A))))}$. The matrix $A$ can be written as the sum of rank 1 matrices of the form $[v_i\,v_i^T]$ where $v_i$ is a given normalized vector. The coefficients of the rank one matrices are the unknowns in which we optimize and ...
In these notes about quantum computation by Scott Aronson, he explains that the computation classes $\mathsf{BPP}$ is contained in $\mathsf{BQP}$, but that they are not equal, and So, the bottom line is that we get a problem -- Simon's problem -- that quantum computers can provably solve exponentially faster than clas...
Suppose, we have an array of numbers $x_j$ and their corresponding weights $w_j$ where $\sum_j w_j \gt 1$. Now we need to find $x_m$ such that $$\sum_{j=1}^{m-1} w_j \lt 1/2 \quad \text{and} \quad \sum_{j=m+1}^{n} w_j \ge 1/2$$ Moreover, $x_m > x_j$, $x_m < x_k$ where $j \ne k$. i.e. a solution should be like this -- ...
I am having a little trouble understanding what is meant by a poly-time reduction. Suppose I have two algorithms $A$ and $B$ and then I say that $A$ is reducible to $B$. Does polytime reduction mean that the algorithm that solves $A$ using $B$ as a helper runs in $O(n^k)$ for some $k$? So for example suppose: $A$ is an...
There are a number of collections of network (or graph) data sets freely available on the web, e.g. http://snap.stanford.edu/data/index.html http://www.cc.gatech.edu/dimacs10/downloads.shtml I am looking for dynamic network data sets, i.e. networks whose structure varies over time. They seem to be quite rare: The SNA...
Consider the following functions $f(n) = 3n^{(n^{1/2})} $ $g(n) = 2^{(n^{1/2}) \log n }$ // here base of $\log n$ is 2 $h(n) = n !$ Which of the following is true? $ h (n)$ is $O (f (n) ) $ $h (n)$ is $O (g (n)) $ $g (n)$ is not $O (f (n) ) $ $ f(n)$ is $O(g (n))$ I tried this way : To check which funct...
I am looking for an example, which corresponds to what I've learned in my Applied Automata Theory Class: Given a NFA $\mathcal{A}$, a $\approx _\mathcal{A}$ quotient automaton can be bigger then a $\sim_\mathcal{A}$ quotient automaton and this can be bigger than an optimal quotient and an optimal quotient does not n...
I am writing a Android phone application that needs to be very power efficient, and I would like to use the most power efficient sorting algorithm. I will implement it in C for extra power efficiency. What algorithm is the most power efficient algorithm for sorting arbitrary text strings?
Let's say I have a finite set S with, say, 1000 elements, and a function f on some subset of S. Suppose that f has no useful mathematical properties. What algorithm is most relevant in finding the subset of S that maximizes f?
I have a $D$-dimensional grid with the size $(N_1, \ldots, N_D)$, where $N_i$ are natural numbers, and a "flat block size" $M$, also a natural number. I want to find a decomposition $(m_1, \ldots, m_D)$ such that: $\prod_{i=1}^D m_i = M$, $R = \prod_{i=1}^D f(N_i, m_i) m_i - \prod_{i=1}^D N_i$ is as low as possible. H...
Im sorry if this question has some trivial answer which I am missing. Whenever I study some problem which has been proven undecidable, I observe that the proof relies on a reduction to another problem which has been proven to be undecidable. I understand that it creates some kind of an order on the degree of difficulty...
I'm seeking to write an algorithm which, given a value of N, will fill a matrix consisting of (N+1)(N+2)(N+3)/6 rows and 4 columns with the integers from 0, ... , N, subject to the conditions that: The sum of values in any row is N No rows are repeated (this should ensure that every such possibility is listed) For ex...
f(n) = 3n+3 ; f(n) = O(n) By definition : $3n+3 \le c_1.n$ By dividing both side by n $3+(3/n) \le c_1$ means we r getting constant range for $c_1$ for any $n$. Again it shows c's value must be greater than 3 at any cost. e.g. if we take c's value 3.5 so n's value will be 6. Now if we plot graph ( Bcoz I w...
I'm not terribly well-versed in CS (I only just a few moments ago learned what a k-partite graph is), so forgive me if this is an obvious question. I'm wondering how to determine if a given graph matches a specified pattern, where this pattern is an example graph that is a k-partite graph where all inter-set edges must...