Discrete Mathematics Vcomparisons

Click For Summary

Discussion Overview

The discussion revolves around the concept of "vcomparisons" in the context of discrete mathematics, particularly in relation to sorting algorithms like Bubble Sort. Participants explore how many vcomparisons are needed for a specific list of numbers and the maximum number of comparisons required for a list of six numbers. The conversation includes questions about definitions, algorithm behavior, and specific assignment questions.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • Some participants question the term "vcomparisons," noting that it is not universally accepted in discrete mathematics.
  • One participant asks for clarification on the number of vcomparisons needed for the list of numbers: 7, 12, 5, 22, 13, and 32, suggesting that 12 vcomparisons might be necessary.
  • Another participant states that the maximum number of comparisons required for a list of six numbers would be 5 comparisons, seeking confirmation of this claim.
  • There is a suggestion that the questions posed should be self-contained and not rely on context from other threads, emphasizing the importance of clarity in forum discussions.
  • A participant mentions that the assignment includes specific questions about Bubble Sort, including the number of comparisons and the concept of vcomparisons, indicating a need for further understanding of these terms.
  • One participant proposes that the question about vcomparisons may be a typo and suggests that it could refer to the actual number of comparisons for the given list rather than the maximum for all lists of six numbers.
  • There is a discussion about how the number of comparisons in Bubble Sort may decrease with each pass, depending on whether the algorithm is optimized or not.

Areas of Agreement / Disagreement

Participants express uncertainty about the term "vcomparisons" and whether it is appropriate in this context. There is no consensus on the exact number of vcomparisons needed or the maximum number of comparisons for the list of six numbers, as different interpretations and clarifications are offered.

Contextual Notes

Participants note that the understanding of vcomparisons is dependent on the specific sorting algorithm being discussed, and there are unresolved questions about the definitions and implications of the term within the context of the assignment.

Joystar77
Messages
122
Reaction score
0
How many vcomparisons did you actually need?
 
Technology news on Phys.org
Joystar1977 said:
How many vcomparisons did you actually need?
n. (Smile)

Do you seriously believe one can answer this question without knowing the context, in particular, what v-comparisons are? This is not a universally accepted term in discrete mathematics, as far as I know.
 
I will rephrase the question Evgeny. Makarov. When having the following numbers: 7, 12, 5, 22, 13, and 32 how many vcomparisons did I actually need?

Is it true that 12 vcomparisons is what I would actually need. If this is not correct, then can you explain this to me? I have a learning disability and so its hard for me to grasp the concepts and understand the material at times.

Another question I have when having the following numbers: 7, 12, 5, 22, 13, and 32 what is the maximum number of comparisons required for a list of 6 numbers?

The maximum number of comparisons required for a list of 6 numbers would be 5 comparisons. If this is not correct, then can you please explain this to me?
 
Joystar1977 said:
I will rephrase the question Evgeny. Makarov. When having the following numbers: 7, 12, 5, 22, 13, and 32 how many vcomparisons did I actually need?
Do you need to sort this sequence? You still have not said what v-comparisons are.

As a general advice, you should ask questions in such a way that individual threads are self-contained. One thread should not require a context from a different thread. If you do rely on another thread, you should post a link there. Even if two threads were asked at the same time, after several replies they may be separated by other threads in the list of recent posts, so it is is no longer obvious that they may be related. Also, different threads may be read by different people. I believe this is a rule not just on this forum.

Joystar1977 said:
Another question I have when having the following numbers: 7, 12, 5, 22, 13, and 32 what is the maximum number of comparisons required for a list of 6 numbers?

The maximum number of comparisons required for a list of 6 numbers would be 5 comparisons. If this is not correct, then can you please explain this to me?
I believe this question is being discussed in https://driven2services.com/staging/mh/index.php?threads/5719/.
 
Oh, I did not understand you Evgeny.Makarov. I was just rephrasing the question because this is a term that my instructor apparently uses in Discrete Mathematics. You said that it wasn't an appropriate term used in Discrete Mathematics. There are 5 questions listed under my assignment for Question 1 and it goes through like this as follows:

Use Bubble Sort to sort the list: 7, 12, 5, 22, 13, 32

a. Which number is definitely in its correct position at the end of the first pass?

b. How does the number of comparisons required change as the pass number increases?

c. How does the algorithm know when the list is sorted?

d. What is the maximum number of comparisons required for a list of 6 numbers?

e. How many vcomparisons did I actually need?

I am trying to figure out what the vcomparisons are also.
Joystar1977

Evgeny.Makarov said:
Do you need to sort this sequence? You still have not said what v-comparisons are.

As a general advice, you should ask questions in such a way that individual threads are self-contained. One thread should not require a context from a different thread. If you do rely on another thread, you should post a link there. Even if two threads were asked at the same time, after several replies they may be separated by other threads in the list of recent posts, so it is is no longer obvious that they may be related. Also, different threads may be read by different people. I believe this is a rule not just on this forum.

I believe this question is being discussed in https://driven2services.com/staging/mh/index.php?threads/5719/.
 
Joystar1977 said:
d. What is the maximum number of comparisons required for a list of 6 numbers?

e. How many vcomparisons did I actually need?
This may be a typo. The question may ask for the actual number of comparisons for this concrete list as opposed to the the maximum number of comparisons over all lists of 6 numbers.

First you need to figure out the details of the algorithm: whether the number of comparisons decreases from pass to pass or not. The fact is that after the first pass, the largest number is at the end of the array, and there is no use of comparing it. Therefore, the second pass may use $n-2$ comparisons instead of $n-1$ for the first pass, and the number of comparisons may decrease by 1 with each pass. However, there is no harm in making these extra comparisons.

Thus, in the unoptimized version of the algorithm, each pass makes $n-1$ comparisons for an array of $n$ numbers. In the optimized version, which you seem to have, there are $n-1$ comparisons for the first pass, $n-2$ for the second pass, and so on. Therefore, the maximum total number of comparosins is $(n-1)+(n-2)+\dots+1=n(n-1)/2$ (the sum of an arithmetic progression). For an actual list, the algorithm may discover sooner that the list is sorted, and the number of comparisons may be smaller.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
86
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
23
Views
4K