Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 12856
52
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: 23877
142
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

 
There's a way to do it better - find it. -Edison. A better tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic