• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Coin: heads and tails

 
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.

 
lowercase baba
Posts: 12760
51
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
 
author
Posts: 23838
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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

 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!