Formula in Sampler

CODAP Forums CODAP Help Forum Formula in Sampler

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6549 Score: 0

    I have created a simulation to replicate the drawing of two cards, with replacement, from a set of cards. I want to create a formula that will determine whether the result was two black cards or not. I realize that it will be an If( formula, but I am unsure of the syntax.

    Any help is greatly appreciated.

    #6550
    Bill Finzer
    Keymaster

    Hello Patrick,

    Assuming your cards are labeled like “5S” or “JD” this formula worked for me:

    (charAt(first(value),2)=”S” or charAt(first(value),2)=”C”) and (charAt(last(value),2)=”S” or charAt(last(value),2)=”C”)

    See the screenshot for the setup. Oh, and be sure to label the ten cards with a “T” rather than “10” since the latter will throw the indexing off.

    Good luck!

    Bill

    #6552

    Thanks Bill!

     

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.