SlideShare a Scribd company logo
Determining Median Complexity Through One­to­One Comparisons 
 
Dragos Guta 
Varatep Buranintu 
David Wu 
Michael Briseno 
 
Combining the knowledge learned in class and the resources founded on the web, we were able 
to come up with solutions as follows:  
 
1. Determining a decision tree for V(7,4) where 7 refers to the number of elements in a set, 
and 4 being the median or upper median. A general algorithm for determining the 
number of comparisons is established by Donald Knuth, in The Art of Computer 
Programming Volume 3 through trial and error. 
 
Furthermore, Donald Knuth provides a table determining bounds for up to V(10,10). 
Establishing a decision tree for V(7,4) ourselves is fruitless since a correct tree will 
essentially mirror the one provided by Knuth.  
 
Additionally the work of Kenneth Oksanen (​http://www.cs.hut.fi/~cessu/selection/​) has 
established a table determining bounds possibly for up to V(15, 8). 
 
 
2. An algorithm for determining a height 10 decision tree for 7 elements boils down to 
pairwise comparisons between the elements. A rudimentary implementation in 
pseudocode is as follows: 
 
// Create object that takes in an int 
// grab user input for 7 integers 
 list2[] ‐> 1...7 
 secondround[] 
 
 for i to 7; i+2 (3c) 
  compare list2[i] to list2[i+1]; 
  secondround.add(max(list2[i], list2[i+1])); 
(Note:7th element does not get compared to anything yet) 
  
 for i to secondround.size‐1 (3c+2c=5c) 
  compare secondround[0] to secondround[i+1] 
  find max 
  
// delete max 
// our list size is now 6 
 obj loner = list2[5];  
 place loner inside cell where our max was at 
 secondround.add(max(loner, and unpaired value)); (​5c+1c=6c) 
  
 for i to secondround.size‐1 (6c+2c=8c) 
  compare secondround[0] to secondround[i+1] 
  find max 
// delete max 
  
 loner = the unpaired value that is made after deleting the max 
 secondround.add(loner); 
 runnerup = new int; 
 for i to secondround.size‐1 (8c+2c=10c) 
  compare secondround[0] to secondround[i+1] 
  find max and runner up 
// delete max 
  
 print(Runnerup.value+ “ is our median"); 
// print out number of comparisons 
 
 
 
 
3. A general algorithm for finding the median in a given set of 20 elements is provided by 
William Gasarch, Wayne Kelly, and William Pugh in the paper Finding the ​i​th largest of ​n 
for small ​i,n​ and is published through the Association for Computing Machinery (ACM). 
Pseudocode for the implementation of their program is provided as such: 
 
 
 
Additional information is provided in the paper such as an explanation of the notation 
used. Furthermore, the paper provided establishes upper and lower bounds for up to 12 
elements. The article further expands on the general algorithm and provides 
“refinements” which expands to a value of ​n​ up to 20. Specifically for the case of V(16,8) 
the previously known upper bound was 36, the above algorithm and refinements reduce 
the bound to a potential candidate of 31, with a known lower bound of 25.  
 
Our limited computational findings were unable to determine, through an exhaustive 
search, if V(16,8) = 29 or even perhaps 30. We attempted to run Kenneth Oksanen’s 
program to find V(15,8) but after an exhaustive search of 4 hours, we were unable to 
determine or come to any conclusion. Additionally, his table and findings aim guess the 
exact number of comparisons to be somewhere around 24 to 28 in total for V(15,8), 
which simply agrees with the candidates found by Gasarch, Kelly, and Pugh. An 
example of the output or attempt at an output can be found below. The following two 
figures depict the amount of resources used by the system to determine the decision 
tree, as well as the number of branches the program is iterating through.  
 
 
 
In conclusion, we were unable to determine V(16,8) = 29 or even 30. The amount of 
resources and limited time as students was surely a hinderance to the project. We were 
only able to confirm to the best of our abilities the work set forth previously by leaders in 
the field such as Donald Knuth, Kenneth Oksanen, William Gasarch, Wayne Kelly, and 
William Pugh. 

More Related Content

Viewers also liked

Herramientas e learning gratuitas
Herramientas e learning gratuitasHerramientas e learning gratuitas
Herramientas e learning gratuitas
Yeraldy Pama Bejarano
 
Personal information
Personal informationPersonal information
Personal information
mohamed atef
 
Presentacion AEA
Presentacion AEAPresentacion AEA
Presentacion AEA
Felipe Apéstegui Guardia
 
Rashmi_Sinha_Sr.Mgr_HR
Rashmi_Sinha_Sr.Mgr_HRRashmi_Sinha_Sr.Mgr_HR
Rashmi_Sinha_Sr.Mgr_HR
Rashmi Sinha
 
Bibliografia especializada
Bibliografia especializadaBibliografia especializada
Bibliografia especializada
jhosfrank
 
Facebook ahmedabadpolice
Facebook ahmedabadpoliceFacebook ahmedabadpolice
Facebook ahmedabadpolice
Somerco Research
 
Collaborative lesson
Collaborative lessonCollaborative lesson
Collaborative lesson
Shannon Moore
 
Law of Maintenance in India
Law of Maintenance in IndiaLaw of Maintenance in India
Law of Maintenance in India
Ashok Wadje
 
The world of work by Júlia X.
The world of work by Júlia X.The world of work by Júlia X.
The world of work by Júlia X.
Escola Valeri Serra
 
gasto cardiaco
 gasto cardiaco  gasto cardiaco
gasto cardiaco
armandopartida
 

Viewers also liked (10)

Herramientas e learning gratuitas
Herramientas e learning gratuitasHerramientas e learning gratuitas
Herramientas e learning gratuitas
 
Personal information
Personal informationPersonal information
Personal information
 
Presentacion AEA
Presentacion AEAPresentacion AEA
Presentacion AEA
 
Rashmi_Sinha_Sr.Mgr_HR
Rashmi_Sinha_Sr.Mgr_HRRashmi_Sinha_Sr.Mgr_HR
Rashmi_Sinha_Sr.Mgr_HR
 
Bibliografia especializada
Bibliografia especializadaBibliografia especializada
Bibliografia especializada
 
Facebook ahmedabadpolice
Facebook ahmedabadpoliceFacebook ahmedabadpolice
Facebook ahmedabadpolice
 
Collaborative lesson
Collaborative lessonCollaborative lesson
Collaborative lesson
 
Law of Maintenance in India
Law of Maintenance in IndiaLaw of Maintenance in India
Law of Maintenance in India
 
The world of work by Júlia X.
The world of work by Júlia X.The world of work by Júlia X.
The world of work by Júlia X.
 
gasto cardiaco
 gasto cardiaco  gasto cardiaco
gasto cardiaco
 

Similar to Project1Math482

Complex Relations Extraction
Complex Relations ExtractionComplex Relations Extraction
Complex Relations Extraction
Naveed Afzal
 
2-IJCSE-00536
2-IJCSE-005362-IJCSE-00536
2-IJCSE-00536
Boshra Albayaty
 
61_Empirical
61_Empirical61_Empirical
61_Empirical
Boshra Albayaty
 
Iui2015: Personalized Search: Reconsidering the Value of Open User Models
Iui2015: Personalized Search: Reconsidering the Value of Open User ModelsIui2015: Personalized Search: Reconsidering the Value of Open User Models
Iui2015: Personalized Search: Reconsidering the Value of Open User Models
Peter Brusilovsky
 
Chap14 analysis of categorical data
Chap14 analysis of categorical dataChap14 analysis of categorical data
Chap14 analysis of categorical data
Judianto Nugroho
 
Expandable bayesian
Expandable bayesianExpandable bayesian
Expandable bayesian
Ahmad Amri
 

Similar to Project1Math482 (6)

Complex Relations Extraction
Complex Relations ExtractionComplex Relations Extraction
Complex Relations Extraction
 
2-IJCSE-00536
2-IJCSE-005362-IJCSE-00536
2-IJCSE-00536
 
61_Empirical
61_Empirical61_Empirical
61_Empirical
 
Iui2015: Personalized Search: Reconsidering the Value of Open User Models
Iui2015: Personalized Search: Reconsidering the Value of Open User ModelsIui2015: Personalized Search: Reconsidering the Value of Open User Models
Iui2015: Personalized Search: Reconsidering the Value of Open User Models
 
Chap14 analysis of categorical data
Chap14 analysis of categorical dataChap14 analysis of categorical data
Chap14 analysis of categorical data
 
Expandable bayesian
Expandable bayesianExpandable bayesian
Expandable bayesian
 

Project1Math482