instruction
stringlengths
35
29.1k
Total functional programming is a paradigm of non-Turing-complete programming languages where any program that type checks is proven to halt. Well-founded recursion is a recursive definition of a function such that the definition of $f(x)$ only ever makes a recursive call $f(y)$ when $y<x$ for some well-founded relatio...
I'm reading through the proof for the fractional knapsack problem presented here: https://www.cs.rice.edu/~nakhleh/COMP182/Knapsack.pdf I follow the proof until the definition of the new set $Q = \langle q_1, q_2, ..., q_n \rangle$ for every $1 \leq i<j: q_{i}=o_{i} ($also $q_{i}=y_{i})$ which is constructed as follow...
I'm really not sure how to approach this problem.
How can i find the Hamiltonian cycle on an nxn grid that uses the least amount of stright lines (curves left/right as much as possible)? Here's an example we have devised for 8x8: Here is an example we have devised for a 6x6: And can this be applied to a grid of any dimensions (apart from non-hamiltonian grids)?
The below-given lines are written in the book of the operating system (Page -307), details of the book are as follows: OPERATING SYSTEM PRINCIPLES, 7TH ED., Abraham Silberschatz, Peter Baer Galvin, Greg Gagne. Wiley India Pvt. Limited, Nov 27, 2006 "A lazy swapper never swaps a page into memory unless that page will be...
For a set $I\subseteq \Bbb N$, defined $s_{I}(n)=\min\{i\in I\mid i>n\}$. The set $I$ is called polynomial-time-enumerable if $s_I(n)$ is computable in $\mathsf{poly}(n)$ time. Most of the sets I can imagine are polynomial time enumerable. I am really looking for an example of a set of integers that is NOT polynomial t...
Given the following language, I am tasked with giving a context-free grammar that generates it. $\left \{ a^{3n}b^{m}c^{n}|n>0, m>0\right \}$ Would this be correct? $A \rightarrow aaaA$ $B\rightarrow Bb | b$ $C\rightarrow Cc|c$ $S\rightarrow ASBSCS|\epsilon $
So I am trying to tackle a combinatorial optimization problem and would like some insights on how to approach it. The problem statement is as follows: Consider a set of elements of size N, how do I select a subset of size k<N such that the sum of the elements in the subset is maximum and variance among the elements is ...
Let's say we have a matrix M[1..B, 1..B] (i.e., a square matrix) and a mouse in the upper left corner (1,1). We also have an integer A, which tells how many pieces of cheese there are in the matrix. The mouse can move from a given positon (i, j) either in the direction (i+1, j) or (i, j+1). When the mouse visits a give...
This is my attempt at a proof: Let $E$ be a $REGEX$ accepting $L$. We claim the $REGEX$ $E^{'} = E^{+}$ accepts L. i.e. $L(E^{+}) = (L(E))^{+}$ $L^{+}$ is regular since there is a $REGEX$ $E^{+}$ accepting $L$ I am very unsure if my proof makes sense or is correct. Can someone please advise?
I'm interested in how fuzz testing and something called combinatorial testing. Combinatorial testing attempts to forgo exhaustive testing in favor of trying to test all possible "interactions" of a certain size. It's an interesting result that all interactions of a certain small size can be tested in far far fewer test...
I am trying to solve the following recurrence relation :- $T(n)=16T(n/2)+n$ using masters theorem. I got $\Theta (n^2)$ (Which matched the first case in the theory) which is wrong, any help with this please?
I have to find the lower bound of the following recursion: $A_1 = C_1 = p_1$, $B_1 = D_1 = 1-p_1$, $F_k = A_k + B_k$. Evaluate $F_n$. \begin{align} A_{k+1} &= (A_k + 2C_k) p_{k+1} + (1-p_k) p_{k+1}, \\ B_{k+1} &= (B_k + 2D_k) (1-p_{k+1}) + p_k (1-p_{k+1}), \\ C_{k+1} &= C_k p_{k+1} + (1-p_k) p_{k+1}, \\ D_{k+1} &= D_k ...
I read online that this problem is in P: Problem = {a^n, where n is a primary number} I can't find any algorithm that decides if a word w in {a}* is in Problem, can someone help me because I'm not really convinced that this problem can be solved in polynomial time.
Consider an algorithm for reversing a sequence given below: def reverse(S, start, stop): if start < stop − 1: S[start], S[stop−1] = S[stop−1], S[start] reverse(S, start+1, stop−1) The time complexity of this algorithm is $O(n)$ because we make $n$ recursive calls each taking at most $O(1)$ time. But ...
Can you write an algorithm which can take in a given function/algorithm, and produce a distribution of generalizations of the function at hand? One such simple example of generalization might mean the generalization from the factorial function to the gamma function, or the generalization of the irrationals to the reals...
Draw a graph on $5$ vertices that satisfies all of the following conditions: $G$ is an undirected connected graph. For every node $v∈V$, in the spanning tree received by BFS($v$), $\deg v=2$. For every node $v∈V$, in the spanning tree received by DFS($v$), $\deg v=2$. I was trying to draw many graphs but none of th...
I am working with a shared resource with the following specifications acts as a dictionary (values can be obtained with key name: dictionary['key']) does not have builtin system for locking Multiple threads can read and write to same keys (simple writes and reads are atomic) I am trying to implement locking based on k...
My question is strongly related to the one asked here: How do I show T(n) = 2T(n-1) + k is O(2^n)? $$T(n)=2T(n-1)+1$$ Going with the steps, I reached the point where: $$c*2^{n}\geq c*2^{n}+1$$ which implies $$0\geq 1$$ which is false for all possible values of $c$ and thus the claim $T(n)=O(2^{n})$ should be incorrect....
I'm currently dealing with the problem $$T(n)=T(\sqrt{n})+T(n-1)+n$$ This doesn't seem to show any pattern when continously broken down as a whole, but I was able to find the complexity of $$T(n)=T(n-1)+n$$ and $$T(n)=T(\sqrt{n})+1$$ because they were both easier to solve. Does it makes sense to guess an upper bound fo...
I have a question concerning NP reduction. My question asks me to show that if I have a graph with Edges that connect 3 nodes together instead of 2, (Y style I assume). I need to prove that finding out if the TRI-Graph is 3 coloring is NP-Complete. I'm not asking for the answer. But I've been racking my brain on how to...
For index field I got '9' because 2^(9) = 512 words. But I'm stuck on what the formula for calculating the tag field is... any ideas? Given a cache that holds 512 words and block size of one word. Assume 32-bit addresses. The index field is ____ bit. The tag field is ____ bit.
I was asked this question: Given an image with shape [1,28,28], what will be the shape of the output of a convolution layer with 10 5x5 kernels (filters) without padding? Now, are the shape dimensions [row, column, depth]? I really don't understand how you apply a 5x5 kernel on such image, because its 1x28... What am I...
I am new to the domain of Machine learning. I have been asked to present a paper related to the mathematics behind the depth separations in Neural Networks (by Itay Safran, Ronen Eldan and Ohad Shamir). I have been having a hard time in understanding the paper. I am looking for easy papers to learn the foundation so th...
Consider two probability distributions $D$ and $U$, over $n$-bit strings, where $U$ is the uniform distribution. We are not given an explicit description of $D$: we are only given black-box access, ie, we are only given a sampling device that can sample from $D$. Consider a sample $z \in \{0, 1\}^{n}$, taken from eithe...
Given an unambiguous context-free language L and an unambiguous regular language L (moreover, every regular language is unambiguous) such that L∩ R = ∅, then prove that L∪ R is also unambiguous.
How do I prove the following statement? The relation $≤_p$ (polynomial time reduction) is an equivalence relation.
I have to show that a binary tree with $n$ nodes has at least $(n-1)/2$ weight-balanced nodes and at most $n-1$ weight-balanced nodes. Here a node is weight-balanced if its siblings satisfy $\operatorname{weight}(u) \leq 2\operatorname{weight}(v)$. So we get at least $(n-1)/2$ (where $n$ is positive and odd) if the one...
For a boolean function $f:\{0,1\}^n\longrightarrow\{0,1\}$, $H_{avg}(f)$ is a function from $\mathbb{N}\longrightarrow \mathbb{N}$, termed as the average case hardness, if $\forall$ circuit $C_n$ of size $H_{avg}(f)(n)$, $Pr_{x\in U_n}[C_n(x)=f(x)]<1/2+\epsilon$, $\epsilon >0$. Similarly, for a boolean function $f:\{0,...
The problem I have in hand is like drawing Google Maps by myself, in particular, roads. When my map scale is huge, I face no problem, but when I zoom out there are too many things to draw -- sure, I can rank the elements, and for example draw only important roads (like highways), but at given scale there will be always...
I analyzed a dataset using those 3 different algorithms. As I can see, Random forest performs better in most cases. My dataset is composed of 4000 instances of two classes (class A 2000 elements, class B 2000 elements). I use 207 metrics to classify the instances, but I also use the first 20 or 10 best metrics for Info...
I tried to do the problem Find first set bit in Geeks for Geeks, and this is the code I used. public static int getFirstSetBitPos(int n){ int counter = 0; while (n > 0){ if ((n&1) == 1){ return counter + 1; } n >>= 1; counter ++; } return 0; } The problem as...
The bin packing problem is an NP-hard optimization problem that has many constant-factor approximation algorithms. I am looking for an additive approximation. I.e., given a set $I$ of items and bin capacity $B$, find a packing in which the number of bins is at most $OPT(I,B)+d$, where $OPT(I,B)$ is the optimal number o...
I was going through the topic of matroid structures for the problems like Activity selection ,minimum spanning tree. I also came to know how to solve if a problem exhibits matroid structure. The statement says that problems that have matroid structure will have a greedy algorithm. But by just showing matroid structure ...
I'm trying to implement conditional probability distribution when the events of two RVs are sets. If I try to extrapolate concepts from real or categorical variables to sets things become confusing for me. In the usual scenario, for some pair of discrete RVs, $X,Y$, we can compute the conditional probability of two "pu...
I'm reading section 19.3 of Combinatorial Optimization by Schrijver where he details an algorithm for finding the min-weight edge cover. His method works for general graphs, but I'm particularly interested in bi-partite graphs. To find the min-weighted edge cover of a graph $G=(V,E)$ with a weight function $w: E \to R$...
Now I'm from a mathematical background, and I found CS people's definition of average time complexity a bit... confusing, to say the least. Here is a definition that I feel comfortable with: Consider a set $A$ of finite elements, with each $a\in A$ indicating individual input cases. There exists a function $T(a)\mapsto...
Question: Given two sorted sequences in increasing order, $X$ and $Y$. $Y$ is of size $k$ and $X$ is of size $m$. I would like to find a subset of $X$, $i.e$, $X'$ of size $k$, and considering the following optimization problem:$$d(Y,X') = \sum_{j=1}^{k}(y_{j}-x'_{j})^{2}$$ And $X'$ is a subset of $X$ of size $k$, $y_{...
Galvin and various other resources only allow either the producer or the consumer to access the buffer at a time, the common code is as follows: //Producer code While(true) { down(empty); down(mutex); buffer[in] = item; in = (in+1) % buffer_size; up(mutex); up(full); } //Consumer code ...
This is a variant of this question. Consider two probability distributions $D$ and $U$, over $n$-bit strings, where $U$ is the uniform distribution. Assume that $D$ and $U$ are far apart in total variation distance, ie, \begin{equation} d_{\text{TV}}(D, U) \geq \frac{2}{3}. \end{equation} We are not given an explicit d...
I'm currently dealing with inverted page tables and how they work. If I understood correctly, an IPT is a table that maps a frame number to a PID and page number. The way this works is by having a hash function map a tuple (PID, page_number) to (frame_number). If the entry of the table given by the frame number contain...
I have a vertex-weighted undirected graph $(V,E)$ with root vertices $R = {r1, ..., rn}$. I need to find the subset $V'⊂V$ such that $R⊂V'$, $N[V']=V$, $∀v'∈V '[∃r∈R ($path($r', v'$)$)]$ that minimizes the sum of vertex weights in $V'$. Note the path must contain only vertices in $V'$. In other words, all roots must be...
I am trying to understand why this "proof" of ETM undecidability is wrong. ALLTM={ < M >|M is a TM, L(M)=∑*} ETM={< M >|M is a TM, L(M)=∅} We know that ALLTM is undecidable, lets assume ETM is decidable (T is a TM that decides ETM) and get a contradiction. S= "On input < M >, M is a TM: 1.Construct the following TM...
Hello I am a CSE student and this question was in my homework. double fact(long i) { if (i==1 || i==0) return i; else return i*fact(i-1); } funcQ2() { for (i=1; i<=n; i++) sum=sum+log(fact(i)); } I thought it is O(n^2) but can the bottom function's log function call make it O(n^3)? I am not sure Thanks in advance
Here is the problem: There are $MN$ people, where there are $M>1$ seeds and $N>0$ people are in each seed. We have to make $N$ teams of $M$ people where everyone in the team have different seeds. Each person have their own value; values are positive integers. Assume there are no two people with same values. For two dis...
Is it possible to optimize the runtime of a two-sum solution by receiving a pre-sorted input either in ascending or descending order? Original Two-Sum Determine whether there are two items whose individual capacity will perfectly equal the total capacity while ensuring the same item cannot be selected twice. Input: ...
If $e = \{u, v\}$ is a cut edge with $\deg(u)$ and $\deg(v)$ both at least 2, then $u$ and $v$ are cut vertices. I want to prove or disprove this statement, but don't know how to proceed. I do know what goes wrong when one of the degrees is smaller than 2.
I'm designing a genetic algorithm to solve the travelling salesman problem. So far, I've gotten fairly good results. I'm now trying to improve on them by implementing some sort of diversification scheme (like fitness sharing and crowding), although I'm struggling with the conceptualisation of the inter-solution distanc...
Say there is a push-down automaton, in this example I'll use a Deadfish-like set: +: increase x by 1 0: set x to 0 ln: set x to ln(x) <-- real valued result With x being an infinite precision real-valued variable, does this allow said machine to have more power than if it was operating on integers? Or am I misunderstan...
If the BB function is computable, does that mean we know how to compute {i | program i eventually halts when run with input 0}, which is a clear contradiction with halting problem. Does this proof work? Am I missing anything? Thanks
Can you help me with sorting algorithm implementation for objects of Student type by rating field. This field (rating) value can be any number from 0 to 100. Can I do the sort in-place?
Example: Suppose $H:${$1,...,n$} $\rightarrow ${$1,..,n$} be a uniform hash function. for input $x$, $z$ is equal to number of trailing zero in the right side of $H(x)$. for $0 \leq c \leq 1$ what is the order of probability $ z \geq c \log n$? $C$ is constant here. Answer: $O(1/n^c)$ How this this is can be achieved?...
Edit: can someone provide clear answer with all details Given: $T(n)=T(n/10)+T(an)+n$ while $a$ is a const and $T(n)=1:(n<10)$ I was asked to find the minimum value for $a$ for which $T(n)=\omega(n)$ Using a set of complicated equations I found and proved that $a=9/10$ is the correct answer (for sure) But how I can pro...
Laptops, PCs (don't consider Apple products here) have processors that are mainly built on x86 and their life cycle is of the order of 5-10 years. Or the frequent changing of smartphones has a perception/psychological side of it and not the durability issues of the hardware?
I thought they did, but recently I tried to express $3^n$ as $k \times 2^n + o(2^n)$ for some constant $k$ but wasn't able to. All I found was $3^n = (\frac{3}{2})^n 2^n$. What am I misunderstanding here? I suppose my question applies to $log_c(n) = O(log_2(n))$ as well.
I figured out that the CFG that starts and ends with the same symbol in alphabet $\Sigma=\{0,1\}$ will be : S -> 0A0|1A1|0|1| A -> 0A|1A| How can i interpret the odd number of 1's also?
I recently asked a related question at the theoretical CS stack exchange, but I have modification to the problem that I think is a bit tougher. This seems like a better place anyways. Let's define a "task" $T_k$ to be a tuple $(a_k, b_k, C)$, where $a_k$ is the amount of active time spent on a task, $b_k$ the inactive ...
How would someone create a Turing machine that computes ⌈log2(n)⌉? I know that: n = 1, 2, 3, 4, 5, 6, 7, 8, ... f(n) = 0, 1, 2, 2, 3, 3, 3, 3, ... And that I want the input tape to have n 1's in it to represent the number i.e. 8 would be ###11111111### How would the the turing machine for this be created?
I know that for the language ww, the TM can zig zag across the tape and match symbols to see if the strings are equivalent by first finding the midpoint of the string. However I am lost on how the TM can find out where in www the repeated strings start and stop. I can find midpoint but how do I get one third or two thi...
Let suppose that we have a file with n = 10^6 records. The block size is B = 10 records and we have available main memory m = 20 blocks. (Sorting with MergeSort) a) If we have 1 disk find minimum available to sort file in 2 passes b) If we have 2 disks how many passes we need to sort the file completely I have starte...
Looking for an algorithm for splitting a list of people (S) into groups (G), |S| <= |G|, more than one person wants to be in a certain group. Every person has a monotone ranking from highest (most desired) to lowest of all the groups. Using this list I want to find the "best matching". "best matching" is when you maxim...
There are multiple very complicated articles about softmax online. I just want to know a few things about it: Why do we need softmax? What is the "problem"? What does it do? How does it do it? I find it very hard to get through all the math when I don't really get what it is all about. The problem is that all the thi...
I have to proof that Turing's combinator is a fixed point operator, but I can't get it. I tried this: \begin{align*} Vg &= (UU)g = ((\lambda f.\lambda x.x(ffx)) (\lambda f.\lambda x.x(ffx)))g = (\lambda x.x((\lambda f.\lambda x.x(ffx))(\lambda f.\lambda x.x(ffx))x))g\\ &= g((\lambda f.\lambda x.x(ffx))(\lam...
My intuition tells me that there is <=1 increase in lps for each increase in the index. Can someone make a better argument why this is O(N)? My confusion arises from len_ = lps[len_- 1] . def computeLPSArray(pat, M, lps): len_ = 0 # length of the previous longest prefix suffix lps[0] = 0 # lps[0] is always...
Let us model a wireless broadcast network as an undirected graph $G(V,E)$ where there is an edge between every pair of nodes ${i,j}\in V$ if they are in transmission range of each other. $w_{i\to j}$ is the weight of the link $i\to j$ which can be calculated only by transmitter $i$ and is unique to receiver $j$. All no...
From classical results of universal simulation of Turing machines there exists a Universal Turing machine simulating any Turing machine with time complexity () in time ()log(). Is there is an analogue for circuits? Since circuits can only accept a fixed input size it would only be able to simulate circuits that can be ...
You can simulate polynomial time Turing machines with polynomial size circuits, can you simulate multiple poly time TMs with a single poly size circuit?
Assume this particular architecture of a machine. Say we have 4 processors and each processor has its private L1 cache and shared L2 cache. Now if we write to an address in one of the private cache's of the L1 cache then we Invalidate the blocks in the other private cache which contains the same address. Say P0(process...
Object B can be in two state 1(stopped), and 2(running) at an arbitrary time t in the future. Object A can be in two states x, and y at t0. However, if A is in state x, B must be in state 2 at t, and if A is in state y, B must be in state 1 at time t. Thus, you can't have Object A in state x at t0 and B in state 1 at t...
$$L_2=\{w \in \{0,1,2\}^* : \text{$w$ has the same number of $1$'s and $2$'s}\}$$ I have tried creating PDA to determine if this was context-free or not. It seems like it would be because whenever a 1 is pushed onto the stack, there always is a 2 to get pop it out. The 0's are what is bothering me at the moment. Do we ...
What ist the time complexitiy of an algorithm with the running time of $a^{n^b}; a,b>1$? And how is it compared to factorial complexity O(n!)?
This problem is from an exercise sheet so it would be nice if you could guide me to the solution. The problem: For $ k \in \mathbb{N}\setminus\{0\}$ let $$L_k = \{x1y | x \in \{0, 1\}^*, y \in \{0, 1\}^{k-1}\}$$ be the set of words with have at the k-last Position a 1. (a) How many Myhill-Nerode-equivalence classes doe...
So the question is Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. You can only move down and to the right. This is a common interview question on software engineering interviews, it is easily solved by implementing ...
Given a machine that sorts an array of length $n$ with the following algorithm: Sort first $2\sqrt{n} + 1$ elements of array with Insertion Sort.(Check Insertion Sort) Select the median of the whole array (after its first $2\sqrt{n} + 1$ length part is sorted from step 1) as the pivot then partition the array.(Check Q...
If I have a password = "passwordPASSWORD" and the time it takes to encrypt the password successfully is: 353259.545 nano seconds is there a formula that can work out the time taken to successfully conduct a brute force attack on the password? I was thinking: AvrgTimeToEncrypt^PasswordType x PasswordLength ?
In a code, I saw someone use: n&(n-1) to get the least significant bit of n ⇒ 101000 will return 1000 n&(-n) to remove the lsb from n ⇒ 101000 will return 100000. This sounds magical to me. Is there any proof for these? Thanks a lot!
Let's suppose we have a supplier, sorting facilities, shipping companies and a target warehouse. We produce n packages of the product, and each goes to a different sorting facility (so every facility receives exactly one package). A sorting facility then passes the processed product to a shipping company, each sorting ...
After reading Church's thesis, and godelization theory, it seems everything is futile, is this really true, all the machines we are making machine which is same as before, bounded to not solve halting problems, in more simple terms can quantum computer do anything that a Turing machine can't? PS: In book named Elements...
The answer is yes, NP/poly is defined as the class of problems solvable in polynomial time by a non-deterministic Turing machine that has access to a polynomial-bounded advice function--the advice function only adds power; however, I'm having a hard time understanding NP/poly's containment of NP from the angle of the d...
A configuration of a Turing machine is defined as the following: an ordered triple $(x, q, k) ∈ Σ^* × K × N$, where $x$ denotes the string on the tape, $q$ denotes the machine's current state, and $k$ denotes the position of the machine on the tape. I have read in a paper that a space-bounded non-deterministic Turing...
I've been asked a question that goes something like this: Using depth-first search and Robbins' theorem, design and analyze an efficient algorithm to construct a strong orientation of a given undirected graph G. If none exist, output a bridge in G. Now, I can prove Robbins' theorem easily, which states that a graph i...
I wasn't sure whether to post this here or in the ai stack exchange - please let me know if i need to move my post elsewhere) I have been learning about how dynamic programming can be used as a tool to solve the bellman optimality equations: (only show state value function) $$ v_{*}(s) = \max\limits_{a\in A(s)}\sum\lim...
The maximum height of an AVL tree with a balance condition of 1 is 1.44log(n). So the worst case height is O(logn). However, if the balance condition was hypothetically 2 (meaning that the allowed imbalance condition between two child nodes would be 2), how could I find the maximum height of such a tree. Would I need t...
I'm studying Algorithms and Data Structures from The Algorithm Design Manual and I'm having a hard time going through the exercises. Specifically, the proofs are a bit hard and not really explained in the book(It only gives two proof exmaples). Prove the correctness of the following sorting algorithm. Bubblesort(A)...
We know that in an asynchronous system, no assumptions about process execution speeds or message delivery times are made. My question is: can we present any guarantee in asynchronous systems? Some examples of the guarantees that I'm looking for are: Consider two processes $p$ and $q$. $p$ sends a message an infinite n...
Is there an example of an algorithm whose time complexity is strictly larger than Ackermann's function?
The Laplace mechanism is a standard way of making the output of a function $f$ differentially private. More concretely, let $\Delta_f$ be the sensitivity of $f$, i.e. the maximum value by which the output of $f$ can change, if the input database is changed by one row. On input database $x$, the $\epsilon$-private Lapla...
Solve the following recurrence-relations: my attempet for the first one was doing upper bound and lower bound by changing for lower $6T(n/3)+1$ and for upper $6T(2n/3)+1$ but i didn't get the same order for $\Theta$ $T(n)=5T(n/3)+T(2n/3)+1,T(1)=c$ $T(n)=2T(\sqrt{n})+\log_2(n),T(4)=2$ I'm not sure if I solved this righ...
Computational distance between sequences of distributions $\{X_i\}_{i \in \mathbb{N}}$ and $\{Y_i\}_{i \in \mathbb{N}}$ can be defined as the maximum, over all probabilistic polynomial time algorithms $A$, of $$ \left|\underset{x \sim X_{n}}{\mathsf{Pr}}(A(x) = 1) - \underset{x \sim Y_{n}}{\mathsf{Pr}}(A(x) = 1)\right|...
Given code to just an NP-verifier, where the certificate/witness is required to be of size polynomial in the instance, for a language L, can you, from that data alone, construct code for a solver, or generate / get back the language L itself? At a glance, the answer seems to be yes--you could just try every word, certi...
I was hoping someone could point me in the right direction in terms of what type of problem I am describing and what type of algorithm I should use to answer it. Here is the problem: A company is in the process of reducing its office space and wishes to find the path that will minimize double-rent costs during the tran...
I'm having trouble understanding the difference between the Held-Karp $O(n^2 2^n)$ solution and the cutting-plane method pioneered by Dantzig, Fulkerson and Johnson. Held-Karp is $O(n^2 2^n)$ which result is computational times that are excessive. To quote Cook: This is disappointing since for $n = 30$ the Held-Karp g...
I'm trying to hash integers n = 4k(0,4,8,12,16...) into an array of linked lists of size 4 (chaining). What is a good hasing function that guarantees a good distribution of the keys? that means to use all indexes of the array from 0 to 3.
For sufficiently large |w|, how many of the 2^|w| strings of length |w| are entirely unrelated? A way to define this: two strings are unrelated if their joint Kolomogorov complexity is practically equal to their individual Kolmogorov complexities added together: K(w1,w2)=K(w1)+K(w2)
Dependently typed languages such as Agda support inductive families, also called indexed datatypes, which allow type parameters to vary between constructors. This can be used to define a set of relations between types, which can be used to constrain existentials. For example, we can capture the relation $$\begin{align*...
I have the following condition in an LP problem. I have a variable $x_i \in i = 1,2,..7$ and I need to constrain the problem via: if $x_1$ >5 then $x_2 \leq 30$ I'm stumped on how to formulate that with integer variables. Thanks
I am currently studying the textbook Principles of Program Analysis by Flemming Nielson, Hanne R. Nielson, and Chris Hankin. Chapter 1.3 Data Flow Analysis says the following: The least solution. The above system of equations defines the twelve sets $$\text{RD}_\text{entry}(1), \dots, \text{RD}_{\text{exit}}(6)$$ in t...
I am defining, a string $w$ is accepted by a PDA whenever the PDA enter into a final state during the computation(at least on one branch of the computation) on the input $w$ (no matter whether the input is read fully or not). I can guess PDA with the new definition of acceptance is less powerful, and easy to see every ...
So, I need a data structure that would support the following operations: Add an element to the structure and get some "handle" for that element Retrieve an element by a handle Remove an element by a handle Iterate over all elements Note that the elements are not expected to have any particular order in iteration. Pre...
are for every $\alpha \in N $ , $ \frac{1}{\alpha-2} \geq \frac{1}{\alpha}+\frac{1}{\alpha-1}$?