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
-2
votes
1 answer

How to write pseudocode to compute n!!(double factorial) recursively?

n!!= 1*3*...*n, if n is odd. n!!= 2*4*...*n, if n is even. I've been trying, but I'm having a tough time starting this problem.
-2
votes
3 answers

How to express this sentence by using quantifiers and logical operators

Here is the sentence: There is a shortest person, but there is no tallest person.
zodiac
  • 75
  • 7
-2
votes
1 answer

Modular arithmetic Basic cofusion

I am just learning number theory .When I was reading modular arithmetic I came across this statement : 29 is congruent to 15 (mod 7). So actually this statement actually shows just 29 is congruent to 15 and we are working under mod 7..mod 7 in…
-2
votes
1 answer

proving set theory proving (B' ∩ u) ∩ (A' ∪ φ) = (A ∪ B)'

Can anyone help me prove below set (B' ∩ u) ∩ (A' ∪ φ) = (A ∪ B)' please note in (B' ∩ u) this is (B' ∩ set u)
user3397694
  • 111
  • 1
  • 1
  • 8
-2
votes
1 answer

Describing the right recurrence

I've to describe a recurrence for l_n, the number of lobsters caught in year n The task says: A hobby fisherman estimates the number of lobsters he will catch in a year as the average of the number he caught in the two previous years Describe a…
Mr.T
  • 27
  • 7
-2
votes
2 answers

Prove or Disprove quantifiers (propositions logic)

What approach can i take to solve these question: Prove or disprove the following statements. The universe of discourse is N = {1,2,3,4,...}. (a) ∀x∃y,y = x·x (b) ∀y∃x,y = x·x (c) ∃y∀x,y = x·x.
IT ken
  • 5
  • 1
  • 1
  • 10
-2
votes
1 answer

What is the total number of additions and multiplications in the following code?

I'm in a discrete math class and he explained very little about programming and code so far. He also said he likes to throw in crazy questions to our homework to throw us off. Thus, I'm here to learn from you for this particular question! (I don't…
-2
votes
1 answer

Algorithm to find other two sides of a trianlge when one side is given

There is a triangle, and its hypotenuse length is given to us. Now our task is to find whether other two sides are also integer or not. For above question, I build one code, but that is inefficient, can you suggest any efficient algorithm for the…
Loha
  • 50
  • 6
-2
votes
2 answers

How to find second point by adding distance in first point?

In the 2D. I have calculated distance 7.071068 from the coordinate: (10, 10) (15, 15) But now question is that i want to find Second point by Adding distance in First Point. How to Do this?
Ganpat
  • 768
  • 3
  • 15
  • 30
-2
votes
2 answers

Floating point number and range of floating point numbers that can be represented by a string

refer to the string of bits 010011110110 We also assume that when the number is stored as a floating point (real) number, 6 of the 12 bits are reserved for the mantissa (or significand) If the string represents a floating point number, what is…
Ausghostdog
  • 178
  • 1
  • 3
  • 13
-2
votes
1 answer

Shunting-Yard Algorithm with truth tables in Java

I'm working on a truth table generator for one of my assignments in Discrete math.. I have to implement the shunting-yard algorithm, and I'm completely lost doing so. My problem, is implementing the shunting-yard algorithm. First I'll show what…
ryandawkins
  • 1,537
  • 5
  • 25
  • 38
-3
votes
1 answer

[Homework Question][Finished] about Conjunctive normal form(CNF)

It's a homework question. Can we consider the following as a CNF? (¬x ∧ y) ∧ (x ∨ z) I thinks it's a CNF just like A ∧ B, but my friend doesn't agree with me.
user8400129
  • 193
  • 1
  • 7
-3
votes
3 answers

(p ∧ q) ∧ (p ⇒ ¬q) prove contradiction?

So I have reached dead end after this I tried doing de Morgan rule after this but and faced dead end after that. I have tried this (p ∧ q) ∧ (¬p ∨ ¬q) (p ∧ q) ∧ ¬(p ∧ q)
user9161658
  • 23
  • 1
  • 4
-3
votes
1 answer

How to do discrete optimization with python

I have a discrete optimization problem similar to Y=3X1+2X2 (a sample one) Minimize Y such that there are some constraints for X1 and X2 like X1 +X2 >20 X1 can take values from {5,10,15,25,85} X2 can take values from {20,25,5,40,10} etc How can do…
-3
votes
1 answer

Combining a set of fractions

Consider the set {1, 1/2, 1/3, 1/4, 1/5, ..., 1/n} Choose any two numbers x and y and replace them with x + y + xy For example, if we choose the numbers 1 and 1/2 , we will replace them by 1 + 1/2 + 1/2 = 2. If we keep repeating this process until…
a.sankar
  • 15
  • 5