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 4005618
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:24:56+00:00 2026-05-20T08:24:56+00:00

True or false (justify your answer): For all values of A, M, and X_i

  • 0

True or false (justify your answer):

For all values of A, M, and X_i in the formula
                  X_{i+1} = A ∗ X_i mod M,
      the value of X_{i+1} is always in the range (−M, M)

This is a practice question for a computer science test I have today and I am unsure about the answer? I remember we talked about using this formula in randNumGeneration…? If someone could please help me understand, that would be great. Thanks!

(I think X_{i} is read: X sub i)

  • 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-05-20T08:24:56+00:00Added an answer on May 20, 2026 at 8:24 am
    X_{i+1} = A ∗ X_i mod M
    

    This means that (i+1)-th value of sequence X is equal to the value of A multiplied by the i-th (previous) value of the X sequence and then fed to modulus operator, which places the result in the [0, M) interval.

    So the answer is true.

    Example:

    let A = 3, M = 5 and X0 = 4.
    X1 = A * X0 mod 5 = 3 * 4 mod 5 = 2 mod 5
    X2 = A * X1 mod 5 = 3 * 2 mod 5 = 1 mod 5
    X3 = A * X2 mod 5 = 3 * 1 mod 5 = 3 mod 5
    X4 = A * X3 mod 5 = 3 * 3 mod 5 = 4 mod 5
    
    let A = -3, M = 5 and X0 = 1.
    X1 = A * X0 mod 5 = -3 * 1 mod 5 = 2 mod 5
    X2 = A * X1 mod 5 = -3 * 2 mod 5 = 4 mod 5
    X3 = A * X2 mod 5 = -3 * 4 mod 5 = 3 mod 5
    X4 = A * X3 mod 5 = -3 * 3 mod 5 = 1 mod 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What's the best practice for fields that hold true/false values? Such columns can be
Im updating ActiveDirectory from an external HR system. This system wil produce True/False values
I thought I could change the Boolean true/false value, but it's not working. How
Is there a simple way in Ruby to get a true/false value from something
Is there a quick way or function that would tell me true/false if all
I'm trying to modify an SQL table to have true false values. I am
i am trying to use a simple h:selectOneRadio with a true/false values so here's
in my db i have values as True/False/false/true.... i need to get only the
So, I have this true/false question in my computer science class (we're using Java):
We have this field in our database indicating a true/false flag for each day

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.