Hello(adsbygoogle = window.adsbygoogle || []).push({});

I have to write an algorithm that randomly chooses between A B and C.

I have to use the function (rand(1,1) which gives me a radndom number from the following (0,1,2,3,4,5,6,7,8,9)..

I was thinking of assigning A = 1:3 B = 4:6 C = 7:9

But I run into the problem of the random function giving me a 0.

Could I just write a statement saying that if I get a 0 from the random number generator, to generate anohter number? Would this still remain truly random using the function rand(1,1)?

Any help or suggestions are much appreciated. Thank you!!

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematical algorithm

Loading...

Similar Threads - Mathematical algorithm | Date |
---|---|

Best Mathematics / Physics software | Mar 15, 2017 |

Books on mathematical modeling | Feb 22, 2017 |

Language and Compiler built for Mathematics | Jul 8, 2016 |

Is there any way to improve my skills with Mathematica software | Dec 28, 2015 |

Matlab, mathematical algorithm | Oct 29, 2006 |

**Physics Forums - The Fusion of Science and Community**