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

2
votes
1answer
72 views

Most efficient mental way to convert Decimal to Hexadecimal

My question is as follows: What is the most efficient mental way to convert Decimal to Hexadecimal? I've heard of many methods. Some people divide the decimal by 16 and find the remainder. Others ...
0
votes
1answer
45 views

Prove that wheel (Wn) graph family are hamiltonian

I need to determine and prove that wheel (Wn) graph family are hamiltonian. I know that the Wn graphs are hamiltonian where it's possible to create a cycle that contains all the vertices, but How to ...
5
votes
1answer
94 views

Numbers as sum of distinct squares

Yesterday Polish Olympiad of Information Science ended, one of the questions was purely mathematical, Squares (PL). In the task, we have defined square ...
1
vote
1answer
53 views

Counting the number of complete bipartite subgraphs

I am stuck with problem and not getting much ideas. I have a graph with $N$ vertices and $M$ edges. I have to count number of ways I can choose a pair of set of vertices say $(p,q)$, such that every ...
1
vote
0answers
22 views

Two decidable languages for which a mapping reducibility does not exist?

The trivial null language might not be reduced to another language, but are there standard examples of two decidable languages $L_1$ and $L_2$ such that there is no mapping reduction possible from ...
2
votes
0answers
46 views

How to find the shortest path of a graph in a turing machine

I'm reading about Turing machine and I saw some examples as: Let $M_{1}$ a Turing Machine and the language $B = \{w\#w \vert w \in \{0,1\}^{*}\}$, We want $M_{1}$ to accept if its input is a member of ...
0
votes
0answers
40 views

How can be a conservative field constraint be efficiently implemented in a continuous optimization problem?

Suppose we have the following continuous optimization problem: $$ \underset{x}{\mathrm{minimize}}f\left(x\right) $$ subject to $$ \exists X:\nabla X=Jac\left(X\right)=x $$ where $f$ is a function ...
1
vote
2answers
23 views

How to determine the increase in the Z-Axis. Of a tessellated sphere

I have been tasked with drawing the sphere below for a programming assignment using openGL. I have the assignment mostly completed however I am having issues figuring out the math for the sphere. For ...
0
votes
1answer
19 views

What is the complexity of halving the size of an $n$-bit number every time.

I was discussing this question with my fiend the other day and was hoping to get some confirmation from someone if the logic I used is correct. Suppose that we have a number $N$ in base 2 ie ...
0
votes
0answers
16 views

Check if an axis aligned bounding box intercepts with a triangle

As the questions says I am trying to check if an AABB intersect with a triangle. I've divided the problem in 3 parts: check if any of the triangle edges intersect any of the AABB faces check if the ...
3
votes
1answer
53 views

How to find an expression for a number via a given set of math operators and constants?

Consider one gives you $n$ digits of a (possibly irrational) number and a finite set of math operators and constants, like $\{\sin(x), \ln(x),+,\times, \pi,e,7\}$. Then he asks you to build a ...
4
votes
1answer
88 views

How to define percentage values in terms of scalar values

Imagine a game in which you choose many cards with different A,B,C values. Such as : Card 1 A - 4 B - 5 C - 6 Card 2 A - 2 B - 7 C - 4 ... and so on.. To ...
2
votes
2answers
78 views

Is it possible to express the idea of a number bigger than any other number ($\infty$) in programming languanges? [closed]

I'm studying graphs and algorithms, most of the algorithms we're using (such as Prim's algorithm), have the need of a table with a symbol $\infty$. Which in some contexts mean that it is the biggest ...
0
votes
1answer
22 views

Nondeterministic finite automaton understanding problem

It is probably a silly question but I have problem understanding it. Let's say I have to design a nondeterministic finite automaton that accepts the language consisting of words containing a string of ...
0
votes
1answer
35 views

Pushdown automaton design

I have to design a PDA that recognizes the language: $$L=\{w \mid \#(a,w) - 3\#(b,w) = 2\} $$ where $\#(a,w)$ means the number of letters $a$ in $w$ My idea is to count $a$'s and $b$'s. I have to ...
0
votes
1answer
23 views

Why are all singletons confluent?

A relation R of a set M is confluent, if $ \forall x \in M \forall w1,w2 \in M :((xRw1 \land xRw2 ) \to \exists z \in M (w1Rz \land w2Rz)) $ . 1. Someone told me that all singletons, no matter the ...
0
votes
1answer
51 views

What is confluence?

I got a worksheet at university last week, and the first task is: A relation R of a set M is confluent, if $ \forall x \in M \forall w1,w2 \in M :((xRw1 \land xRw2 ) \to \exists z \in M (w1Rz \land ...
0
votes
1answer
41 views

Deterministic finite automaton algorithm

I am having a little trouble understanding this question. For a DFA M = (Q, Σ, δ, q0, F), we say that a state q ∈ Q is reachable if there exists some string w ∈ Σ∗ such that q = δ∗(q0, w). Give an ...
0
votes
1answer
30 views

Evaluating math proofs by computer

Is there any way to evaluate (check) math proofs (entered in some convenient for computer form) by computer? Only thing that comes to my mind is functional programming, different logics, but I'm not ...
0
votes
2answers
60 views

How to prove Kleene star to be uncounably infinite?

Hi I have a language $L = \{a, b\}$. How can I prove that the Kleene star (set of all words over the language) of this language is uncountably infinite or countably infinite?
1
vote
2answers
25 views

Pumping Lemma proof

We have a language $$ L = \{\text{w element of } \{a,b\}^* \mid \#(a,w) = \#(b,w)^2 \} $$ where $ \#(a,w) $ means the number of letters $a$ in $w$ I would like to show that this language is not ...
0
votes
2answers
28 views

How to show if a language is infinite, then there is no upper bound on the length of words in L?

L is a language over a finite alphabet. How to show that if L is infinite, then there is no upper bound on the length of the words within L? Can someone help me prove this.
1
vote
0answers
39 views

Can you use chinese remainder theorum to convert hex to dec in your head?

At one time I was able to convert hex to decimal in my head, using a trick I learned in college. I have not used it in years, and forgot how. Does anyone remember how to use the Chinese remainder ...
-1
votes
1answer
105 views

How can I retrieve all the results in one go? [closed]

Please excuse me for posting this question here, but I'm just not sure where this question properly belongs; moreover, as I'm in search of a funded Masters or PhD in Mathematics abroad, perhaps this ...
1
vote
0answers
52 views

Algorithm to compute wether a stabbing line exists for a set of line segments

Let $S$ be a set of n segments in the plane. A line $L$ that intersects all segments of $S$ is called a traversal or stabber of $S$. Give an $\mathcal{O}(n^2)$ algorithm to decide if a stabber for $S$ ...
3
votes
1answer
53 views

FOL and Conjuctive Normal Form Conversion

I see the CNF from following firs order logic: $ \forall x [ \forall y [ \neg A(y) \vee B(x,y) \Rightarrow [ \neg \forall y B(y,x) ] ] $ is equivalent to : $ (A(f(x)) \vee \neg B(g(x),x)) \wedge ...
0
votes
1answer
34 views

How do I generate regular expression from this deterministic finite state automaton?

I want to create a regular expression from the following deterministic finite automaton: "abb" substring search How do I generate regexp from above dfa and what are the steps for doing so? ...
0
votes
1answer
23 views

The complexity of Depth First Search

Can anyone tell me what's the complexity of Depth First Search? I have no idea about what does mean by the complexity.
0
votes
4answers
67 views

Prove that $G$ has at least $q-p+c$ cycles.

I need your help with this question: Suppose that a graph $G$ has $p$ vertices, $q$ edges, and $c$ components. Prove that $G$ has at least $q-p+c$ cycles. I don't know how to prove that.
1
vote
1answer
36 views

Show that the language is not regular using Myhill-Nerode Theorem

I saw that similar questions have been answered on this site, but I've been unable to translate those answers to my problem. $$L=\{ww^R\mid w \in \{a,b\}^*\}$$ This is what I tried: BWOC, assume ...
0
votes
1answer
13 views

How to properly determine observations related to a Hidden Markov Model alike problem?

I got a an exercise problem which should be seen as a HMM scenario and argument some statements. However I'm quite confused about how to properly solve and argument my solutions. Problem tells: ...
0
votes
1answer
97 views

Graph DFS, BFS and some inference

Suppose G is a connected, undirected graph with at least 3 vertexes. we know the order or visiting the vertexes in DFS and ...
0
votes
1answer
32 views

Is master theorem applicable to the recurrence relation $T(n) = T(n/2)$?

Is master theorem applicable to the recurrence relation $T(n) = T(n/2)$? I do not think it applies because there no $n$ term and there is no $n^k$ for a $k$ which would equal $0$.
1
vote
1answer
25 views

Base conversion between base r^3 to r^2

The problem asks the following: If $(\alpha2)_{r^3} = (r3\beta)_{r^2},$ find $\alpha, \beta,$ and r. First off, I assume $r^2$ > 3 and $r^3 > 2$. I know that $(r3\beta)_{r^2}$ = (10 _ _ _ _ ...
0
votes
0answers
10 views

Find the point where the greater growth rate surpasses the lesser one without graphing

I have 2 lines: f(x) = 2010x^2 + 1388x and g(x) = x^3 What's the strategy for finding a x1 >= 0 where g(x) becomes greater than f(x) for all x >= x1? If one DNE, how would I know?
0
votes
1answer
79 views

Converting double precision IEEE 754 hex to base 10 with repeating decimals

The number is 0x4001 8CCC CCCC CCCC. So far I have the stored exponent as 1000000000 which equals ...
1
vote
1answer
49 views

Applying the master theorem

State the asymptotic runtime found by the master theorem. If the master theorem does not apply state why: 1) $T(n) = $T($n/3)$ 2) $T(n)= $ $5T$($2n/5$) + $n$ 3) $T(n) = 4T(n/2) +15n^3 + 4n^2 +n+4$ ...
0
votes
0answers
42 views

Rewriting a function to speed up computation

the purpose of this question is to find the fastest way to calculate a function on a (x,y,z) grid using a programming language. It is more related to maths however, as it concerns recasting a function ...
0
votes
1answer
31 views

yacas factorize polynoms

I want factorize polynoms with yacas but I can do it only with univarial. E.g. I want $x^2-y^2$ factorize to $(x-y)(x+y)$. How can I do it? Or if anybody has any suggestion to another simple, free ...
0
votes
0answers
45 views

An algorithm to find if two sentences are at edit distance $1$

Definition: Two sentences $S_{1}$ and $S_{2}$ they are at edit distance $1$ if $S_{1}$ can be transformed to $S_{2}$ by: adding, removing or substituting a single word. Examples: Consider each ...
4
votes
2answers
56 views

If $L$ is regular, must the language $L_1 = \{w : w^Rw \in L\}$ be regular, or may it be non-regular?

The reverse, $w^{R}$, of a string $w = w_1w_2...w_n$ is the string $w_n...w_2w_1$. Suppose that L is a regular language. Must the language $L_1 = \{w : w^Rw \in L\}$ be regular, or may it be ...
6
votes
2answers
118 views

Graph and in-Degree and Drawing

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 ...
0
votes
2answers
44 views

A nice recurrence sequence

I want to find general solution for recurrence: $a_n=7a_{n-1}-10a_{n-2}+4n$ with suppose $c_1, c_2, c_3$ is constant. I need some tutorial or solution on this challenging recurrence.
1
vote
1answer
71 views

How many integers could be in such a way that any digits is not bigger than the left digits?

How many 4-digits integers could be in such a way that any digits is not bigger than it's left digits? I Try it with simulation, i get 714. anyone could describe a formula for me? My try:
0
votes
1answer
128 views

How to calculate the angle between 2 vectors in 3D space given a preset function

In my application, I am attempting to connect 2 points in 3d space with a cylinder via a function taking in 2 vectors. I understand that I need the angle to apply to the cylinder. As I understand, I ...
1
vote
0answers
37 views

Representing $i$ with divergent series

Train of thought In computer science, for representing signed integers, we can use the two's complement representation, so that $11111111_{(2)} = -1$ over 8 bits with $x_{(2)}$ denoting binary ...
0
votes
2answers
71 views

Designing a deterministic finite automata

How would I go about designing a deterministic finite automata to recognize the language L = {λ, ab, abab, ababab, . . . } consisting of strings that start with ‘a’, end with ‘b’, and alternate in ...
-1
votes
1answer
40 views

Proving that CFG generates a language

I need to construct a CFG for the language consisting of even length palindromes with the same number of a's and b's and then prove that it generates that language. This is the CFG I got: S→ abba | ...
0
votes
1answer
19 views

Substitution method for solving recurrences piece wise function

I don't know how to use the substitution method for the following function: piece wise function: $T(n) = c$, if $n=0$ $T(n) = d$, if $n=1$ $T(n)=2T(n-1)-T(n-2)+1$, if $n > 1$
0
votes
1answer
44 views

Triangles incident on a vertex (Graphs)

I have a project that I am doing. The specification requires specific methods on a graph class. Two of the methods requires this: 1.numberOfTrianglesIncidentToVertex, calculates and returns the ...