How can I randomly assign addition or subtraction in a for loop?

Does anyone have any ideas for how I can randomly assign a for loop to add or subtract random numbers throughout various itterations?  My current code generates two random numbers and adds them together for a set number of itterations.  I need some random itterations to be subtraction.  Thanks in advance!  
Solved!
Go to Solution.
Attachments:
Screen Shot 2015-06-11 at 7.56.31 AM.png ‏36 KB

Add another Random Number generator and compare the result against 0.5. Use a case structure around your addition/subtraction operator.
Seems like you might also want to output which operation actually got picked.

Similar Messages

  • I used to have iPod shuffle connect to PC, I now want to use it on my Mac - how can I now assign iPod to Mac

    I used to have iPod shuffle connected to a PC, I now want to use it on my Mac - I cannot get iTunes to see the shuffle at all - trid the 5 sec fix - no go.  How can I now assign iPod to Mac?

    You can do a platform swap
    Order product | Platform, language swap

  • I have 300 albums of music on my ipod how can I random every song

    I have 300 albums of music on my ipod, how can I random the entire list?

    go to your songs not genre or albums DO NOT USE GENIUS then shuffle or if you want to listen to the songs on an album go to your albums and click on the one you want and shuffle (BTW what iPod gen is yours?)

  • I am English but I live in Spain. when I try to download an app now, as well as my password i get asked to complete a security question from a list. The problem is the list is in Spanish. How can I turn this additional security off

    I am English but I live in Spain. when I try to download an app now, as well as my password i get asked to complete a security question from a list. The problem is the list is in Spanish. How can I turn this additional security off.
    Please note: I dont speak Spanish.
    Please HELP

    You can't turn it off.

  • How can i dynamically assign values to the tld file

    How can i dynamically assign values to the tld file

    In the tld you write for the tag handler mention the following sub tags in the attribute
    <attribute>
    <name>xyz</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    import the packagejavax.servlet.jsp.tagext.DynammicAttributes;
    add the method
    public void setDynamicAttribute(String rui, String localname, Object value) throws JspException
    <Your Required task>
    Its better if you SimpleTagSupport class to be extended.

  • How can I download the additional Logic Content to a separate drive?

    As the title says it all ... How can I download the additional Logic Pro X content to a separate drive in case I am formatting my Laptop again to install them quickly ?

    Hi Tom,
    I think I was taking the mention of a blank hdd too literally.
    Download the installation file on to the first computer, presumably the Windows 7 machine you are writing posts on. You may use the site: http://www.mozilla.com/en-US/firefox/all.html the actual installation file downloaded will probably be called something along the lines of ''firefox setup 3.6.13.exe''. Copy the installation file from the 1st computer on to the USB memory stick (I am assuming you are using a memory stick - rather than an internal solid state flash drive) then to the 2nd computer. Click the file to run it and firefox should install.
    For more detail see [[Installing Firefox on Windows]]

  • How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    How can I find out whether I will be charged for texting somebody who lives in Canada and I live in the US?

    If you are on a More Everything plan, International texting is included at no additional charge.
    If you are on any other plan, there will be a charge.
    From Verizon FAQ
    If you have The MORE Everything Plan, unlimited international text and multimedia messaging is included for no additional cost.
    For all other plans, you can find pricing, dialing and coverage information for a specific country on our International Messagingpage.

  • How can we have an anonymous 'User i.d." for discussion group posts only?

    hi. Here we are asking a stupid Q on very first post. How can we have an anonymous 'User i.d." for discussion group only? Seem to be stuck with our regular old original Apple i.d. I see how that can be changed, but don't really want to cuz just want to have my posts signed with a more anonymous i.d. name. Should be simple to do, but not obvious to us now.
    Thnx

    Welcome To  Discussions thelnukus!
    The Alias of the account you are using, cannot be changed, but you can create a new Discussions Account, with an Alias that you prefer.
    You cannot delete your present account. Just stop using it, after you have created a new one.
    You can use all of the same info in the new account, Email address, User name, etc, just be sure to insert a new Alias of your choosing.
    But your Level(0), Points(0), Total Posts(2), Total Posts Online(2) and Registered Date(12/19/06), will not be transferred.
    In the new account, your Post Counts, Points, & Level Status will all start at 0. Your Registered Date will be the date you create the new account.
    Your old account, with your previous counts & level, will still be viewable, under the old Alias.
    (You really don't have anything accumulated, to be concerned about though.)
    After you quit using the old account, those 2 posts, will be archived. What that means is, that if there are no additional responses in the Threads they reside in, the Topics will get continually pushed down on the Topics list. After a certain amount of time, maybe 2 to 6 months, the Threads will be locked, so no responses can be entered. But the Threads will not disappear.
    Threads in heavily trafficked Forums, may be archived more rapidly than those in areas, with less activity.
    The Topics that you started using the old account, will show your Old Alias, in the Author field of a main forum page, but eventually, readers will have to keep going to the succeeding pages to view them.
    If someone were to do a Discussions Search, using these parameters:
    Restrict by Category or Forum: All Categories
    Restrict by Date Range: All
    Restrict by Username: Your Old Alias
    all of your posts, created since about 11/13/05, would be found.
    To create a new account,
    Log out of Discussions. You also may have to delete the Apple Cookies in your browser preferences, but I'm not sure this is necessary. Then follow either of these instructions.
    -How Do I Create My Account?
    If you haven't signed up for an Apple ID for the Apple Store or AppleCare Support website (or forgot your old one), you can create a new account on the My Info webpage. Just click the "create one" link on the right side of the My Info page. Choose your country location and preferred language from the appropriate pop-up menus, then click Create Account. In the resulting page, enter a unique name (such as your email address) in the Apple ID field and fill in your other relevant information accordingly (fields marked with * are required). Click Continue to complete the process.
    -To register, click Login in the sidebar on the right side of the Discussions page. In the resulting page, click the "create one" link at the bottom of the page, then click "create one" in the subsequent page and follow the instructions to create an Apple ID. For more information, see the Apple ID FAQ page.
    Those instructions, and more info, can also be viewed by clicking on ?Help & Terms of Use, in the right column of Discussions pages.
    ali b

  • How can I connect my TV sony bravia to Imac for display !

    How can I connect my TV sony bravia to Imac for display ! I did it before but a week ago crash my sistem and been to apple store london to fix it and wend I come home I can not reconnect the tv to imac ! please help !!!!!!!!!!!

    I BUY A CABLE FROM AMAZON.CO.UK AND MY iMAC WAS WORKING WITH THIS CABLE BUT AFTER THEY (APPLE STORE REGENT STREET ) REPARIT NOW IS NOT RECONICE THE DISPLAY !!!!!

  • My husband and I share an iTunes account. We both just got iPads. How can we program them to have different phone numbers for FaceTime and messages

    My husband and I share an iTunes account. We both just got iPads. How can we program them to have different phone numbers for FaceTime and messages

    Use different email address (gmail?) just for FaceTime and Messages.
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    For non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
     Cheers, Tom

  • HT1727 i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    If you bought them on your iPad then you will need to connect your iPad to your computer's iTunes and do File > Devices > Transfer Purchases to copy them over to the Tones part of your computer's iTunes library and you can then sync them to your iPhone - ringtones are a one-time only download, so you won't be able to redownload them directly on your phone.

  • How can i export a 24bit avi file from photoshop for mac?

    how can i export a 24bit avi file from photoshop for mac? i have a client that specificly needs the files to be avi and in 24bit what are the settings that i need to use to export the video using photoshop on a mac?

    Hello,
      To make a 24-bit AVI file in Photoshop, go to File>Export>Render Video. Then, under File Options, choose AVI from the Quicktime Export drop-down menu. Click the Settings button. Click the Settings button in the AVI Settings window. Change Compression to None, and then choose "Millions of Colors" from the Depth drop-down under Compression.
      The Millions of Colors option is for 24-bit video (8-bit R+G+B channels, 8x3=24). Millions of Colors+ is for 32-bit video (24-bit video plus an 8-bit alpha channel).
    -Brett

  • How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8

    Dear Sir/Madam,
    How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8.
    Actually my problem is that When i am using Custom  MessageBox in SelectionChangedEvent of LongListSelector,when i am click Open(Left Button) it's working fine and navigated correctly,But when i am Click the No(Right Button) then it stayed in same page
    but all that page is in stuckup i mean that page is not working and not doing any event.
    My C#.net Code
    private async void userPageLongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
    if (e.AddedItems.Count > 0)
    if (userPageLongListSelector.SelectedItem == null)
    return;
    if (dbTenMin == null)
    dbTenMin = new Database(ApplicationData.Current.LocalFolder, "tenMInDBSchema.db");
    await dbTenMin.OpenAsync();
    var res = (sender as LongListSelector).SelectedItem as _10Min._10MinClass.minUserPages;
    var resIndex = (sender as LongListSelector).ItemsSource.IndexOf(userPageLongListSelector.SelectedItem);
    string selectedPageName = res.userPages.ToString();
    string selectedPageDesignUser = res.pageDesignUser.ToString();
    int selectedIndex = resIndex;
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    string uidAndpwd = _10MinClass._10MinStaticClass.csUidAndPwd.ToString();
    _10MinClass._10MinStaticClass.csDataListPageDetails = selectedPageDataDetailsForSchema.ToString();
    _10MinClass._10MinStaticClass.csAllDataLists = offlineDataBaseDataListNam;
    _10MinClass._10MinStaticClass.csNotCreatedSchemaNameOfDBList = notCreatedDataLists;
    userPageLongListSelector.SelectedItem = null;
    if (dbTenMin != null)
    dbTenMin.Dispose();
    dbTenMin = null;
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    else
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    Same custom messagebox code working in Phone_BackKeyPress event i am writing the code in Right Button that e.OriginalSource.ToString(); then it is working fine.
    But It is not working in Selection Changed Event in LongListSelector control in Windows Phone 8.
    Please help me,as soon as possible.
    Thanks & Regards,
    SrinivaaS.

    What happens if you leave the implementation for LeftButton empty as well , does the page gets stuck in that case also, if you press left button?
    i.e.
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • HT204053 If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad

    If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad by getting it off my iCloud?

    She can't from iCloud without setting up your iCloud account on her phone. But just sync the same apps from your iTunes Library on your computer to her phone.
    Your wife should setup her own iCloud account - which is separate to the iTunes Store accounts.

  • How can we add a control on our .jsp webpage for uploading several image fi

    How can we add a control on our .jsp webpage for uploading several image files as done in gmail attachment, Where a Remove button also appears if we wanna remove the particular attachment.

    The SCOM Management Server is in Domain A.  I've tried it already and it has failed.  
    So just to clarify the method I used was to go to Administration>Security>User Roles.  Then New User Role>Read-Only Operator.  In the Create User Role Wizard I then gave the User Role a name, Clicked "Add" under User Role Members.
     Then the Select Users or Groups window pops up and I changed the Locations from Domain A to Domain B and searched for the user, which it's able to find, then clicked "OK" to add it to the User Role members which it does just fine.  On
    the next page which is Group Scope I checked the one group I want this account to have access to and then click next.  This brings me to Dashboards and Views where I click the radio button for "Only the dashboards and views selected in each tab are
    approved" and chose the folder of dashboards I want this account to access and then click next.  This brings me to the Summary and I click "Create".  At this point it thinks for a moment then closes out the wizard but the new Read-Only
    Operator does not appear.  I then look in Event Viewer and see the Event I pasted above.
    Am I doing something wrong here?  Any guidance on how to get around this issue would be much appreciated.
    Thanks,
    Jake

Maybe you are looking for

  • HELP! iMac G5 hangs at blue screen, but boots in Safe Mode

    Please can anyone guide me to recover my iMac G5 PowerMac 8,2 running OS X 10.4.11. Problem; Mac hangs on start-up at blue screen after grey Apple screen. Mouse pointer eventually appears but that is all. Actions taken so far without success: 1.  Dis

  • Help! All of my Itunes comments, ratings, playlists have disappeared.

    I am not an expert, but I have been trying to find an answer to my problem and have learned enough to know that it must be possible to save the work I`ve done, but I don`t know how. I have a large music library - about 15000 songs which I keep on an

  • SQL Loader XML Missing Data

    I am trying to load a XML file via SQL Loader. My loader file is as follows: LOAD DATA INFILE 'C:\Infile.xml' "str'</Record>'" BADFILE 'C:\Infile.bad' Replace INTO TABLE Cust_Table TRAILING NULLCOLS dummy filler terminated by ">", Month enclosed by "

  • Sharing photos to e-mail recipients.

    I am using OS X 10.5.8.  When I select a series of photos in iPhoto and hit the share icon I get an e-mail form.  When I add a number of recipients to the address window, if there are a lot, they don't appear in the window.  Also, the text that I typ

  • Safe O/C for MSI 9800 Pro

    I would like to know with your experiencie with the msi 9800 pro, what is safe with the stock cooling to o/c this card? Now I have it mine in 411.75/364.50 (XT speeds), no artifacts in 3dmarks 01 and 03. I run the Atitool when I bought it, and gave m