All mathematical questions about computer science, including theoretical computer science, formal methods, verification, and artificial intelligence. For questions about Turing computability, please use the (computability) tag instead. For numerical analysis, use the (numerical-methods) tag. For ...

learn more… | top users | synonyms

1
vote
0answers
45 views

Is there a name for this constant? (0.0100011011…)

It's the simplest number I could think of that contains any finite binary code in its digits: $$\begin{align} c &= 0.0100011011000001010011100101110111...\\ &= ...
0
votes
1answer
32 views

checking boolean logical equivalence

Given two boolean formula (aka. logic circuit), I want to check if they are logically equivalent, namely that they compute the same truth table. Is this an NP-complete problem? What is the proof?
1
vote
0answers
80 views

smallest circuit

Let $SMALLESTCIRCUIT$ be the language consisting of all Boolean Circuits $C$ with the property that there is no smaller circuit $C^{'}$ that has the same truth table as $C$. (smaller means having ...
2
votes
0answers
33 views

Size of increments in commutative ring to reach given number

I have the ring $\Bbb Z_q = \{0,1,\ldots,q-1\}$, where $q$ is a prime. Starting from $0$, I want to make exactly $n$ equally sized increments and reach $a\in \Bbb Z_q$, with $n<q-1$. For example if ...
0
votes
1answer
17 views

Hexidecimal subtraction when more than one borrow is needed

I wanted to know how I would subtract two hexadecimal values from each other when more than one borrow is needed. Given 0x00000200 - 0x00000004 Here is what I ...
1
vote
1answer
54 views

Subsets of a monoid closed under left-multiplication by elements of a submonoid

Let $M, T$ be monoids (or, semigroups) with $M \subset T$. Then we can consider subsets $S$ of $T$ that are closed under left-multiplication by something in $M$, i.e. $$ a \in S, m \in M \implies ma ...
0
votes
0answers
10 views

Proving if the graph of F is over it's tangent line at all points then Newton Raphson converges.

Here's the problem: Let $F : \mathbb{R} \rightarrow \mathbb{R} \,, F \in \mathbb{C}^1$ so that $F'(x) < 0 \, \forall \, x$ and there's a unique $r$ so that $F(r)=0$ and let $L_{x_0} (x)$ be the ...
1
vote
1answer
37 views

Prove correctness of algorithm using induction

Bubblesort(A) int i, j; for i from 1 to n { for j from n downto i { if (A[j] > A[j+1]) swap(A[j], A[j+1]) } } Could we ...
3
votes
5answers
243 views

Proving formula for sum of squares with binomial coefficient

$$\sum_{k=0}^{n-1}(k^2)= \binom{n}{3} + \binom{n+1}{3}$$ How should I prove that it is the correct formula for sum of squares? Should I use induction to prove the basis? Any help is appreciated.
0
votes
0answers
33 views

Minimize sum of squared error

I have an array of real numbers, I want to partition them into k sets. In each set, I calculate the sum of squared error. Then, I add up all the sum of squared error for all the set. I want to ...
0
votes
0answers
30 views

Partition problem of equal size

I have an array S of size 2n, each element in the array is an integer I want to split it into two arrays of size n, and under this condition, minimize the difference of the sum of integers in the two ...
5
votes
1answer
56 views

Is a thorough study of algorithms useful for a mathematician?

In my university, there is a core course called "basics computer science for mathematicians". The topics covered range from algorithms, to the bases of programming, to theory of computability. The ...
2
votes
0answers
18 views

Deriving a recurrence equation and apply Master's Thrm to it

So for a function such as: function Hi(n) if n > 1 then for j ← 1 to n do print(”Hi”) Hi(n/2) Hi(n/2) Hi(n/2) It's very easy to eyeball this and get a ...
3
votes
2answers
120 views

Application of Mergesort

We have $8$ players and we want to sort them in $24$ hours. There is one stadium. Each game lasts one hour. In how many hours can we sort them?? I thought that we could it as followed: ...
0
votes
0answers
17 views

Application of divide-and-conquer

Good afternoon. Consider a two-position switch with two inputs and two outputs. In one position inputs 1 and 2 are connected to outputs 1 and 2 respectively. Using these switches, design a network ...
0
votes
0answers
13 views

Fleury’s Algorithm in case of we have odd-degree nodes

I'm studying Fleury’s Algorithm to find Eulerian tour. I'm confused in case of we have two odd-degree nodes. What should we do in this case? Should we duplicate the path between the two add-degree ...
0
votes
0answers
31 views

Proof of Correctness: Recursion inside loop

I am trying to prove the correctness of the algorithm in the research paper. It is at page 17 in the pdf. ...
0
votes
0answers
17 views

Show that this is the number of moves that have to be done to solve the problem [duplicate]

Prove that $2^n − 1$ moves are necessary and sufficient to solve the Towers of Hanoi problem. Could you give me some hints how I could do that??
2
votes
0answers
33 views

Recursive definition of a language

Define recursively the language L of all finite strings over the alphabet Σ={a b} satisfying both criteria: All words in L contain the substring aa an odd number of times. All words in L are such ...
1
vote
1answer
115 views

Finding recurrence relation for digits

codes have been generated odd number of odd digits. Let $ a_n $ be the number of valid n-digit activation codes. Find the recurrence relation. I can't figure out and understand the question. Can you ...
0
votes
1answer
34 views

How can we show that $\lim_{n \to +\infty} f(n)=+\infty$?

We suppose that $\lim_{n \to +\infty} f(n)=+\infty$. I want to prove that if $f(n)=O(g(n)), c \in \mathbb{R}$, then $f(n)+c=O(g(n))$ . $f(n)=O(g(n))$ That means that $\exists c_1>0, n_2 \in ...
-1
votes
2answers
33 views

How may occupied positions are there?

Consider an array, that can have a huge ( or infinite ) number of positions, but only the first $n$ positions are occupied(only $n$ of them contain valid elements), and the remaining are empty. ...
0
votes
1answer
31 views

Merge two sets, list and tree

We are given two sets $S_1$ and $S_2$. We consider that $S_1$ is implemented, using a sorted list, and $S_2$ is implemented, using a pre-order sorted tree. I have to write a pseudocode, that ...
0
votes
0answers
20 views

Solution of the recurrence relation of factorial.

Well, I have seen the Stirling's approximation for the upper bound of the function f(n)=n! but I want toknow the solving process of the recurrence relation T(n)=n*T(n-1) where T(1)=1
1
vote
0answers
50 views

Differential Geometry for Computer Science

I am looking for a good book or other resources on Differential Geometry for Computer Sciences or more specifically Differential Geometry used in Computer Graphics, Geometric Modelling and Mesh ...
1
vote
1answer
53 views

Given $x,y\in\mathbb R$ is there a “formulaic” way to obtain a $q\in\mathbb Q$ with $a<q<b?$

Is there an assignment of reals $x,y$ to a rational number $q(x,y)$ for which $$\forall_{\mathbb R} x.\forall_{\mathbb R}(x<y).\left(x<q(x,y)<y\right)\hspace{.2cm}?$$ For computable reals, ...
0
votes
0answers
42 views

Lyapunov function

How to do this problem? Find a Lyapunov function for $(0,0)$ in the system: $$x˙=3xy^2−11x^2$$ $$y˙=11x^3−4y^3$$ I know there is no formula for finding Lyapunov functions for a system, so how do I ...
1
vote
1answer
61 views

Graph and one Sequence challenge

We have in and out degree of a directed graph G. if G does not includes loop (edge from one vertex to itself) and does not include multiple edge (from each vertex to another vertex at most one ...
1
vote
0answers
46 views

an instance of NP-complete

The cafeteria serves $m$ different kinds of food, $F = \{ f_i \}_{i = 1}^{m}$. The fruit are grouped into $n$ different types of bags $B_1, \cdots, B_n \subseteq F$. (The same kind of fruit might be ...
1
vote
1answer
28 views

What is this function?

In python I made this function: def f(x): eqStr = '' for y in range(int(x)): eqStr += 'x**%s + ' % (y) eqStr += '0' return eval(eqStr) ...
0
votes
1answer
20 views

How to construct a context free grammar that generate following language. $\{a^nb^nc^k \in \{a,b,c\}^* | n,k >= 0\} $

$$\{a^nb^nc^k \in \{a,b,c\}^* | n,k >= 0\} $$ $E \to aEbS $ $S \to c$ I do not know where to go next, or even if this is right at all?
0
votes
1answer
22 views

is $\{a^n b^m | n \neq m\} $regular or non regular?

$\left\{a^nb^m\mid n \neq m \right\}\subset \{a, b\}$. I have been asked to prove this is irregular but I think it is regular as I can write a regular expression a*b* for it. Am I wrong? If so how ...
0
votes
0answers
17 views

Is the string in $L(G)$?

I have to write an $O(n^3)$ algorithm to determine whether a given string $w=a_1 a_2 \dots a_n $is in $L(G)$, where $G=(N, \Sigma ,P, S)$ is a context-free grammar in Chomsky normal form. Could you ...
0
votes
1answer
28 views

Construct context free grammar which generates following language $\{wcw^R\in\{a, b, c\}^*\mid w\in\{a, b, c\}^* \}$

(i) $\{wcw^R\in\{a, b, c\}^*\mid w\in\{a, b, c\}^* \}$ So far I have $E \to EcE$ $E \to a$ $E \to b$ $E \to c$ But I'm new at this and feel I'm miles away from a finished answer
0
votes
2answers
35 views

If language L is not regular, and L ⊂ M. Do we know if M is regular or not?

I have been given some questions to do regarding regular/irregular languages. And have the following questions True/False (i) If L is not regular and L ⊂ M, then M is not regular. (ii) If L ⊂ M and ...
0
votes
1answer
18 views

decidability and countability

The diagonolisation technique is utilized to prove that the halting problem is undecidable. However, I kind of sense that it is making the assumption that decidable sets should be countable. Is this ...
1
vote
1answer
65 views

True or False Time complexity questions

Here is my go at them and any help is appreciated: If $f(n) = \Theta(n^2)$ and $g(n) = \Theta(n^2)$ then $(f - g)(n) = \Theta(n^2)$ where we define $(f-g)(n) = f(n) - g(n) \forall n$ TRUE? If $f(n) ...
1
vote
1answer
45 views

Time complexity of algorithms

I am having some trouble figuring out the time complexity in big theta notation of the following algorithms. Any help is appreciated. ...
0
votes
1answer
13 views

Multitape Turing machine with multiple non-blank tapes

A multitape Turing machine is defined to have input only appear on one tape, with the rest of the tapes blank. Are there any formulations of a Turing machine that allow other tapes to be not blank? ...
0
votes
1answer
53 views

Any algorithm or theorem to decide whether two functions are equivalent? [duplicate]

Any algorithm or theorem to decide whether two functions that are polynomials,rationals and analytic over $\mathbb{N}$ or $\mathbb{Q}$ or $\mathbb{R}$ or $\mathbb{C}$ are equivalent ?
1
vote
1answer
40 views

Are these two notions of “computable function” the same or related?

From http://en.wikipedia.org/wiki/Semicomputable_function, we have: "If a partial function is both upper and lower semicomputable it is called computable." Is this the same kind of "computable ...
1
vote
0answers
31 views

Kolmogorov complexity of a computer?

Warning: Vague, unclear question ahead. Proceed at your own risk. The Shannon entropy and Kolmogorov complexity give you in broad informal terms how unpredictable a string is and to what degree the ...
0
votes
0answers
31 views

Algorithm Generate all labeled graphs

I'm trying to find an algorithm which will generate all labeled graphs with $n$ nodes and $n-1$ edges. It must cover trees and graphs with cycles with one unconnected node, but without multigraphs. ...
2
votes
1answer
57 views

Why are Truth, Conjunction, and Implication called “Negative” fragments of IPL (intuitionisti logic Proposition Logic)?

Someone answered that negative means we are ""Using"" them . But the point is for all of these there is an Introduction rule too. So why call them negative? I don't know whether it's computer ...
0
votes
0answers
24 views

Euler’s theorem: any sequence of rotations = one rotation about some axis

While learning about transformations in Computer Graphics,I couldn't get why any sequence of rotations is actually equal to one rotation about some axis by Euler's theorem as stated in Computer ...
0
votes
1answer
30 views

Norm of Triangle Matrix

How to find the norm of the following matrix, please? Thank you! $$T := \begin{bmatrix} 1 & n \\ 0 & 1 \end{bmatrix},$$ and $$\|T\| = \sqrt{n^2+1}.$$
0
votes
1answer
20 views

Calculating screen intersection points with lines

I am writing a game and for the life of me can't figure out the most efficient way to program this. I have a boss who comes into the middle of the screen. He then engages 4 lasers which extend well ...
1
vote
2answers
40 views

How to use binary search to find a function

I am reading somewhere that $$(\phi'(y))^{-1}=y^{-c_1}+y^{-c_2},$$ $c_1,c_2$ are some numbers, can be solved for $\phi$ using binary search. I am surprised because binary search binary search is used ...
1
vote
1answer
67 views

Pigeon-Hole Principle and 2d grid

Q:Consider the 2D grid with integer coordinates.Prove that if we take 5ve points on the grid then there exist two of the points whose average is also a point on the grid. I understand the basic idea ...
3
votes
1answer
39 views

Hypercomputation & Higher Dimensional Variants of Conway's Game of Life

Conway's Game of Life is a simple and important mathematical game with some rules of evolution in a two dimensional space. It appears in many subjects in mathematics, artificial intelligence and ...