#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)
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
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.
@brazen edgeinteresting, how did you check?
personal computer
They probably wrote a program
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
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
@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
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)!}$
Ralepsi
where n is the number of different types of blocks, and r is the number of blocks in the tower.
that's not the answer
it gives number of different sorted towers, they don;t all have different heights
heres a hint: 286 ways of choosing 10 blocks
your way is wrong
prove it
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
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]
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
is the answer 210?
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?
@brazen edge
what are yall computing lol