Different books and software define quantiles using different rules.
As you have already discussed, one of the differences is how ties (multiplicities)
are treated. These different definitions can give noticeably different
results for small datasets, but when the sample size increases the differences
usually become negligible.
For most practical purposes, lower quartile, median, and upper quartile
are the 25th, 50th and 75th percentiles, respectively.
In R statistical software, these are the results for your 'dataset'
of the numbers from 1 through 100.
x = 1:100; median(x); quantile(x, .50)
## 50.5 # median
## 50%
## 50.5 # 50th percentile
For the dataset y
of the numbers from 0 through 100, both answers are 50.
Minitab statistical software also gives gives 50.5 and 50 as the medians for the two datasets,
respectively. Altogether, there are about a dozen slightly different
rules in use for finding quantiles. So Minitab and R agree on that much.
But for the 50th percentile they both disagree with the rule you stated
in your question. (SAS statistical software gives 50 as the 50th percentile
of dataset x
and 49 as the 50th percentile for dataset y
.)
As a beginning statistics student, there are two important bits of advice:
(1) During your course, always use the definitions provided by your textbook or instructor.
(2) Understand that others may have slightly different rules, so don't
be surprised if you see something a little different in another text, using a
statistical calculator, using statistical software, or for summarized data in a journal
article.