Algorithm of 102- Ecological Bin Packing

In this problem have three color bottol B, G, C and three recycle or bucket. given some bottol each bucket each color you need to minimum change as a result same color bottol in only one bucket . if more than one combination precedence of alphabatic order.

image

102- Ecological Bin Packing

Problem Description
source: https://uva.onlinejudge.org/external/1/p102.html

Bin packing, or the placement of objects of certain weights into different bins subject to certain constraints, is an historically interesting problem. Some bin packing problems are NP-complete but are amenable to dynamic programming solutions or to approximately optimal heuristic solutions.
    In this problem you will be solving a bin packing problem that deals with recycling glass.

    Recycling glass requires that the glass be separated by color into one of three categories: brown glass, green glass, and clear glass. In this problem you will be given three recycling bins, each containing a specified number of brown, green and clear bottles. In order to be recycled, the bottles will need to be moved so that each bin contains bottles of only one color.
image

Algorithm of 3n + 1 problem

Consider the following algorithm:
 
  1.    input n

  2.    print n

  3.    if n = 1 then STOP

100 - The 3n + 1 problem

 Problem description
source:https://uva.onlinejudge.org/external/1/p100.html

Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.

Consider the following algorithm:
1. input n
2. print n
3. if n = 1 then STOP
4. if n is odd then n ←− 3n + 1
5. else n ←− n/2
6. GOTO 2

Given the input 22, the following sequence of numbers will be printed

image