This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Salman and flowers  RSS feed

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I have a real time problem which is like:
Salman has a garden with N flower pots arranged in a row. Every morning he walks through the row and plucks flower. He targets to visit the first K pots in the row.
Find the number of different flowers that Salman would pluck on a single walk through K pots.
What is the approach of solution for this problem
Also, let me know where i can find more such problems.

Shivani
 
Saloon Keeper
Posts: 3257
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Missed this puzzle completely. Hope OP is still around...

Can you elaborate in what way the flowers are different, and why he wouldn't pluck the first K flowers one day, the next K flowers the following day, until all flowers are plucked?

If you want to see similar puzzles, Google for "probability puzzles", you will find a lot of sites. A classical one is of course the three doors problem. Always funny, and it once led to a gigantic discussion in the newspapers here in Holland.
 
It's just a flesh wound! Or a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!