Tiling Problem Part II

I didn’t understand the problem how to find the number of ways . Is this problem can solve with permutations and combination like things?
like if we have 4x4 nxm , tile size if 1xM, if we place the tile in horizontally the 4 tile is need
f(n-1), if we place it vertically then f(m-1)

@Vikaspal,
Given n x m floor, and 1 x m tiles, Let f(n) be the number of ways to tile the floor,
If we place a tile vertically, we will have f(n-1) ways to tile the leftover floor, but if we place ‘m’ horizontal tiles, then we have f(n-m) ways to tile the leftover floor,
Thus, f(n) = f(n-1) + f(n-m).

By the way, Can this problem be solved by PnC like things ?, would be a more grammatically correct way to say it.

@abhijeet.srivastava6499 how f(n-m) in horz suppose we have 44 size then if place 41 horizon, then there will be f(n-1) floor left

@Vikaspal,

@abhijeet.srivastava6499 can u give me an example where three ways are possible.
even i didn’t how the n-m is computed

get TLE https://ide.codingblocks.com/s/221070

@Vikaspal,
MEMOIZE!!!

@abhijeet.srivastava6499 DP

@Vikaspal,
Sorry, what do you mean?

@abhijeet.srivastava6499 I am getting TLE how can i aviod dynamic programming

@Vikaspal,
You don’t have to avoid dp, you have to use it. Do you understand what memoization means?

@abhijeet.srivastava6499 no i didn’t get.

@Vikaspal,
Then leave this problem for now, come back to it ones you have done the dp section of your course.

@abhijeet.srivastava6499 okay bro

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.