• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coin: heads and tails  RSS feed

 
Casper Shoemaker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

when i flip two coins with 1000 times, how many times it will be:
- on both coins tails
- on both coins heads
- on first coin tails and second heads
- on first coin heads and second tails

Some thing i can not figure.

 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
turn off you computer. forget about java.

How would you do this with actual coins?

You have to flip two coins each time (or flip a coin once, record the result, then flip it again).

so you need at minimum two random numbers for each iteration in your loop.
 
Casper Shoemaker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:turn off you computer. forget about java.

How would you do this with actual coins?

You have to flip two coins each time (or flip a coin once, record the result, then flip it again).

so you need at minimum two random numbers for each iteration in your loop.


i'm a beginner, you farmTender :p
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Casper Shoemaker wrote:
i'm a beginner, you farmTender :p


Fred is actually giving very good advice here. Programming is about teaching the computer to do something. And it is very difficult to teach the computer to do something when you can't do it yourself. Most beginners needs to understand that first.

So, can you think this through on paper? What issues are you running into?

Henry
 
Casper Shoemaker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Casper Shoemaker wrote:
i'm a beginner, you farmTender :p


Fred is actually giving very good advice here. Programming is about teaching the computer to do something. And it is very difficult to teach the computer to do something when you can't do it yourself. Most beginners needs to understand that first.

So, can you think this through on paper? What issues are you running into?

Henry


I apologize to Fred!

i'm a cow, i eat grass, so that means, that i'd never tasted anything else.
I think, i'll never be a programmer, but i still have somewhere in my heart wish to become (but i'm not so smart

i'm 30 years old and my grey cells are a little weak now..i didn't just eat grass ;) when i was a calf.
First i'm working for my exam, next i'll go further.

So thank you all for such help, even tight sometime.

regards
 
Casper Shoemaker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here you go, thanks Henry

regards

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!