#A tower has 10 blocks. Each blocks height can be 2, 3,7, or 9. How many different possible heights?

121 messages · Page 1 of 1 (latest)

surreal sundialBOT
north pier
#

What have you tried?

#

Just start trying it, then look for patterns later

#

There's no magic to a question like this.

#

I'm literally telling you how to solve it

#

You can pretend the possible block heights are 0,1,5,7

severe tulip
#

sorry man we dont do that here, if you have no intention on putting any effort on your part and trying to learn then look for answers someplace else.

north pier
#

You should show what you've done to get more specific help.

#

2+2+2+2+7=3+3+3+3+3

eternal prairie
#

Ah ofc.

#

Plz ellaborate, I dont understand

hollow chasm
#

i get only 480

#

surprisingly few

hollow chasm
#

@brazen edgeinteresting, how did you check?

hollow chasm
hollow chasm
#

it's the 480 heights i got

#

could be important to you, so i sent just in case

hollow chasm
#

what no

#

it was compooted on a thingie

hollow chasm
#

personal computer

manic ridge
#

They probably wrote a program

brazen edge
# hollow chasm

im very stupid so dont be mad at me but this is kind of brute force dont you think?

#

isnt there some sort of equation for this

#

like maybe multiply all the possible numbers by 10

#

20, 30, 70, 90

#

and add all those up

#

that should be the max

#

i think im very wrong

#

or maybe wait

#

maybe you could split the 10?

#

theres max 10 right

#

4 possible numbers

#

oh wait the question was how many possible heights

#

not the heighest

#

im very stupid

#

sorry

#

i was confused for a sec cuz my brain just said "90" but i said that makes no sense

#

so yeah im dumb

#

sowwy

#

could it be as simple as 2 x 3 x 7 x 9 x 10 ?

#

thats 3780 btw

brazen edge
#

WAITTTT

#

COULD IT BE 2140????

#

i think i solved it

jolly raptor
#

can yu explain? I stumbled over this and now Im invested HAHAHA how did you solve it

#

doesnt seem right to me, dont u gotta do something with exponentials

#

Idk, 388 is a way too low number for a 97 brick tower with each brick having different hight combs

#

I failed statistics :,)

#

So idk

#

this is getting so complicated 🗿

#

yes

#

thank you I feel like my brain will die if I try to learn this, imma go back to my calculus but thank you for the explanation! I get the principle

hollow chasm
#

@brazen edgei can see how it makes sense if you have 2 types of bricks, i don;t know how you can extend to 3

#

i mean, if you have at most 2 types at the same time, you can count repeating heights from lcm of 6 and 15

#

hm

#

well nevermind i'll assume there's no way

#

no clue what you mean

brazen edge
#

too lazy to do the fingers math, i give u the formula and what u need to substitute

#

$\binom{n+r-1}{r} = \frac{(n+r-1)!}{r!(n-1)!}$

frosty relicBOT
#

Ralepsi

brazen edge
hollow chasm
#

that's not the answer

brazen edge
#

there have fun solving

#

yes, this is a combinations by with repitition problem

hollow chasm
#

it gives number of different sorted towers, they don;t all have different heights

brazen edge
hollow chasm
#

your way is wrong

brazen edge
hollow chasm
#

you can make different towers with the same height

#

your way counts different towers

#

so it's useless

#

465 is also wrong so you're both wrong

#

however, i'm correct

#

it says 94

#

different problems often have different answers

brazen edge
#

the minimum possible height for the tower is obtained by choosing all blocks of height 2, which gives a height of 2×10=20. the maximum possible height for the tower is obtained by choosing all blocks of height 9, which gives a height of 9×10=90. the range of possible heights for the tower is from 20 to 90.

#

the formula is wrong

#

is this even the topic anymore

#

ok

#

i forgot

#

which forum again

#

man i forgot

#

ohh

#

ill do it in the head again wait

#

can u zoom to the problem

#

is blurry af

#

zoom to the problem

#

bcoz its blurry for me

#

ok so i expanded it again, yes we didnt needto bcoz the equations are identical because the right hand of the equation is just rearrangement of the terms on the left hand side. when i expanded it, the terms cancel out, leaving me x^n - y^n which is equal to the left hand side of that equation

#

back to the original problem, let dp[i][j] be the number of ways to build a tower of height j using i blocks. The base case is dp[0][0] = 1, since there is one way to build a tower of height 0 using 0 blocks. for each block, we can choose its height to be either 2, 3, 7, or 9 units. so, for each i from 1 to 10 and for each j from 2 to 90, we have dp[i][j] = dp[i-1][j-2] + dp[i-1][j-3] + dp[i-1][j-7] + dp[i-1][j-9]

mint ledge
#

10C4

#

umm

#

pnc?

#

combinations

coral kernel
#

10000000010000010010000010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010000010000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

each 1 denotes a height that is valid, first 1 is 94*19, then it decreases by 1 per number

#

there is definitely a pattern

#

I also got 465

#

94 bricks, 4, 10, 19

mint ledge
#

is the answer 210?

coral kernel
#

i can compute any generalized version of this problem if u want

#

ya

#

sure

#
#include <bits/stdc++.h>
using namespace std;

const int TOTAL_BRICKS = 94;
const vector<int> BRICKS = {4, 10, 19};
const int MAX_BRICK_VAL = 19;
constexpr int MAX_TOTAL_BRICK_VAL = MAX_BRICK_VAL*TOTAL_BRICKS+1;

int main() {
  vector<bitset<MAX_TOTAL_BRICK_VAL>> dp (TOTAL_BRICKS+1, bitset<MAX_TOTAL_BRICK_VAL>(0));
  dp[0] = bitset<MAX_TOTAL_BRICK_VAL> (1);

  for (int i = 1; i <= TOTAL_BRICKS; i++) {
    for (int j = 0; j < BRICKS.size(); j++) {
      dp[i] |= dp[i-1] << BRICKS[j];
    }
  }

  int cnt = 0;
  for (int i = 0; i < MAX_TOTAL_BRICK_VAL; i++) {
    if (dp[TOTAL_BRICKS][i]) cnt++;
  }


  cout << cnt << endl;
  cout << dp[TOTAL_BRICKS] << endl;
}```
#

this is c++

#

need a compiler ig?

mint ledge
#

hmm

#

its less than 210 then right?

coral kernel
#

yea just change the const values

#

should be simple to use

mint ledge
#

@brazen edge

mint ledge
#

its less than 210 then right?

#

icic

coral kernel
#

what are yall computing lol

mint ledge
#

so there must be ones which are repeating

#

can u paste the question again?

coral kernel
#

i'm getting 68 with your original question

#

Is there a good solution without just brute forcing it with programming lol

#

I feel like the aime question might've had a nice solution, i don't think the general question does though