How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask R.R. Jha Your Own Question
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5471
Experience:  B.Tech
Type Your Homework Question Here...
R.R. Jha is online now
A new question is answered every 9 seconds

I need to write a program in C to keep track of a particle

This answer was rated:

I need to write a program in C to keep track of a particle "explores" a linear array of sites making random unit hops left or right. The generation of random 0's and 1's is no problem. But the array needs to have periodic boundaries. What would be a program in C for periodic boundaries?

I'd be glad to help. Do you have any code so far? If not, no problem. I'll work out a simple simulation and send to you. Let me know.

Customer: replied 4 years ago.

I haven't any code yet. I was trying to figure out how to handle the periodic boundaries issue.



Ok, I'll write the code and send an example program soon.
Please download code below

and here is the output. Particle is denoted by *

Let me know if any questions.

Please rate the answer.

Just add 'RRJha' at the start of your new question if you need help with any other problems.

R.R. Jha and other Homework Specialists are ready to help you
Customer: replied 4 years ago.



Hi, I need now to modify the code so as to 1. stop it as soon as all sites have been visited once, 2. repeat the process a number of times (N) and 3. obtain the average number of hops.


Can you help? Do I have to send a new question?




I'll work over this and get back to you.
Since it's a continuation from previous part, I can post the answer here itself, rating which you may pay the same amount you did last time.



You need to spend $3 to view this post. Add Funds to your account and buy credits.
Customer: replied 4 years ago.

I'm trying to rate your answer but it keeps saying 'Access denied'.



Please make sure that you've sufficient balance in your Justanswer account. If not, first try transferring the amount to your Justanswer account.

Customer: replied 4 years ago.

But I don't see how to transfer money to my account...

Ok, please try to create a new blank question with same value. Just add 'For RRJha' at the start. I'll post the answer there and see if you could leave rating there.