Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8059257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:36:52+00:00 2026-06-05T09:36:52+00:00

On math.SE, a question about math notation enerated a discussion of how programming languages

  • 0

On math.SE, a question about math notation enerated a discussion of how programming languages interpret the set {1,…,n} when n=0

The question asked for a mathematical notation to represent the R code 1:n

According to the comments, the mathematical interpretation of {1,…,n} when n=0 is that this is an empty set. A subsequent comment suggested that C is consistent with this interpretation, because for (int i = 1; i < n; i++) returns a empty set because it iterates 0 times.

It is not clear to me what the equivalent statement in R is, but 1:0 returns the vector [1,0]

Thus, for (i in 1:0) print(i) iterates over 1 and 0 (I interpret as analogous to the C code above)

Is this because {1,…,n} is not the correct notation for 1:n?

Does this mean R violates a universal rule?

Is there a consistent interpretation for this set among programming languages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:36:54+00:00Added an answer on June 5, 2026 at 9:36 am

    Each mathematical formalism has its own notation. To suggest that there is a “universal notation” is very “un-mathematical”. Look at the notation associated with tensors or groups if you want examples of mathematical domains where multiple notational systems exist.

    In R the code x <- 1:0 returns the ordered vector c(1,0). Just as the code x <- 2:-2 returns c(2,1,0,-1,-2). The code x <- seq(1, length=0) returns a sequence of length 0 which is printed in console sessions as integer(0). R is not really designed to mimic set notation but it does have some set functions and it also has packages that more fully implement set notation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting out with 3D math/programming and I have a question about point
This question is about the threshold at which Math.Floor(double) and Math.Ceiling(double) decide to give
This is a pretty simple Java (though probably applicable to all programming) question: Math.random()
This is not quite a programming question, but it's about a programming environment, so
I’ve learned Java for 1 month. I have a question about my code. There
I asked a question on helping me with this question about a week ago
my question is pretty simple, I think. And it's more about math than coding.
I have read the answer to my question about scala.math.Integral but I do not
I've asked a question about this class before, but here is one again. I've
MOVED: Moving this question to math.stackexchange.com and closing it. I'm learning about the math

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.