Which number was used as a pivot?

Click For Summary

Discussion Overview

The discussion revolves around the concept of a "pivot" in the context of sorting and bin packing algorithms. Participants explore how to identify a pivot number within a given list of numbers and clarify the relevance of the term "pivot" in different algorithmic contexts, particularly quick sort and bin packing.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant inquires about a general rule for finding the pivot number used in sorting algorithms.
  • Another participant provides an example of a sorted list and describes how bins work, suggesting a specific grouping of numbers.
  • A question is raised about how to find the pivot in a different list of numbers, prompting clarification on what the pivot is for.
  • There is a discussion about the meaning of "pivot" in the context of algorithms, with a participant noting that the first-fit decreasing bin packing algorithm does not involve a pivot.
  • One participant asserts that 13 is the pivot for a specific arrangement of numbers, while others challenge this claim and ask for clarification on the algorithm being referenced.
  • Another participant expresses confusion over the abbreviation "ms/Ms," suggesting it may refer to "mark scheme," and emphasizes the importance of minimizing obscure acronyms.
  • Later, it is clarified that the term "pivot" is relevant to quick sort, with an explanation of how the pivot should separate larger and smaller numbers in the list.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the definition and application of "pivot" in the context of the discussion. There are competing views regarding its relevance to different algorithms, particularly quick sort versus bin packing.

Contextual Notes

There is uncertainty regarding the specific algorithms being referenced and the definitions of terms like "pivot" in different contexts. The discussion highlights the need for clarity in algorithmic terminology.

chwala
Gold Member
Messages
2,828
Reaction score
425
Homework Statement
Consider the following array of numbers ##[ 17,33,14,25,23,28,21,13,9,6,10]##? which number was used as the pivot?

supposing we had say, ##[ 17,33,14,25,12,28,21,13,9,6,15]##? Then how would we find the pivot?

secondly, apply the first-fit decreasing bin packing algorithm to the fully sorted list into bins of size ##85##.
Relevant Equations
algorithms.
Okay i know the answer as indicated on ms ...i just want to check if there is a general rule for finding the number used as the pivot?
 
Last edited:
Physics news on Phys.org
this part is straightforward.

for bin we have ...firstly, the fully sorted list as ##[33, 28, 25,23, 21,17,14, 13,10,9,6]##

how bins work, ##[85-33=52, 52-28=24, 24-23=1]##,

therefore,

##bin_1 = (33, 28, 23)##

##bin_2 = (25, 21, 17, 14, 6)##

##bin_3= (13, 10, 9)##
 
chwala said:
supposing we had say, ##[ 17,33,14,25,12,28,21,13,9,6,15]##? Then how would we find the pivot?

The pivot for what?
 
pbuk said:
The pivot for what?
For the numbers indicated on that list. For the first arrangement it is clear that the number that was used as a pivot is ##13##.
 
chwala said:
For the numbers indicated on that list.
For doing what with the numbers indicated on that list?

The word "pivot" only means something in the context of certain algorithms, please explain what algorithm you are using that involves a pivot.

Note in particular that the first-fit decreasing bin packing algorithm does not have a pivot.

chwala said:
For the first arrangement it is clear that the number that was used as a pivot is ##13##.
Is it? How?
 
pbuk said:
For doing what with the numbers indicated on that list?

The word "pivot" only means something in the context of certain algorithms, please explain what algorithm you are using that involves a pivot.

Note in particular that the first-fit decreasing bin packing algorithm does not have a pivot.


Is it? How?
From ms again. I'll post the Ms here again for your reference.
 
chwala said:
Okay i know the answer as indicated on ms

chwala said:
I'll post the Ms here again for your reference.
I'm going to guess, without knowing for sure, that "ms/Ms" is an abbreviation for "mark scheme." As far as I know this is not a widely used acronym. I've only ever seen it used by you. It's best to minimize acronyms that aren't well known so as to decrease confusion amongst readers.

I'm aware of quite a few sorting algorithms, but bin packing is not one of them. The closest I can come to it is the Knapsack Problem (https://en.wikipedia.org/wiki/Knapsack_problem) which may or may not be related. Since I wasn't familiar with bin packing, I found an entry for it, in several variations, on wikipedia. I didn't see the term "pivot" used in any of them. I believe @pbuk was asking about this as well.
 
Okay, this was the question


1741689067685.png
 
With the full question shown, it turns out that the term pivot didn't have anything to do with bin packing, but it was relevant to quick sort.
After the first pass, and since the list should ultimately be sorted into decreasing order, the pivot should be such that all the numbers in the left part should be larger than the pivot, and all numbers to its right should be smaller. Evidently, 13 was used as the pivot.
 
  • Like
Likes   Reactions: chwala

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K