Questions tagged [discrete-mathematics]

NOTE: Only questions about software development related to discrete mathematics are on topic. Discrete mathematics is the branch of mathematics concerned with discrete phenomena – as opposed to continuous phenomena like geometry, real analysis, physics, etc. Typical discrete math topics are discrete probability, combinatorics, graph theory, algorithms and complexity, but also matrices, difference equations, recurrences.

Discrete mathematics is the branch of mathematics concerned with discrete phenomena – as opposed to continuous phenomena such as geometry, real analysis, and physics. Typical discrete math topics are discrete probability, combinatorics, graph theory, algorithms, and complexity, but also matrices, difference equations, and recurrences. Applications abound in computer science, as many computer models are built upon discrete elements.

Questions relating to discrete mathematics must still be programming-related. Questions that are not programming-related may be asked on mathematics.stackexchange.com.

1083 questions
-3
votes
2 answers

Discrete Mathematics (Statement)

1) x^2 + x + 1 = 0 , x is a real number. Answer: Is a statement. 2) x^2 + x + 1 = 0 , x is complex number. Answer: Is not a statement. Why the question no.2 is not a statment ?
Jiale
  • 11
  • 3
-3
votes
3 answers

Creating implications in Prolog, where A implies B and B implies A, through generic rules

No smoke without fire, no fire without smoke. Identify the conclusion and condition from above statement with a Prolog program. In the answer, the conclusion must be that if there is fire, there is smoke and if there is smoke, there must be…
-3
votes
2 answers

Midpoint of a rectangle with 8 co-ordinates

I am writing a javascript program to find the midpoint of the rectangle (diagonal lines which intersect in the middle) I have 8 co-ordinates (x1,y1) (x2,y2) (x3,y3) (x4,y4). How can i achieve this?
umzee
  • 11
  • 1
  • 6
-3
votes
1 answer

Can you give me an example of a transitive closure of a relation that is not an equivalence relation?

I am having trouble finding examples of transitive closure of relations that are not an equivalence relation.
-3
votes
1 answer

What topics do I need to cover for maths on Deep learning (see screenshot attached)

I was recommended to read the book on Deep Learning, however it has some mathematical terms/language in it which I don't quite understand yet. Can you please tell me which topics I need to cover first to understand the maths (see screenshot…
Nant
  • 569
  • 2
  • 10
  • 24
-3
votes
1 answer

Exploring the number of different ways a number can be expressed as a sum of powers of 2

Define f(0)=1 and f(n) to be the number of different ways n can be expressed as a sum of integer powers of 2 using each power no more than twice.For example, f(10)=5 since there are five different ways to express…
-3
votes
3 answers

Python math.arctan() wrong result?

I am using python shell as a calculator, but I don't know why it can't handle -28/96 as an input for atan function: My question is: Why is this wrong?
I.Omar
  • 501
  • 7
  • 19
-3
votes
1 answer

What is importance of Discrete Mathematics in AI?

I need to know the important of Discrete Mathematics in Artificial Intelligence.
Elliyas Ahmed
  • 101
  • 1
  • 1
  • 10
-3
votes
1 answer

Python returns wrong truth table for logical implication

I have implemented the above implication in Python but it does not return the expected results: True True None True False None False True True False False None My python code is: def implies(a,b): if a: …
Sarah cartenz
  • 1,313
  • 2
  • 14
  • 37
-3
votes
1 answer

How can I use scanf to alter this algorithm

How Can I Use A Scanf to alter combinations? Write a program that prompts the user for a five digit lab access code, read it in as an unsigned integer then print to the screen each of the five digit access codes (with possible leading zeroes) …
-3
votes
2 answers

Informatics Olympiad Questions and Color Interval?

This is an 2013 Local INOI Informatics Olympiad Question. Suppose we have 1393 points on real axis. we want to color this points such that for each arbitrary interval [a, b], if at least one point of 1393 points be in interval, at least one…
user4591951
-3
votes
3 answers

compute The horizontal absolute difference value of a pixel

We have the test image with M rows and N columns as f(x,y), for x∈ [1,M] and y∈ [1,N ]. The horizontal absolute difference value of a pixel is defined by D (x, y) = |f (x, y +1) − f (x, y −1)|. need help in how to implement it in matlab
-3
votes
3 answers

arithmetics vs boolean operations (in terms of performance)

So suppose I have a number called num, if some condition A happens, then increase the number by 1, else decrease it. I could write the code like this: if (A) ++num; else --num; This piece of code could also be written without any if-else, but would…
One Two Three
  • 22,327
  • 24
  • 73
  • 114
-4
votes
1 answer

What language is this code snippet written in / what does it do?

One of my professors in my discrete mathematics class used this code trying to explain number sets and such, but I don't have any idea what it actually does. My guess is it's Delphi or something similar? Can someone please explain (especially M[r,k]…
-4
votes
2 answers

Round to the nearest number in an interval centered around 100

I want to round a number (up or down) in an inputted interval centered around 100 (not exactly on the multiples of the internal length). Here are some examples: Ex 1: Length=3, Center=100, Input=99.76, Round Down=True => The discrete interval is…
John Doe
  • 185
  • 1
  • 8